本文整理汇总了PHP中JModel类的典型用法代码示例。如果您正苦于以下问题:PHP JModel类的具体用法?PHP JModel怎么用?PHP JModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addEvForm
function addEvForm()
{
$listid = JRequest::getInt('listid');
$viewName = 'calendar';
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model =& $this->getModel($viewName);
$id = JRequest::getInt('visualizationid', $usersConfig->get('visualizationid', 0));
$model->setId($id);
$model->setupEvents();
if (array_key_exists($listid, $model->_events)) {
$datefield = $model->_events[$listid][0]['startdate'];
} else {
$config = JFactory::getConfig();
$prefix = $config->getValue('config.dbprefix');
$datefield = $prefix . 'fabrik_calendar_events___start_date';
}
$rowid = JRequest::getInt('rowid');
$listModel = JModel::getInstance('list', 'FabrikFEModel');
$listModel->setId($listid);
$table = $listModel->getTable();
JRequest::setVar('view', 'form');
JRequest::setVar('formid', $table->form_id);
JRequest::setVar('tmpl', 'component');
JRequest::setVar('ajax', '1');
$link = 'index.php?option=com_fabrik&view=form&formid=' . $table->form_id . '&rowid=' . $rowid . '&tmpl=component&ajax=1';
$link .= '&jos_fabrik_calendar_events___visualization_id=' . JRequest::getInt('jos_fabrik_calendar_events___visualization_id');
$start_date = JRequest::getVar('start_date', '');
if (!empty($start_date)) {
$link .= "&{$datefield}=" . $start_date;
}
// $$$ rob have to add this to stop the calendar filtering itself after adding an new event?
$link .= '&clearfilters=1';
$this->setRedirect($link);
}
开发者ID:romuland,项目名称:khparts,代码行数:34,代码来源:calendar.php
示例2: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Initialise variables.
$html = array();
$recordId = (int) $this->form->getValue('id');
$size = ($v = $this->element['size']) ? ' size="' . $v . '"' : '';
$class = ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"';
// Get a reverse lookup of the base link URL to Title
$model = JModel::getInstance('menutypes', 'menusModel');
$rlu = $model->getReverseLookup();
switch ($this->value) {
case 'url':
$value = JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
break;
case 'alias':
$value = JText::_('COM_MENUS_TYPE_ALIAS');
break;
case 'separator':
$value = JText::_('COM_MENUS_TYPE_SEPARATOR');
break;
default:
$link = $this->form->getValue('link');
// Clean the link back to the option, view and layout
$value = JText::_(JArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link)));
break;
}
// Load the javascript and css
JHtml::_('behavior.framework');
JHtml::_('behavior.modal');
$html[] = '<input type="text" readonly="readonly" disabled="disabled" value="' . $value . '"' . $size . $class . ' />';
$html[] = '<input type="button" value="' . JText::_('JSELECT') . '" onclick="SqueezeBox.fromElement(this, {handler:\'iframe\', size: {x: 600, y: 450}, url:\'' . JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&recordId=' . $recordId) . '\'})" />';
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
return implode("\n", $html);
}
开发者ID:laiello,项目名称:senluonirvana,代码行数:40,代码来源:menutype.php
示例3: asField
/**
* Load up a field 'select as' statement
*
* @param JModel $formModel Form model
* @param string $fieldName Element full name
* @param array &$asfields As fields to append as statement to
* @param array $opts Options
*
* @throws RuntimeException
*
* @return void
*/
private function asField($formModel, $fieldName, &$asfields, $opts)
{
$elementModel = $formModel->getElement($fieldName);
$fields = array();
if ($elementModel) {
if ($elementModel->getElement()->published != 1) {
throw new RuntimeException('Approval ' . $fieldName . ' element must be published', 500);
}
$elementModel->getAsField_html($asfields, $fields, $opts);
}
}
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:23,代码来源:approvals.php
示例4: 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
示例5: display
public function display($tpl = null)
{
TOOLBAR_enmasse::_SMENU();
$task = JRequest::getWord('task');
switch ($task) {
case 'show':
TOOLBAR_enmasse::_BILLTEMPLATE();
$this->arBillTmpl = JModel::getInstance('billTemplate', 'enmasseModel')->listAll();
break;
case 'edit':
TOOLBAR_enmasse::_BILLTEMPLATE_EDIT();
$cid = JRequest::getVar('cid', array(), 'method', 'array');
if (!empty($cid)) {
$this->oBillTmpl = JModel::getInstance('billTemplate', 'enmasseModel')->getById($cid[0]);
if (!$this->oBillTmpl->id) {
$link = JRoute::_('index.php?option=com_enmasse&controller=billTemplate&task=show');
$msg = JText::_('BILL_TEMPLATE_INVALID_TEMPLATE_MSG');
JFactory::getApplication()->redirect($link, $msg, 'error');
}
} else {
$link = JRoute::_('index.php?option=com_enmasse&controller=billTemplate&task=show');
$msg = JText::_('BILL_TEMPLATE_INVALID_TEMPLATE_MSG');
JFactory::getApplication()->redirect($link, $msg, 'error');
}
break;
}
parent::display($tpl);
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:28,代码来源:view.html.php
示例6: post
public function post()
{
// Set variables to be used
JMHelper::setSessionUser();
JFactory::getLanguage()->load('com_users', JPATH_ADMINISTRATOR);
// Include dependencies
jimport('joomla.application.component.controller');
jimport('joomla.form.form');
jimport('joomla.database.table');
JModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models');
JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/com_users/models/forms');
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/tables');
// Get user data
$data = JRequest::getVar('jform', array(), 'post', 'array');
if (!isset($data['groups'])) {
$data['groups'] = array();
}
// Save user
$model = JModel::getInstance('User', 'UsersModel');
$model->getState('user.id');
// This is only here to trigger populateState()
$success = $model->save($data);
if ($model->getError()) {
$response = $this->getErrorResponse(400, $model->getError());
} elseif (!$success) {
$response = $this->getErrorResponse(400, JText::_('COM_JM_ERROR_OCURRED'));
} else {
$response = $this->getSuccessResponse(201, JText::_('COM_JM_SUCCESS'));
$response->id = $model->getState('user.id');
}
$this->plugin->setResponse($response);
}
开发者ID:rcorral,项目名称:com_jm-plugins,代码行数:32,代码来源:user.php
示例7: __construct
/**
* Base Controller Constructor
*
* @param array $config Controller initialization configuration parameters
* @return void
* @since 0.1
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->set('option', JRequest::getCmd('option'));
JModel::addIncludePath(JPATH_SITE . '/components/com_api/models');
JTable::addIncludePath(JPATH_SITE . '/components/com_api/tables');
}
开发者ID:bizanto,项目名称:Hooked,代码行数:14,代码来源:controller.php
示例8: display
function display($tpl = null)
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
$uri = JFactory::getUri();
// Get data from the model
$items = $this->get('Items');
$this->assignRef('items', $items);
foreach ($this->items as $item) {
$item->count_projectdivisions = 0;
$mdlProjectDivisions = JModel::getInstance("divisions", "JoomleagueModel");
$item->count_projectdivisions = $mdlProjectDivisions->getProjectDivisionsCount($item->id);
$item->count_projectpositions = 0;
$mdlProjectPositions = JModel::getInstance("Projectposition", "JoomleagueModel");
$item->count_projectpositions = $mdlProjectPositions->getProjectPositionsCount($item->id);
$item->count_projectreferees = 0;
$mdlProjectReferees = JModel::getInstance("Projectreferees", "JoomleagueModel");
$item->count_projectreferees = $mdlProjectReferees->getProjectRefereesCount($item->id);
$item->count_projectteams = 0;
$mdlProjecteams = JModel::getInstance("Projectteams", "JoomleagueModel");
$item->count_projectteams = $mdlProjecteams->getProjectTeamsCount($item->id);
$item->count_matchdays = 0;
$mdlRounds = JModel::getInstance("Rounds", "JoomleagueModel");
$item->count_matchdays = $mdlRounds->getRoundsCount($item->id);
}
$this->addToolbar();
parent::display($tpl);
}
开发者ID:santas156,项目名称:joomleague-2-komplettpaket,代码行数:28,代码来源:view.html.php
示例9: doCron
function doCron(&$pluginManager)
{
$db = FabrikWorker::getDbo();
$cid = JRequest::getVar('element_id', array(), 'method', 'array');
$query = $db->getQuery();
$query->select('id, plugin')->from('#__{package}_cron');
if (!empty($cid)) {
$query->where(" id IN (" . implode(',', $cid) . ")");
}
$db->setQuery($query);
$rows = $db->loadObjectList();
$viewModel = JModel::getInstance('view', 'FabrikFEModel');
$c = 0;
foreach ($rows as $row) {
//load in the plugin
$plugin =& $pluginManager->getPlugIn($row->plugin, 'cron');
$plugin->setId($row->id);
$params =& $plugin->getParams();
$thisViewModel = clone $viewModel;
$thisViewModel->setId($params->get('table'));
$table =& $viewModel->getTable();
$total = $thisViewModel->getTotalRecords();
$nav =& $thisViewModel->getPagination($total, 0, $total);
$data = $thisViewModel->getData();
// $$$ hugh - added table model param, in case plugin wants to do further table processing
$c = $c + $plugin->process($data, $thisViewModel);
}
$query = $db->getQuery();
$query->update('#__{package}_cron')->set('lastrun=NOW()')->where("id IN (" . implode(',', $cid) . ")");
$db->setQuery($query);
$db->query();
}
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:32,代码来源:plugin.raw.php
示例10: getPlugins
/**
* get the list's active/selected plug-ins
* @return array
*/
public function getPlugins()
{
$item = $this->getItem();
// load up the active plug-ins
$dispatcher =& JDispatcher::getInstance();
$plugins = JArrayHelper::getValue($item->params, 'plugins', array());
$return = array();
//JModel::addIncludePath(JPATH_SITE.DS.'components'.DS.'com_fabrik'.DS.'models');
$pluginManager = JModel::getInstance('Pluginmanager', 'FabrikFEModel');
//@todo prob wont work for any other model that extends this class except for the form/list model
switch (get_class($this)) {
case 'FabrikModelList':
$class = 'list';
break;
default:
$class = 'form';
}
$feModel = JModel::getInstance($class, 'FabrikFEModel');
$feModel->setId($this->getState($class . '.id'));
foreach ($plugins as $x => $plugin) {
$o = $pluginManager->getPlugIn($plugin, $this->pluginType);
$o->getJForm()->model = $feModel;
$data = (array) $item->params;
$str = $o->onRenderAdminSettings($data, $x);
//$str = str_replace(array("\n", "\r"), "", $str);
$str = addslashes(str_replace(array("\n", "\r"), "", $str));
$location = $this->getPluginLocation($x);
$event = $this->getPluginEvent($x);
$return[] = array('plugin' => $plugin, 'html' => $str, 'location' => $location, 'event' => $event);
}
return $return;
}
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:36,代码来源:fabmodeladmin.php
示例11: onValidateSelectShipping
/**
*
* @param array $values The input values from the form
* @return unknown_type
*/
function onValidateSelectShipping($values)
{
$return = new JObject();
$return->error = null;
// boolean
$return->message = null;
// string
if (empty($values['billing_address_id']) && empty($values['billing_input_phone_1'])) {
$return->error = true;
// boolean
$return->message = JText::_('Please Include a Phone Number with Your Billing Address');
// string
}
if (!empty($values['billing_address_id'])) {
// Load the address from the database
$model = JModel::getInstance('Addresses', 'TiendaModel');
$model->setId($values['billing_address_id']);
$address = $model->getItem();
// Does the address have a phone number associated with it?
// if not, what do you want to do?
if (empty($address->phone_1)) {
$return->error = true;
// boolean
$return->message = JText::_('Stored Address Missing Phone Number');
// string
}
}
return $return;
}
开发者ID:annggeel,项目名称:tienda,代码行数:34,代码来源:requirephonenumber.php
示例12: display
function display($tpl = null)
{
$model =& JModel::getInstance('jigs', 'BattleModel');
$player = $model->get_stats();
// print_r($player[0]);
$this->assignRef('player', $player);
$computer_action = JRequest::getCmd('action');
if ($computer_action != '') {
$model = $this->getmodel();
$model->{$computer_action}($player);
}
$flags = $player[0]['flags'];
$flags = explode(',', $flags);
if (!in_array(2, $flags)) {
} elseif (in_array(2, $flags)) {
if (!in_array(3, $flags)) {
//update flags to 3 so we never have to login again
$model =& JModel::getInstance('jigs', 'BattleModel');
$flags[] = 3;
$model->update_flags($flags);
$tpl = "computer_page_1";
// first time view
} else {
$tpl = "computer_page_2";
}
}
parent::display($tpl);
}
开发者ID:yatan,项目名称:JiGS-PHP-RPG-engine,代码行数:28,代码来源:view.html.php
示例13: display
public function display($tpl = null)
{
// get model and update context with current
$model =& JModel::getInstance('urls', 'Sh404sefModel');
$context = $model->setContext($this->_context . '.' . $this->getLayout());
// store it
$model =& $this->setModel($model, true);
// read data from model
$list =& $model->getList((object) array('layout' => $this->getLayout(), 'getPageId' => true));
// and push it into the view for display
$this->assign('items', $list);
$this->assign('itemCount', count($this->items));
$this->assign('pagination', $model->getPagination((object) array('layout' => $this->getLayout(), 'getPageId' => true)));
$options = $model->getDisplayOptions();
$this->assign('options', $options);
$this->assign('optionsSelect', $this->_makeOptionsSelect($options));
$this->assign('helpMessage', JText16::_('COM_SH404SEF_PAGEID_HELP'));
// add behaviors and styles as needed
$modalSelector = 'a.modalediturl';
$js = '\\function(){shAlreadySqueezed = false;if(parent.shReloadModal) {parent.window.location=\'' . $this->defaultRedirectUrl . '\';parent.shReloadModal=true}}';
$params = array('overlayOpacity' => 0, 'classWindow' => 'sh404sef-popup', 'classOverlay' => 'sh404sef-popup', 'onClose' => $js);
Sh404sefHelperHtml::modal($modalSelector, $params);
// build the toolbar
$toolbarMethod = '_makeToolbar' . ucfirst($this->getLayout());
if (is_callable(array($this, $toolbarMethod))) {
$this->{$toolbarMethod}($params);
}
// add our own css
JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
// link to custom javascript
JHtml::script('list.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
JHtml::script('metas.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
// now display normally
parent::display($tpl);
}
开发者ID:justinlyon,项目名称:scc,代码行数:35,代码来源:view.html.php
示例14: passPHP
/**
* passPHP
*
* @param <object> $params
* @param <array> $selection
* @param <string> $assignment
*
* @return <bool>
*/
function passPHP( &$main, &$params, $selection = array(), $assignment = 'all', $article = 0 )
{
if ( !is_array( $selection ) ) {
$selection = array( $selection );
}
$pass = 0;
foreach ( $selection as $php ) {
// replace \n with newline and other fix stuff
$php = str_replace( '\|', '|', $php );
$php = preg_replace( '#(?<!\\\)\\\n#', "\n", $php );
$php = str_replace( '[:REGEX_ENTER:]', '\n', $php );
if ( trim( $php ) == '' ) {
$pass = 1;
break;
}
if ( !$article && !( strpos( $php, '$article' ) === false ) && $main->_params->option == 'com_content' && $main->_params->view == 'article' ) {
require_once JPATH_SITE.'/components/com_content/models/article.php';
$model = JModel::getInstance( 'article', 'contentModel' );
$model->setId( $main->_params->id );
$article = $model->getArticle();
}
if ( !isset( $Itemid ) ) {
$Itemid = JRequest::getInt( 'Itemid' );
}
if ( !isset( $mainframe ) ) {
$mainframe = ( strpos( $php, '$mainframe' ) === false ) ? '' : JFactory::getApplication();
}
if ( !isset( $app ) ) {
$app = ( strpos( $php, '$app' ) === false ) ? '' : JFactory::getApplication();
}
if ( !isset( $database ) ) {
$database = ( strpos( $php, '$database' ) === false ) ? '' : JFactory::getDBO();
}
if ( !isset( $db ) ) {
$db = ( strpos( $php, '$db' ) === false ) ? '' : JFactory::getDBO();
}
if ( !isset( $user ) ) {
$user = ( strpos( $php, '$user' ) === false ) ? '' : JFactory::getUser();
}
$vars = '$article,$Itemid,$mainframe,$app,$database,$db,$user';
$val = '$temp_PHP_Val = create_function( \''.$vars.'\', $php.\';\' );';
$val .= ' $pass = ( $temp_PHP_Val('.$vars.') ) ? 1 : 0; unset( $temp_PHP_Val );';
@eval( $val );
if ( $pass ) {
break;
}
}
if ( $pass ) {
return ( $assignment == 'include' );
} else {
return ( $assignment == 'exclude' );
}
}
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:69,代码来源:php.php
示例15: display
function display($tmpl = 'default')
{
FabrikHelperHTML::framework();
$model = $this->getModel();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model->setId(JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))));
$visualization = $model->getVisualization();
$pluginParams = $model->getPluginParams();
$pluginManager = JModel::getInstance('Pluginmanager', 'FabrikModel');
$plugin = $pluginManager->getPlugIn($visualization->plugin, 'visualization');
$plugin->_row = $visualization;
if ($visualization->published == 0) {
return JError::raiseWarning(500, JText::_('COM_FABRIK_SORRY_THIS_VISUALIZATION_IS_UNPUBLISHED'));
}
//plugin is basically a model
$pluginTask = JRequest::getVar('plugintask', 'render', 'request');
// @FIXME cant set params directly like this, but I think plugin model setParams() is not right
$plugin->_params = $pluginParams;
$tmpl = $plugin->getParams()->get('calendar_layout', $tmpl);
$plugin->{$pluginTask}($this);
$this->plugin = $plugin;
$viewName = $this->getName();
$this->addTemplatePath($this->_basePath . DS . 'plugins' . DS . $this->_name . DS . $plugin->_name . DS . 'tmpl' . DS . $tmpl);
$this->addTemplatePath(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'html' . DS . 'com_fabrik' . DS . 'visualization' . DS . $plugin->_name . DS . $tmpl);
$ab_css_file = JPATH_SITE . "/plugins/fabrik_visualization/" . $plugin->_name . "/tmpl/{$tmpl}/template.css";
if (JFile::exists($ab_css_file)) {
JHTML::stylesheet('template.css', 'plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/', true);
}
echo parent::display();
}
开发者ID:rhotog,项目名称:fabrik,代码行数:30,代码来源:view.html.php
示例16: getElementModel
/**
* get an element model
* @return object element model
*/
private function getElementModel()
{
if (!isset($this->_elementModel)) {
$this->_elementModel =& JModel::getInstance('element', 'FabrikModel');
}
return $this->_elementModel;
}
开发者ID:nikshade,项目名称:fabrik21,代码行数:11,代码来源:fabrikjuser.php
示例17: loadLetter
/**
* Load letter from DB, load SMTP settings
* TODO: Move this to NewsletterModel or NewsletterModelEntity
*
* @param <string> $name - id of a letter
*
* @return object - letter
* @since 1.0
*/
public static function loadLetter($id = false)
{
$letter = JTable::getInstance('Newsletter', 'NewsletterTable');
$letter->load((int) $id);
// If letter absent then fail.
if (!$letter) {
return false;
}
$letter = (object) $letter->getProperties();
$letter->params = (array) json_decode($letter->params);
if (empty($letter->params['encoding'])) {
$letter->params['encoding'] = 'utf-8';
}
PlaceholderHelper::setPlaceholders($letter->params);
$profileEntity = JModel::getInstance('Smtpprofile', 'NewsletterModelEntity');
$profileEntity->load((int) $letter->smtp_profile_id);
$letter->smtp_profile = $profileEntity->toObject();
// Set data when using J! SMTP profile
if ($letter->smtp_profile_id == NewsletterModelEntitySmtpprofile::JOOMLA_SMTP_ID) {
if (!empty($letter->params['newsletter_from_email'])) {
$letter->smtp_profile->from_email = $letter->params['newsletter_from_email'];
}
if (!empty($letter->params['newsletter_from_name'])) {
$letter->smtp_profile->from_name = $letter->params['newsletter_from_name'];
}
if (!empty($letter->params['newsletter_to_email'])) {
$letter->smtp_profile->reply_to_email = $letter->params['newsletter_to_email'];
}
if (!empty($letter->params['newsletter_to_name'])) {
$letter->smtp_profile->reply_to_name = $letter->params['newsletter_to_name'];
}
}
return $letter;
}
开发者ID:Rikisha,项目名称:proj,代码行数:43,代码来源:mail.php
示例18: getUserNotifications
function getUserNotifications()
{
$user = JFactory::getUser();
$db = FabrikWorker::getDbo();
$sql = "SELECT * FROM #__{package}_notification WHERE user_id = " . $user->get('id');
$db->setQuery($sql);
$rows = $db->loadObjectList();
$listModel = JModel::getInstance('list', 'FabrikFEModel');
foreach ($rows as &$row) {
/*
* {observer_name, creator_name, event, record url
* dear %s, %s has %s on %s
*/
$event = JText::_($row->event);
list($listid, $formid, $rowid) = explode('.', $row->reference);
$listModel->setId($listid);
$data = $listModel->getRow($rowid);
$row->url = JRoute::_('index.php?option=com_fabrik&view=details&listid='.$listid.'&formid='.$formid.'&rowid='.$rowid);
$row->title = $row->url;
foreach ($data as $key => $value) {
$k = strtolower(array_pop(explode('___', $key)));
if ($k == 'title') {
$row->title = $value;
}
}
}
return $rows;
}
开发者ID:Jobar87,项目名称:fabrik,代码行数:29,代码来源:cronnotification.php
示例19: 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
示例20:
function __construct()
{
parent::__construct();
$cid = JRequest::getVar('cid', 0);
$this->_cid = $cid;
$this->_issearch = JRequest::getVar('issearch', 0);
}
开发者ID:naka211,项目名称:designcreations1,代码行数:7,代码来源:list.php
注:本文中的JModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论