Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

Source for file rules.php

Documentation is available at rules.php

  • <?php
  • /**
  •  * AJAX Responder plugin parameters.
  •  *
  •  * File cotains AJAX responder plugin rules descriptions.
  •  *
  •  * @copyright  Amiro.CMS. All rights reserved.
  •  * @category   Plugin
  •  * @package    Plugin_AJAXResponder
  •  * @filesource
  •  * @version    $Id: rules.php 61273 2013-08-07 10:47:54Z Leontiev Anton $
  •  */
  •  
  • $api->addRule('spl_plugin'RLT_SPLITTERRLC_NONEfalse);
  •  
  • /**
  •  * Plugin module id
  •  */
  • $oDeclarator AMI_ModDeclarator::getInstance();
  • $oServiceAdm new AMI_Service_Adm();
  • $aCaptions array();
  • $aAvailableModules array('articles''blog''news''files''photoalbum''eshop_item''kb_item''portfolio_item''stickers');
  • foreach(
  •     array(
  •         'ami_multifeeds' => array('articles''news''photoalbum''stickers'),
  •         'ami_files'      => array('files'),
  •         'ami_catalog'    => array('items')
  •     as $hyper => $aConfigs
  • ){
  •     foreach($aConfigs as $config){
  •         $aInstanceMoIds $oDeclarator->getRegistered($hyper$config);
  •         foreach($aInstanceMoIds as $modId){
  •             if(!preg_match('/_cat$/'$modId)){
  •                 $aAvailableModules[$modId;
  •                 $aModCaption $oServiceAdm->getModulesCaptions(array($modId)false);
  •                 $aCaptions['module_' strtoupper($modId)$aModCaption[$modId];
  •             }
  •         }
  •     }
  • }
  • $aAvailableModules array_unique($aAvailableModules);
  • $api->addRule('module'RLT_ENUM$aAvailableModules'news'$aCaptions);
  •  
  • /**
  •  * Sorting order
  •  */
  • $api->addRule('order'RLT_CHARarray('length_min' => 2)'id');
  •  
  • /**
  •  * Sorting order direction
  •  */
  • $api->addRule('dir'RLT_ENUMarray('A''D''')'D');
  •  
  • /**
  •  * Items limit per page
  •  */
  • $api->addRule('limit'RLT_UINTarray('min' => 1)3);
  •  
  • /**
  •  * Items list start offset
  •  */
  • $api->addRule('offset'RLT_UINTarray()0);
  •  
  • /**
  •  * Default page id
  •  */
  • $api->addRule('id_page'RLT_CHARarray()0);
  •  
  • /**
  •  * Default template name
  •  */
  • $api->addRule('template'RLT_CHARarray()'front.tpl');