當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JModel::getState方法代碼示例

本文整理匯總了PHP中JModel::getState方法的典型用法代碼示例。如果您正苦於以下問題:PHP JModel::getState方法的具體用法?PHP JModel::getState怎麽用?PHP JModel::getState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JModel的用法示例。


在下文中一共展示了JModel::getState方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getState

 function getState($property = null)
 {
     if (!$this->__state_set) {
         $option = JRequest::getCmd('option');
         $app =& JFactory::getApplication();
         $context = $option . '.' . $this->getName();
         $this->setState('filter_published', $app->getUserStateFromRequest($context . '.filter_published', 'filter_published', 0, 'int'));
         $this->setState('filter_catid', $app->getUserStateFromRequest($context . '.filter_catid', 'filter_catid', 0, 'int'));
         $this->setState('filter_species', $app->getUserStateFromRequest($context . '.filter_species', 'filter_species', 0, 'word'));
         $this->setState('filter_location_state', $app->getUserStateFromRequest($context . '.filter_location_state', 'filter_location_state', 0, 'word'));
         $this->setState('filter_adoption_status', $app->getUserStateFromRequest($context . '.filter_adoption_status', 'filter_adoption_status', 0, 'word'));
         $this->setState('filter_real_time_need', $app->getUserStateFromRequest($context . '.filter_real_time_need', 'filter_real_time_need', 0, 'word'));
         $this->setState('filter_real_time_status', $app->getUserStateFromRequest($context . '.filter_real_time_status', 'filter_real_time_status', 0, 'word'));
         $this->setState('filter_search', $app->getUserStateFromRequest($context . '.filter_search', 'filter_search', ''));
         $this->setState('filter_order', $app->getUserStateFromRequest($context . '.filter_order', 'filter_order', 'title', 'cmd'));
         $this->setState('filter_order_Dir', $app->getUserStateFromRequest($context . '.filter_order_Dir', 'filter_order_Dir', 'ASC', 'word'));
         $limit = $app->getUserStateFromRequest($context . '.limit', 'limit', $app->getCfg('list_limit', 5), 'int');
         //strange limitstart
         //	$limitstart	= $app->getUserStateFromRequest( $context.'.limitstart', 'limitstart', 0, 'int' );
         $limitstart = JRequest::getInt('limitstart', 0, '', 'int');
         $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
         $this->setState('limit', $limit);
         $this->setState('limitstart', $limitstart);
         $this->__state_set = true;
     }
     return parent::getState($property);
 }
開發者ID:snellcode,項目名稱:ARCNA-Animals,代碼行數:27,代碼來源:animals.php

示例2: getState

 /**
  * Overridden method to get model state variables.
  *
  * @param	string	Optional parameter name.
  * @param	mixed	The default value to use if no state property exists by name.
  * @return	object	The property where specified, the state object where omitted.
  * @since	1.6
  */
 public function getState($property = null, $default = null)
 {
     // if the model state is uninitialized lets set some values we will need from the request.
     if ($this->__state_set === false) {
         $this->__state_set = true;
     }
     $value = parent::getState($property);
     return is_null($value) ? $default : $value;
 }
開發者ID:vuchannguyen,項目名稱:hoctap,代碼行數:17,代碼來源:schema.php

示例3: getState

 function getState($property = null)
 {
     static $set;
     if (!$set) {
         $folder = JRequest::getVar('folder');
         $this->setState('folder', $folder);
         $set = true;
     }
     return parent::getState($property);
 }
開發者ID:reeleis,項目名稱:ohiocitycycles,代碼行數:10,代碼來源:imagehandler.php

示例4: getState

 function getState($property = null)
 {
     static $set;
     if (!$set) {
         $folder = JRequest::getVar('folder', '', '', 'path');
         $this->setState('folder', $folder);
         $parent = str_replace("\\", "/", dirname($folder));
         $parent = $parent == '.' ? null : $parent;
         $this->setState('parent', $parent);
         $set = true;
     }
     return parent::getState($property);
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:13,代碼來源:elementimage.php

示例5: getState

 function getState($property = null)
 {
     $input = JFactory::getApplication()->input;
     static $set;
     if (!$set) {
         $folder = $input->get('folder', '', '', 'path');
         $this->setState('folder', $folder);
         $parent = str_replace("\\", "/", dirname($folder));
         $parent = $parent == '.' ? null : $parent;
         $this->setState('parent', $parent);
         $set = true;
     }
     return parent::getState($property);
 }
開發者ID:joomlacorner,項目名稱:citruscart,代碼行數:14,代碼來源:elementimage.php

示例6: postSaveHook

 /**
  * Function that allows child controller access to model data after the data has been saved.
  *
  * @param	JModel	$model	The data model object.
  *
  * @return	void
  * @since	1.6
  */
 protected function postSaveHook(JModel &$model, $validData = array())
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $task = $this->getTask();
     switch ($task) {
         case 'save2new':
             $app->setUserState('com_modules.add.module.extension_id', $model->getState('module.extension_id'));
             break;
         default:
             $app->setUserState('com_modules.add.module.extension_id', null);
             break;
     }
 }
開發者ID:carmerin,項目名稱:cesae-web,代碼行數:22,代碼來源:module.php

示例7: getState

 public function getState($property = null)
 {
     static $set;
     $option = JRequest::getCmd('option');
     $application = JFactory::getApplication();
     if (!$set) {
         // current type
         $type = $application->getUserStateFromRequest($option . '.type', 'type', '');
         $this->setState('type', $type);
         if ($type == 'link_file') {
             $default_folder = 'images/';
         } else {
             $default_folder = COM_SIMPLELISTS_DIR;
         }
         // Current folder
         $folder = $application->getUserStateFromRequest($option . '.files.folder', 'folder', $default_folder);
         // Workaround for com_media
         if (!is_dir(JPATH_SITE . '/' . $folder) && is_dir(JPATH_SITE . '/images/' . $folder)) {
             $folder = 'images/' . $folder;
         }
         // Save the state of this folder
         if ($folder == '.') {
             $folder = false;
         }
         if (!empty($folder) && preg_match('/\\/$/', $folder) == false) {
             $folder = $folder . '/';
         }
         $this->setState('folder', $folder);
         // Save the state of this folder
         $parent = dirname($folder);
         if (empty($folder)) {
             $parent = false;
         }
         $this->setState('parent', $parent);
         // Current item
         $current = $application->getUserStateFromRequest($option . '.files.current', 'current', '');
         $this->setState('current', $current);
         $set = true;
     }
     return parent::getState($property);
 }
開發者ID:renekreijveld,項目名稱:SimpleLists,代碼行數:41,代碼來源:files.php

示例8: getState

 function getState($property = null)
 {
     static $set;
     if (!$set) {
         $folder = JRequest::getVar('folder', '', '', 'path');
         $upload = JRequest::getVar('upload', '', '', 'int');
         // Phoca Gallery folder images/phocagallery = ''
         // Media Manager folder images/phocagallery = 'phocagallery'
         // After uploading via Media Manager, we covert the media manager folder to phoca gallery folder
         /*	if ($upload == 1) {
         				$countReplace = 1;
         				$folder = str_replace('phocagallery','',$folder,$countReplace );
         				if (substr($folder,0,1) == '/') {
         					$folder = str_replace('/','',$folder,$countReplace );
         				}
         			}*/
         $this->setState('folder', $folder);
         $parent = str_replace("\\", "/", dirname($folder));
         $parent = $parent == '.' ? null : $parent;
         $this->setState('parent', $parent);
         $set = true;
     }
     return parent::getState($property);
 }
開發者ID:RangerWalt,項目名稱:ecci,代碼行數:24,代碼來源:phocagalleryi.php

示例9: getState

 /**
  * Overridden method to get model state variables.
  *
  * @param	string	Optional parameter name.
  * @param	mixed	The default value to use if no state property exists by name.
  * @return	object	The property where specified, the state object where omitted.
  * @since	1.6
  */
 public function getState($property = null, $default = null)
 {
     // if the model state is uninitialized lets set some values we will need from the request.
     if ($this->__state_set === false) {
         $app = JFactory::getApplication();
         $this->setState('action', $step = $app->getUserState('com_kunena.install.action', null));
         $this->setState('step', $step = $app->getUserState('com_kunena.install.step', 0));
         $this->setState('task', $task = $app->getUserState('com_kunena.install.task', 0));
         $this->setState('version', $task = $app->getUserState('com_kunena.install.version', null));
         if ($step == 0) {
             $app->setUserState('com_kunena.install.status', array());
         }
         $this->setState('status', $app->getUserState('com_kunena.install.status'));
         $this->__state_set = true;
     }
     $value = parent::getState($property);
     return is_null($value) ? $default : $value;
 }
開發者ID:laiello,項目名稱:senluonirvana,代碼行數:26,代碼來源:model.php

示例10: postSaveHook

 /**
  * Function that allows child controller access to model data after the data has been saved.
  *
  * @param   JModel  &$model     The data model object.
  * @param   array   $validData  The validated data.
  *
  * @return  void
  *
  * @since   1.6
  */
 protected function postSaveHook(JModel &$model, $validData = array())
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $task = $this->getTask();
     switch ($task) {
         case 'save2new':
             $app->setUserState('com_modules.add.module.extension_id', $model->getState('module.extension_id'));
             break;
         case 'save':
             $app->setUserState('com_modules.add.module.extension_id', null);
             // Redirect to the list screen.
             $this->setRedirect(JRoute::_(sprintf('index.php?option=%s&view=modules', RokSprocket_Helper::getRedirectionOption()) . $this->getRedirectToListAppend(), false));
             break;
         case 'ajaxsave':
         default:
     }
     $app->setUserState('com_modules.add.module.params', null);
 }
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:29,代碼來源:module.php


注:本文中的JModel::getState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。