Пример #1
0
 /**
  * Has client date ?
  * Mainly this method is used when category is going to be deleted.
  * 
  * @param	array	$client
  * 
  * @return	mixed[]
  **/
 public function hasClientData()
 {
     $clientList = Lecat_Utils::getClientList($this->getDirname());
     $list = array('title' => array(), 'template_name' => array(), 'data' => array(), 'dirname' => array(), 'dataname' => array());
     foreach ($clientList as $client) {
         $list = $this->getClientData($client, $list);
         if (count($list['data']) > 0) {
             return true;
         }
     }
     return false;
 }
Пример #2
0
 /**
  * executeViewSuccess
  * 
  * @param   XCube_RenderTarget  &$render
  * 
  * @return  void
  **/
 public function executeViewSuccess(&$render)
 {
     $render->setTemplateName($this->mAsset->mDirname . '_cat_view.html');
     //format Permissions for html form
     $permissions = new Lecat_Permission($this->mAsset->mDirname, $this->mObject);
     $gPermit = $this->mObject->getThisPermit() ? $this->mObject->getThisPermit() : array();
     $permissions->setPermissions($gPermit);
     //set renders
     $render->setAttribute('dirname', $this->mAsset->mDirname);
     $render->setAttribute('object', $this->mObject);
     $render->setAttribute('childrenTree', $this->mObjectHandler->getTree());
     $render->setAttribute('permitObj', $permissions);
     //modules confinement
     $render->setAttribute('modulesArr', $this->mObject->getModuleArr());
     //for permit addition
     $this->mActionForm->load($this->mPermit);
     $render->setAttribute('actionFormPermit', $this->mActionForm);
     $list = array();
     $clientList = Lecat_Utils::getClientList($this->mAsset->mDirname);
     $render->setAttribute('clientList', $clientList);
     $list = array('title' => array(), 'template_name' => array(), 'data' => array(), 'dirname' => array(), 'dataname' => array());
     foreach ($clientList as $client) {
         $list = $this->mObject->getClientData($client, $list);
     }
     $render->setAttribute('clients', $list);
 }