本文整理汇总了PHP中JModelList类的典型用法代码示例。如果您正苦于以下问题:PHP JModelList类的具体用法?PHP JModelList怎么用?PHP JModelList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JModelList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display the view.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*
* @since 1.0.0
*/
public function display($tpl = null)
{
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->params = $this->state->get('params');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Get payment methods.
$paymentMethods = CMDonationHelper::getPaymentMethods();
// Get campaigns.
$campaigns = JModelList::getInstance('Campaigns', 'CMDonationModel')->getCampaignsForFilter();
// Build campaign options for filter and index for displaying campaign name.
$campaignOptions = array();
$campaignIndex = array();
if (!empty($campaigns)) {
foreach ($campaigns as $campaign) {
$campaignOptions[] = JHtml::_('select.option', $campaign->id, htmlspecialchars($campaign->name));
$campaignIndex[$campaign->id] = $campaign->name;
}
}
$this->assignRef('paymentMethods', $paymentMethods);
$this->assignRef('campaigns', $campaigns);
$this->assignRef('campaignOptions', $campaignOptions);
$this->assignRef('campaignIndex', $campaignIndex);
$this->submenu = CMDonationHelper::addSubmenu('donations');
$this->addToolbar();
parent::display($tpl);
}
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:41,代码来源:view.html.php
示例2: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
$jemsettings = JemHelper::config();
# it's needed to set the parent option
parent::populateState('a.dates', 'asc');
}
开发者ID:JKoelman,项目名称:JEM-3,代码行数:12,代码来源:attendees.php
示例3: __construct
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array('id', 'a.id', 'lno', 'a.lno', 'labname', 'labname', 'pic', 'a.pic', 'state', 'a.state', 'admin', 'a.admin', 'phone', 'a.phone', 'description', 'a.description');
}
parent::__construct($config);
}
开发者ID:774878175,项目名称:joomla_gc,代码行数:7,代码来源:lab.php
示例4: _getList
/**
* Returns an object list
*
* @param string The query
* @param int Offset
* @param int The number of records
* @return array
*/
protected function _getList($query, $limitstart = 0, $limit = 0)
{
$ordering = $this->getState('list.ordering');
$search = $this->getState('filter.search');
// Replace slashes so preg_match will work
$search = str_replace('/', ' ', $search);
$db = $this->getDbo();
if ($ordering == 'name' || !empty($search) && stripos($search, 'id:') !== 0) {
$db->setQuery($query);
$result = $db->loadObjectList();
$lang = JFactory::getLanguage();
$this->translate($result);
if (!empty($search)) {
foreach ($result as $i => $item) {
if (!preg_match("/{$search}/i", $item->name)) {
unset($result[$i]);
}
}
}
JArrayHelper::sortObjects($result, $this->getState('list.ordering'), $this->getState('list.direction') == 'desc' ? -1 : 1, true, $lang->getLocale());
$total = count($result);
$this->cache[$this->getStoreId('getTotal')] = $total;
if ($total < $limitstart) {
$limitstart = 0;
$this->setState('list.start', 0);
}
return array_slice($result, $limitstart, $limit ? $limit : null);
} else {
$query->order($db->quoteName($ordering) . ' ' . $this->getState('list.direction'));
$result = parent::_getList($query, $limitstart, $limit);
$this->translate($result);
return $result;
}
}
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:42,代码来源:extension.php
示例5: __construct
public function __construct(array $config)
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array('name', 'brand', 'diameter', 'density', 'number');
}
parent::__construct($config);
}
开发者ID:Caojunkai,项目名称:working,代码行数:7,代码来源:weldinglist.php
示例6: __construct
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array('id', 'businessName');
}
parent::__construct($config);
}
开发者ID:naka211,项目名称:myloyal,代码行数:7,代码来源:promotions.php
示例7: __construct
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array('name', 'f.name', 'id', 'f.id', 'label', 'f.label', 'label', 'f.label', 'tooltip', 'f.tooltip', 'type', 'f.type', 'in_search', 'f.in_search', 'search_type', 'f.search_type', 'published', 'f.published');
}
parent::__construct($config);
}
开发者ID:kidaa30,项目名称:lojinha,代码行数:7,代码来源:fieldsxref.php
示例8: __construct
/**
* Constructor.
*
* @param array An optional associative array of configuration settings.
* @see JController
*/
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array('file_id', 'a.file_id', 'file_title', 'a.file_title', 'file_alias', 'a.file_alias', 'description, a.description', 'description_long', 'a.description_long', 'file_pic', 'a.file_pic', 'images', 'a.images', 'price', 'a.price', 'release', 'a.release', 'file_language', 'a.file_language', 'system', 'a.system', 'license', 'a.license', 'url_license', 'a.url_license', 'size', 'a.size', 'date_added', 'a.date_added', 'file_date', 'a.file_date', 'publish_from', 'a.publish_from', 'publish_to', 'a.publish_to', 'use_timeframe', 'a.use_timeframe', 'url_download', 'a.url_download', 'preview_filename', 'a.preview_filename', 'other_file_id', 'a.other_file_id', 'md5_value', 'a.md5_value', 'sha1_value', 'a.sha1_value', 'extern_file', 'a.extern_file', 'extern_site', 'a.extern_site', 'mirror_1', 'a.mirror_1', 'mirror_2', 'a.mirror_2', 'extern_site_mirror-1', 'a.extern_site_mirror_1', 'extern_site_mirror_2', 'a.extern_site_mirror_2', 'url_home', 'a.url_home', 'author', 'a.author', 'url_author', 'a.url_author', 'created_id', 'a.created_id', 'created_mail', 'a.created_mail', 'modified_id', 'a.modified_id', 'modified_date', 'a.modified_date', 'submitted_by', 'a.submitted_by', 'set_aup_points', 'a.set_aup_points', 'downloads', 'a.downloads', 'cat_id', 'a.cat_id', 'category_title', 'changelog', 'a.changelog', 'password', 'a.password', 'password_md5', 'a.password_md5', 'views', 'a.views', 'metakey', 'a.metakey', 'metadesc', 'a.metadesc', 'robots', 'a.robots', 'update_active', 'a.update_active', 'custom_field_1', 'a.custom_field_1', 'custom_field_2', 'a.custom_field_2', 'custom_field_3', 'a.custom_field_3', 'custom_field_4', 'a.custom_field_4', 'custom_field_5', 'a.custom_field_5', 'custom_field_6', 'a.custom_field_6', 'custom_field_7', 'a.custom_field_7', 'custom_field_8', 'a.custom_field_8', 'custom_field_9', 'a.custom_field_9', 'custom_field_10', 'a.custom_field_10', 'custom_field_11', 'a.custom_field_11', 'custom_field_12', 'a.custom_field_12', 'custom_field_13', 'a.custom_field_13', 'custom_field_14', 'a.custom_field_14', 'access', 'a.access', 'access_level', 'language', 'a.language', 'ordering', 'a.ordering', 'published', 'a.published', 'checked_out', 'a.checked_out', 'checked_out_time', 'a.checked_out_time');
}
parent::__construct($config);
}
开发者ID:madcsaba,项目名称:li-de,代码行数:13,代码来源:category.php
示例9: _getList
protected function _getList($query, $limitstart = 0, $limit = 0)
{
$ordering = $this->getState('list.ordering', 'ordering');
if (in_array($ordering, array('pages', 'name'))) {
$this->_db->setQuery($query);
$result = $this->_db->loadObjectList();
$this->translate($result);
$lang = JFactory::getLanguage();
JArrayHelper::sortObjects($result, $ordering, $this->getState('list.direction') == 'desc' ? -1 : 1, true, $lang->getLocale());
$total = count($result);
$this->cache[$this->getStoreId('getTotal')] = $total;
if ($total < $limitstart) {
$limitstart = 0;
$this->setState('list.start', 0);
}
return array_slice($result, $limitstart, $limit ? $limit : null);
} else {
if ($ordering == 'ordering') {
$query->order('position ASC');
}
$query->order($this->_db->quoteName($ordering) . ' ' . $this->getState('list.direction'));
if ($ordering == 'position') {
$query->order('ordering ASC');
}
$result = parent::_getList($query, $limitstart, $limit);
$this->translate($result);
return $result;
}
}
开发者ID:NallelyFlores89,项目名称:basvec,代码行数:29,代码来源:modules.php
示例10: __construct
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array();
}
parent::__construct($config);
}
开发者ID:romuland,项目名称:khparts,代码行数:7,代码来源:category.php
示例11: getItems
/**
* Method to get an array of data items.
*
* @return array An array of data items
*
* @since 12.2
*/
public function getItems()
{
JDeveloperLoader::import("archive");
$extension = JTable::getInstance("Extension", "JTable");
// Get a storage key.
$store = $this->getStoreId('getItems');
// Load the list items.
$items = parent::getItems();
// Add information
foreach ($items as $item) {
// Is Component already installed?
$item->createDir = JDeveloperArchive::getArchiveDir() . "/" . JDeveloperArchive::getArchiveName("mod_", $item->name, $item->version);
$item->installed = JDeveloperInstall::isInstalled("module", "mod_" . $item->name);
if ($item->installed) {
$extension->load(array("name" => "mod_" . $item->name, "type" => "module"));
$item->enabled = (bool) $extension->enabled;
} else {
$item->enabled = false;
}
}
// If emtpy or an error, just return.
if (empty($items)) {
return array();
}
// Add the items to the internal cache.
$this->cache[$store] = $items;
return $this->cache[$store];
}
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:35,代码来源:modules.php
示例12: populateState
/**
* Autopopulate the model
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('administrator');
$data = JRequest::getVar('filters');
if (empty($data)) {
$data = array();
$data['select'] = $app->getUserState('com_localise.select');
$data['search'] = $app->getUserState('com_localise.translations.search');
} else {
$app->setUserState('com_localise.select', $data['select']);
$app->setUserState('com_localise.translations.search', isset($data['search']) ? $data['search'] : '');
}
$this->setState('filter.search', isset($data['search']['expr']) ? $data['search']['expr'] : '');
$this->setState('filter.storage', isset($data['select']['storage']) ? $data['select']['storage'] : '');
$this->setState('filter.origin', isset($data['select']['origin']) ? $data['select']['origin'] : '');
$this->setState('filter.state', isset($data['select']['state']) ? $data['select']['state'] : '');
$this->setState('filter.type', isset($data['select']['type']) ? $data['select']['type'] : '');
$this->setState('filter.client', isset($data['select']['client']) ? $data['select']['client'] : '');
$this->setState('filter.tag', isset($data['select']['tag']) ? $data['select']['tag'] : '');
$params = JComponentHelper::getParams('com_localise');
$this->setState('params', $params);
$reference = $params->get('reference', 'en-GB');
$this->setState('translations.reference', $reference);
// Call auto-populate parent method
parent::populateState('filename', 'asc');
}
开发者ID:ForAEdesWeb,项目名称:AEW4,代码行数:29,代码来源:translations.php
示例13: getItems
/**
* Method to get a list of items.
*
* @return mixed An array of objects on success, false on failure.
*/
public function getItems()
{
// Get the list of items from the database.
$items = parent::getItems();
$client = JApplicationHelper::getClientInfo($this->getState('stfilter.client_id', 0));
$lang = JFactory::getLanguage();
// Loop through the results to add the XML metadata,
// and load language support.
foreach ($items as &$item) {
$path = JPath::clean($client->path . '/modules/' . $item->module . '/' . $item->module . '.xml');
if (file_exists($path)) {
$item->xml = simplexml_load_file($path);
} else {
$item->xml = null;
}
// 1.5 Format; Core files or language packs then
// 1.6 3PD Extension Support
$lang->load($item->module . '.sys', $client->path, null, false, true) || $lang->load($item->module . '.sys', $client->path . '/modules/' . $item->module, null, false, true);
$item->name = JText::_($item->name);
if (isset($item->xml) && ($text = trim($item->xml->description))) {
$item->desc = JText::_($text);
} else {
$item->desc = JText::_('COM_MODULES_NODESCRIPTION');
}
}
$items = JArrayHelper::sortObjects($items, 'name', 1, true, true);
// TODO: Use the cached XML from the extensions table?
return $items;
}
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:34,代码来源:select.php
示例14: getStoreId
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.category');
return parent::getStoreId($id);
}
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:7,代码来源:sliders.php
示例15: __construct
/**
* Constructor.
*
* @param array An optional associative array of configuration settings.
* @see JControllerLegacy
*/
public function __construct($config = array())
{
if (empty($config['filter_fields'])) {
$config['filter_fields'] = array('id', 'a.id', 'tdate', 'a.tdate', 'sport', 's.sport', 'method', 'a.method', 'description', 'a.description', 'comment', 'a.comment', 'location', 'a.location');
}
parent::__construct($config);
}
开发者ID:hogeh,项目名称:htraininglogs,代码行数:13,代码来源:sessions.php
示例16: __construct
/**
* Constructor
*
* @param array $config An optional associative array of configuration settings.
*/
public function __construct($config = array())
{
if (empty($config["filter_fields"])) {
$config["filter_fields"] = array("id", "a.id", "date", "a.date", "exported", "a.exported");
}
parent::__construct($config);
}
开发者ID:HPReflectoR,项目名称:GlavExpert,代码行数:12,代码来源:enquiries.php
示例17: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$filters = JRequest::getVar('filters');
if (empty($filters)) {
$data = $app->getUserState($this->_context . '.data');
$filters = $data['filters'];
} else {
$app->setUserState($this->_context . '.data', array('filters' => $filters));
}
$this->setState('message', $app->getUserState('com_installer.message'));
$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
$app->setUserState('com_installer.message', '');
$app->setUserState('com_installer.extension_message', '');
// Recall the 'Install from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.install_directory', 'install_directory', $app->getCfg('tmp_path'));
$this->setState('install.directory', $path);
$this->setState('filter.type', isset($filters['type']) ? $filters['type'] : '');
if (!isset($filters['update_site_id'])) {
JRequest::setVar('update_site_id', '2');
}
$this->setState('filter.update_site_id', isset($filters['update_site_id']) ? $filters['update_site_id'] : '2');
$this->setState('filter.folder', isset($filters['folder']) ? $filters['folder'] : '');
$this->setState('filter.search', isset($filters['search']) ? $filters['search'] : '');
parent::populateState('a.name', 'asc');
}
开发者ID:networksoft,项目名称:seekerplus2.com,代码行数:34,代码来源:oneclick.php
示例18: getStoreId
/**
* Filters
*/
protected function getStoreId($id = '')
{
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.state');
$id .= ':' . $this->getState('filter.language');
return parent::getStoreId($id);
}
开发者ID:CloudHotelier,项目名称:com_jkit,代码行数:10,代码来源:tags.php
示例19: populateState
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
// Load the filter state.
$search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
//Omit double (white-)spaces and set state
$this->setState('filter.search', preg_replace('/\\s+/', ' ', $search));
//Filter (dropdown) tshirt-size
$tshirtsizes = $app->getUserStateFromRequest($this->context . '.filter.tshirt_size', 'filter_tshirtsize', '', 'string');
$this->setState('filter.tshirt_size', $tshirtsizes);
//Filter (dropdown) tshirt-size
$campingPlace = $app->getUserStateFromRequest($this->context . '.filter.campingPlace', 'filter_campingPlace', '', 'int');
$this->setState('filter.campingPlace', $campingPlace);
//Filter (dropdown) service
$services = $app->getUserStateFromRequest($this->context . '.filter.services_members', 'filter_services_members', '', 'string');
$this->setState('filter.services_members', $services);
// Get pagination request variables
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'string');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
// In case limit has been changed, adjust it
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$this->setState('limit', $limit);
$this->setState('limitstart', $limitstart);
parent::populateState('lastname', 'ASC');
}
开发者ID:gorgozilla,项目名称:Estivole,代码行数:25,代码来源:members.php
示例20: populateState
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('administrator');
$filterSearch = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '');
$this->setState('filter.search', $filterSearch);
parent::populateState('name', 'asc');
}
开发者ID:sulicz,项目名称:JINC_J30,代码行数:7,代码来源:newsletters.php
注:本文中的JModelList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论