Metadata ######## The :file:`metadata.config.php` file is how an application is defined. It tells what contains the application and what it does. The most important keys are: :name: The name of the application. :namespace: In which PHP namespace all the classes of the application must be defined. :icons: In the 3 standard sizes 16*16, 32*32 and 64*64. :requires: Optional. Which applications does your application requires. Array or string (in the last case, considered as an array with a unique element). .. code-block:: php 'Webpages', 'namespace' => 'Nos\Page', 'version' => '0.2', 'provider' => array( 'name' => 'Novius OS', ), 'extends' => array( // Optional, ), 'requires' => array( // Optional ), 'icons' => array( 64 => 'static/apps/noviusos_page/img/64/page.png', 32 => 'static/apps/noviusos_page/img/32/page.png', 16 => 'static/apps/noviusos_page/img/16/page.png', ), 'permission' => array( // Empty array for now. Leave it. ), 'i18n_file' => 'noviusos_page::metadata', 'launchers' => array( // Optional ), 'enhancers' => array( // Optional ), 'templates' => array( // Optional ), 'data_catchers' => array( // Optional ), ); An application provides: Extends ======= Application can extend other applications. The scope of the extension depends on the configuration you provide. The value of the `extends` key can be an associative array: :application: Application that is extended :extend_configuration: Optional, default value is true. Boolean defining if configuration files are extended (the extended application's configuration files are recursively merged with those of the extending application). .. _php/configuration/metadata/launchers: Launchers ========= A :term:`launcher ` is an icon on the home tab. A launcher is defined by an associative array. Key is launcher ID, launcher properties is an associative array: :name: Text to display for the icon. :icon: Optional. URL to a 64*64 image, default will use the 64*64 icon of the app. :action: What is done when clicking on the launcher. See :ref:`php/configuration/application/nosActions`. .. code-block:: php array( 'noviusos_page' => array( 'name' => 'Webpages', // 'icon' is not set, so the default icon will be used 'action' => array( // open a tab 'action' => 'nosTabs', 'tab' => array( 'url' => 'admin/noviusos_page/appdesk/index', // 'iconUrl' is not set, so the default icon will be used ), ), ), ), ); .. _metadata/enhancers: Enhancers ========= :term:`Enhancers ` are used in WYSIWYG editors. They provide functionalities for the front-office. For example, the ‘Forms’ application allows users to insert forms in their web pages (using an enhancer). :term:`URL enhancers `, a specific type of enhancers, handle their own URLs. For example, every blog post has an URL. .. image:: images/metadata_enhancer.png :alt: The ‘Form’ enhancer :align: center An enhancer is defined with: :title: Title of the enhancer displayed when opening the ‘Application’ menu from the wysiwyg. :desc: Optional. Description of the enhancer. :iconUrl: Optional. URL to a 16*16 icon, displayed when opening the ‘Application’ menu from the wysiwyg, default will use the 16*16 icon of the app ; :enhancer: URL of the front-office controller used to render the enhancer. :urlEnhancer: Same that ``enhancer``.Only one of the two keys can is used, depending if you want an URL enhancer or just a plain regular enhancer. :previewUrl: Optional. URL of the controller used to render the preview in the wysiwyg. :dialog: Optional. If you want a configuration popup, URL of the controller used to display and save the enhancer configuration. See :js:func:`$container.nosDialog` for the list of parameters. :valid_container: | Optional. A `callback function `__ to check if the enhancer is available for a specific container. | If the function returns false, the enhancer won't be available. | The function takes two parameters: the enhancer's configuration and the :php:class:`container instance `. .. code-block:: php array( 'title' => 'Form', 'desc' => '', // Here it's just a regular enhancer 'enhancer' => 'noviusos_form/front/main', //'urlEnhancer' => 'noviusos_form/front/main', 'iconUrl' => 'static/apps/noviusos_form/img/icons/form-16.png', // We'll use our controller to generate the preview 'previewUrl' => 'admin/noviusos_form/enhancer/preview', // And the user has to configure it 'dialog' => array( 'contentUrl' => 'admin/noviusos_form/enhancer/popup', 'width' => 450, 'height' => 400, 'ajax' => true, ), // The callback function which check availability of the enhancer 'valid_container' => 'validContainer', ), ); // In this example, the enhancer won't be available in WYSIWYGs of monkeys. function validContainer($enhencer, $container) { $container_class = get_class($container); return $container_class !== 'Nos\Monkey\Model_Monkey'; } .. _metadata/templates: Templates ========= :term:`Templates