Skip to content

Version 0.4.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@julien1619 julien1619 released this 18 Mar 22:36

This release can be used in production but very carefully because the core is still under development and some parts will be added in the next release.

New features:

  • WRetriever allows to render multiple applications on the same page by returning the generated view of each application. If you want, you can only retrive the model (php array, json).

In templates:

<div>{retrive_view app_name/action}</div>
{set $model = {retrieve_model app_name/action/param1/param2?var1=value1&var2=value2}}
<ul>
  {for $m in $model}
    <li>...</li>
  {/for}
</ul>

In Ajax:

$.ajax({
  url: '/m/app_name/action', // /m/ for model, /v/ for html view, /mv/ for both in a json object
  success: function(response) {
    response.results; // object returned by the called action (php array => javascript object)
    response.notes;   // array of notes
  }
});

In php code:

$model = WRetriver::getModel('app_name', array('action', 'param1', ...));
$view = WRetriver::getView('app_name', array('action', 'param1', ...));

Every action called use the internal permission system to resolve user rights.

  • Installer has been totally rewritten to be really stable. Its code will be partly reused to build a form generator in the next version.
  • contact app added.
  • mail app added. It works as an internal service, for now used by the new contact app. It allows applications to send email to a lot of people, customizing email for each one using WTemplate to compile the mail subject and body. It has a links manager system for the apps using it to be able to add expirable links in the mail body.
WRetriever::getModel('mail', array(
  'origin' => array(
    'app' => 'app_name',
    'action' => 'action',
    'parameters' => array(...)
  ),
  'response_policy' => 'all'|'from' (default)|'none',
  'action_expiration' => 'one-time-action'|'one-time-mail'|DateInterval initializer ('P30D' default)|array('one-time-action'|'one-time-mail', DateInterval initializer),
  'response_callback' => '/app_name[/action][/param1[/...]]?getparam1=value1[&...]',
  'defaults' => array(
    'from' => email|array(email[, name]),
    'to' => array(email[, name])|array(array(email[, name])),
    'cc' => array(email[, name])|array(array(email[, name])),
    'bcc' => array(email[, name])|array(array(email[, name])),
    'attachments' => array(url[, name])|array(array(url[, name])),
    'subject' => string,
    'body' => string|template_file,
    'params' => array(key => value)
  ),
  'specifics' => array(/*[each line is similar to the 'defaults' array]*/)
);
  • Overriding an application template (frontend only) is now possible from your custom theme. You just have to create a folder in the templates directory of your theme and named as the application you want to override and create an html file inside it. It will be automagically used as replacement of the original html file of the application.
  • Require.js added for managing javascript libraries and dependencies. The library you want to use can be in libraries, in themes, or in apps. The default is in libraries which contains a libraries.json file to describe original dependencies and names. If you need a library which is inside an app, prefix it with apps! and add app_name to load the main.js file which is inside apps/app_name/js, finally apps!app_name. If you need a file which is not the main.js file, fileA.js for instance, then use apps!app_name/fileA. The same pattern applies for themes but with themes! instead of apps!. The global variable used for assigning it is 'require' This part could change in the next version to be easier to use, and, mainly, more intuitive.
  • Updating jQuery to 1.11.0 and Bootstrap to 3.1.0
  • wysihtml5 replaced by CKEditor
  • New global variables available in templates:
    • {$wity_base_url} : site's URL
    • {$wity_site_name} : site's name
    • {$wity_site_subtitle} : site's subtitle (for now equal to site's name)
    • {$wity_page_title} : page's title (can be modified by app)
    • {$wity_page_keywords} : page's keywords (can be modified by app)
    • {$wity_page_description} : page's description (can be modified by app)
    • {$wity_user} : boolean to know whether the current user is connected or not. If yes, following variables are also assigned : {$wity_user_nickname}, {$wity_user_email}, {$wity_user_groupe}, {$wity_user_lang}, {$wity_user_firstname}, {$wity_user_lastname}, {$wity_user_access}
    • {$wity_home}: true on home page, false otherwise
    • {$wity_app} : current app being executed
  • WDate manages dates to take account of the user timezone
  • A lot of bug fixes and translations added