public function getPayments() { $payments = parent::getItems(); $db = JFactory::getDBO(); $query = $db->getQuery(true); $plugins = RSMembership::getPlugins(); $return = array(); foreach ($plugins as $paymentplugin => $name) { if (preg_match('#rsmembershipwire([0-9]+)#', $paymentplugin, $match)) { continue; } $tmp = new stdClass(); $tmp->name = $name; $tmp->limitations = ''; $className = 'plgSystem' . $paymentplugin; if (class_exists($className) && method_exists($className, 'getLimitations')) { $dispatcher = JDispatcher::getInstance(); $plugin = new $className($dispatcher, array()); $tmp->limitations = $plugin->getLimitations(); } $query->clear(); $query->select($db->qn('extension_id'))->from($db->qn('#__extensions'))->where($db->qn('type') . ' = ' . $db->q('plugin') . ' AND ' . $db->qn('client_id') . '= ' . $db->q('0') . ' AND ' . $db->qn('element') . ' = ' . $db->q($paymentplugin)); $db->setQuery($query); $tmp->cid = $db->loadResult(); $payments[] = $tmp; } return $payments; }
/** * 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; }
/** * Method to get an array of data items. * * @return mixed An array of data items on success, false on failure. */ public function getItems() { // check in items $this->checkInNow(); // load parent items $items = parent::getItems(); // set values to display correctly. if (DemoHelper::checkArray($items)) { // get user object. $user = JFactory::getUser(); foreach ($items as $nr => &$item) { $access = $user->authorise('look.access', 'com_demo.look.' . (int) $item->id) && $user->authorise('look.access', 'com_demo'); if (!$access) { unset($items[$nr]); continue; } } } // set selection value to a translatable value if (DemoHelper::checkArray($items)) { foreach ($items as $nr => &$item) { // convert add $item->add = $this->selectionTranslation($item->add, 'add'); } } // return items return $items; }
/** * Override getItems method. * * @return array * @since 1.6 */ public function getItems() { $groupId = $this->getState('filter.group_id'); if (($assets = parent::getItems()) && $groupId) { $actions = $this->getDebugActions(); foreach ($assets as &$asset) { $asset->checks = array(); foreach ($actions as $action) { $name = $action[0]; $level = $action[1]; // Check that we check this action for the level of the asset. if ($action[1] === null || $action[1] >= $asset->level) { // We need to test this action. $asset->checks[$name] = JAccess::checkGroup($groupId, $action[0], $asset->name); } else { // We ignore this action. $asset->checks[$name] = 'skip'; } } } } return $assets; }
/** * Get items * * @return array */ public function getItems() { $this->setState('list.limit', 0); $items = parent::getItems(); $db = JFactory::getDbo(); $query = $db->getQuery(true); foreach ($items as $item) { switch ($item->setting_key) { case 'translation_method_1': case 'translation_method_2': $query->clear()->select(array('id', 'name_constant'))->from('#__neno_translation_methods'); $db->setQuery($query); $values = $db->loadObjectList(); $item->dropdown = JHtml::_('select.genericlist', $values, $item->setting_key, null, 'id', 'name_constant', $item->setting_value, false, true); break; case 'schedule_task_option': $values = array(array('value' => 'ajax', 'text' => 'COM_NENO_INSTALLATION_TASK_OPTION_AJAX_MODULE_TITLE'), array('value' => 'cron', 'text' => 'COM_NENO_INSTALLATION_TASK_OPTION_CRON_TITLE'), array('value' => 'disabled', 'text' => 'COM_NENO_INSTALLATION_TASK_OPTION_DISABLE_TITLE')); $item->dropdown = JHtml::_('select.genericlist', $values, $item->setting_key, null, 'value', 'text', $item->setting_value, false, true); break; case 'translator': $query->clear()->select(array('translator_name AS value', 'translator_name AS text'))->from('#__neno_machine_translation_apis'); $db->setQuery($query); $values = $db->loadObjectList(); $item->dropdown = JHtml::_('select.genericlist', $values, $item->setting_key, null, 'value', 'text', $item->setting_value, false, true); break; case 'default_translate_action': $values = array(array('value' => '0', 'text' => 'COM_NENO_SETTINGS_SETTING_OPTION_DEFAULT_TRANSLATE_ACTION_NO'), array('value' => '1', 'text' => 'COM_NENO_SETTINGS_SETTING_OPTION_DEFAULT_TRANSLATE_ACTION_COPY'), array('value' => '2', 'text' => 'COM_NENO_SETTINGS_SETTING_OPTION_DEFAULT_TRANSLATE_ACTION_TRANSLATE')); $item->dropdown = JHtml::_('select.genericlist', $values, $item->setting_key, null, 'value', 'text', $item->setting_value, false, true); break; } } return $items; }
function getItems() { $items = parent::getItems(); foreach ($items as &$item) { } return $items; }
/** * Method to get an array of data items. * * @return mixed An array of data items on success, false on failure. */ public function getItems() { // check in items $this->checkInNow(); // load parent items $items = parent::getItems(); // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { // get user object. $user = JFactory::getUser(); foreach ($items as $nr => &$item) { $access = $user->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $item->id) && $user->authorise('company.access', 'com_costbenefitprojection'); if (!$access) { unset($items[$nr]); continue; } } } // set selection value to a translatable value if (CostbenefitprojectionHelper::checkArray($items)) { foreach ($items as $nr => &$item) { // convert department $item->department = $this->selectionTranslation($item->department, 'department'); // convert per $item->per = $this->selectionTranslation($item->per, 'per'); } } // return items return $items; }
/** * Method to get an array of data items. * * @return mixed An array of data items on success, false on failure. */ public function getItems() { // check in items $this->checkInNow(); // load parent items $items = parent::getItems(); // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { // get user object. $user = JFactory::getUser(); foreach ($items as $nr => &$item) { $access = $user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder'); if (!$access) { unset($items[$nr]); continue; } } } // set selection value to a translatable value if (ComponentbuilderHelper::checkArray($items)) { foreach ($items as $nr => &$item) { // convert main_source $item->main_source = $this->selectionTranslation($item->main_source, 'main_source'); // convert gettype $item->gettype = $this->selectionTranslation($item->gettype, 'gettype'); } } // return items return $items; }
/** * Tests the getItems method. * * @since 3.4 * * @return void * * @testdox getItems() reads from object cache */ public function testGetItemsReadsFromCache() { TestReflection::setValue($this->object, '__state_set', true); // Write value in "getItems" cache TestReflection::setValue($this->object, 'cache', array('8ca32876bd8539c7d3eb54bda89b5ac7' => array())); $this->assertSame(array(), $this->object->getItems()); }
/** * Method to get a list of items for a list of tags. * * @return mixed An array of objects on success, false on failure. * * @since 3.1 */ public function getItems() { // Invoke the parent getItems method to get the main list $items = parent::getItems(); if (!empty($items)) { foreach ($items as $item) { $explodedTypeAlias = explode('.', $item->type_alias); $item->link = 'index.php?option=' . $explodedTypeAlias[0] . '&view=' . $explodedTypeAlias[1] . '&id=' . $item->content_item_id . ':' . $item->core_alias; // Get display date switch ($this->state->params->get('tag_list_show_date')) { case 'modified': $item->displayDate = $item->core_modified_time; break; case 'created': $item->displayDate = $item->core_created_time; break; default: case 'published': $item->displayDate = $item->core_publish_up == 0 ? $item->core_created_time : $item->core_publish_up; break; } } return $items; } else { return false; } }
/** * 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]; }
public function getItems() { $items = parent::getItems(); // If current realm list is empty populate from TC database if ($this->getTotal() <= 0) { $authdb = JTrinityCoreDBHelper::getAuthDBName(); $sql = "SELECT id, name, address, port, population FROM " . $authdb . ".realmlist"; $dbo = JTrinityCoreDBHelper::getDB(); $dbo->setQuery($sql); $results = $dbo->loadObjectList(); if (count($results)) { foreach ($results as $row) { $data = new stdClass(); $data->id = NULL; $data->realmid = $row->id; $data->realmname = $row->name; $data->ip = $row->address; $data->port = $row->port; $data->population = $row->population; $this->_db->insertObject('#__jtc_realms', $data, 'id'); } $items = parent::getItems(); } } return $items; }
public function getItems() { if ($items = parent::getItems()) { $component = JComponentHelper::getComponent('com_tz_portfolio_plus'); $menus = JMenu::getInstance('site'); $menu_assigned = array(); if ($menu_items = $menus->getItems(array('component_id'), $component->id)) { if (count($menu_items)) { foreach ($menu_items as $m) { if (isset($m->params)) { $params = $m->params; if ($tpl_style_id = $params->get('tz_template_style_id')) { if (!isset($menu_assigned[$tpl_style_id])) { $menu_assigned[$tpl_style_id] = 0; } $menu_assigned[$tpl_style_id]++; } } } } } foreach ($items as $i => &$item) { $item->menu_assigned = 0; if (isset($menu_assigned[$item->id])) { $item->menu_assigned = $menu_assigned[$item->id]; } } return $items; } return false; }
public function getItems() { $result = parent::getItems(); if (is_array($result) && !empty($result[0])) { $item = $result[0]; // Get comprehension info $item->comprenhensions = $this->_getComprehensionInfos($item->id); // Get compositions info $item->compositions = $this->_getCompositionInfos($item->id); // Get precises info $item->precises = $this->_getPrecisInfos($item->id); // Get grammar info $item->grammars = $this->_getGrammarInfos($item->id); // Get usage info $item->usages = $this->_getUsageInfos($item->id); // Get exercise info $item->exercises = $this->_getExerciseInfo($item->id); $displayType = 0; if (!empty($item->comprenhensions) && count($item->comprenhensions)) { $displayType &= 1; } if (!empty($item->compositions) && count($item->compositions) > 0) { $displayType &= 1; } $result = $item; } return $result; }
function getItems() { $items = parent::getItems(); foreach ($items as &$item) { $item = (array) $item; } return $items; }
public function getItems() { $items = parent::getItems(); foreach ($items as $item) { $item->url = 'index.php?option=com_alfcontact&task=alfcontact.edit&id=' . $item->id; } return $items; }
/** * Method to get the userinformation of edited/submitted events * @return object */ public function getItems() { $items = parent::getItems(); if (!count($items)) { return $items; } return $items; }
/** * Overrides the getItems method to attach additional metrics to the list. * * @return mixed An array of data items on success, false on failure. * * @since 1.6.1 */ public function getItems() { // Get a storage key. $store = $this->getStoreId('getItems'); // Try to load the data from internal storage. if (!empty($this->cache[$store])) { return $this->cache[$store]; } // Load the list items. $items = parent::getItems(); // If emtpy or an error, just return. if (empty($items)) { return array(); } // Getting the following metric by joins is WAY TOO SLOW. // Faster to do three queries for very large menu trees. // Get the menu types of menus in the list. $db = $this->getDbo(); $menuTypes = JArrayHelper::getColumn($items, 'menutype'); // Quote the strings. $menuTypes = implode(',', array_map(array($db, 'quote'), $menuTypes)); // Get the published menu counts. $query = $db->getQuery(true)->select('m.menutype, COUNT(DISTINCT m.id) AS count_published')->from('#__menu AS m')->where('m.published = 1')->where('m.menutype IN (' . $menuTypes . ')')->group('m.menutype'); $db->setQuery($query); try { $countPublished = $db->loadAssocList('menutype', 'count_published'); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } // Get the unpublished menu counts. $query->clear('where')->where('m.published = 0')->where('m.menutype IN (' . $menuTypes . ')'); $db->setQuery($query); try { $countUnpublished = $db->loadAssocList('menutype', 'count_published'); } catch (RuntimeException $e) { $this->setError($e->getMessage()); return false; } // Get the trashed menu counts. $query->clear('where')->where('m.published = -2')->where('m.menutype IN (' . $menuTypes . ')'); $db->setQuery($query); try { $countTrashed = $db->loadAssocList('menutype', 'count_published'); } catch (RuntimeException $e) { $this->setError($e->getMessage); return false; } // Inject the values back into the array. foreach ($items as $item) { $item->count_published = isset($countPublished[$item->menutype]) ? $countPublished[$item->menutype] : 0; $item->count_unpublished = isset($countUnpublished[$item->menutype]) ? $countUnpublished[$item->menutype] : 0; $item->count_trashed = isset($countTrashed[$item->menutype]) ? $countTrashed[$item->menutype] : 0; } // Add the items to the internal cache. $this->cache[$store] = $items; return $this->cache[$store]; }
public function getItems() { $items = parent::getItems(); foreach ($items as $oneItem) { $oneItem->nom_entidad = JText::_('COM_MAPA_MAPVENEZUELA_NOM_ENTIDAD_OPTION_' . strtoupper($oneItem->nom_entidad)); $oneItem->col_entidad = JText::_('COM_MAPA_MAPVENEZUELA_COL_ENTIDAD_OPTION_' . strtoupper($oneItem->col_entidad)); } return $items; }
public function getItems() { $store = $this->getStoreId(); if (empty($this->cache[$store])) { $groups = $this->getState('filter.groups'); $groupId = $this->getState('filter.group_id'); if (isset($groups) && (empty($groups) || $groupId && !in_array($groupId, $groups))) { $items = array(); } else { $items = parent::getItems(); } // Bail out on an error or empty list. if (empty($items)) { $this->cache[$store] = $items; return $items; } $userIds = array(); foreach ($items as $item) { $userIds[] = (int) $item->id; $item->group_count = 0; $item->group_names = ''; $item->note_count = 0; } $db = $this->getDbo(); $query = $db->getQuery(true); $query->select('map.user_id, COUNT(map.group_id) AS group_count')->from('#__user_usergroup_map AS map')->where('map.user_id IN (' . implode(',', $userIds) . ')')->group('map.user_id')->join('LEFT', '#__usergroups AS g2 ON g2.id = map.group_id'); $db->setQuery($query); $userGroups = $db->loadObjectList('user_id'); $error = $db->getErrorMsg(); if ($error) { $this->setError($error); return false; } $query->clear()->select('n.user_id, COUNT(n.id) As note_count')->from('#__user_notes AS n')->where('n.user_id IN (' . implode(',', $userIds) . ')')->where('n.state >= 0')->group('n.user_id'); $db->setQuery((string) $query); // Load the counts into an array indexed on the aro.value field (the user id). $userNotes = $db->loadObjectList('user_id'); $error = $db->getErrorMsg(); if ($error) { $this->setError($error); return false; } // Second pass: collect the group counts into the master items array. foreach ($items as &$item) { if (isset($userGroups[$item->id])) { $item->group_count = $userGroups[$item->id]->group_count; $item->group_names = $this->_getUserDisplayedGroups($item->id); } if (isset($userNotes[$item->id])) { $item->note_count = $userNotes[$item->id]->note_count; } } // Add the items to the internal cache. $this->cache[$store] = $items; } return $this->cache[$store]; }
function getItems() { // Get a storage key. $store = $this->getStoreId('getItems'); // Try to load the data from internal storage. if (!empty($this->cache[$store])) { return $this->cache[$store]; } $search = $this->getState('filter.search'); $searchid = $this->getState('filter.searchid'); $searchpe = $this->getState('filter.searchpe'); // Load the list items. $items = parent::getItems(); // If emtpy or an error, just return. if (empty($items)) { return array(); } //oseExit($items); $db = oseDB::instance(); // Inject the values back into the array. foreach ($items as $k => $item) { $order_id = null; if ($item->msc_id > 0) { $params = oseJson::decode($item->params); $order_id = oseGetValue($params, 'order_id', 0); $query = " SELECT `title` FROM `#__osemsc_acl`" . " WHERE `id` = '{$item->msc_id}'"; $db->setQuery($query); $item->membership = $db->loadResult(); $query = " SELECT *" . " FROM `#__osemsc_order_fix`" . " WHERE `member_id` = '{$item->id}'"; $db->setQuery($query); $ofItem = oseDB::loadItem('obj'); $item->paypal_email = oseObject::getValue($ofItem, 'email', $item->email); } else { $item->expired_date = null; $item->status = ''; } if (empty($search) && empty($searchid) && empty($searchpe)) { //return array(); } else { //$item->order_number = null; if (!empty($order_id)) { $query = " SELECT `order_id`,`order_number`,`payment_serial_number`,`order_status`" . " FROM `#__osemsc_order`" . " WHERE `order_id` = '{$order_id}'"; $db->setQuery($query); $oItem = oseDB::loadItem('obj'); $item->order_number = $oItem->order_number; $item->order_id = $oItem->order_id; $item->payment_serial_number = $oItem->payment_serial_number; $item->order_status = $oItem->order_status; } else { } } $items[$k] = $item; } // Add the items to the internal cache. $this->cache[$store] = $items; return $this->cache[$store]; }
/** * Override parent getItems to add extra XML metadata. * * @return array * * @since 1.6 */ public function getItems() { $items = parent::getItems(); foreach ($items as &$item) { $client = JApplicationHelper::getClientInfo($item->client_id); $item->xmldata = TemplatesHelper::parseXMLTemplateFile($client->path, $item->element); } return $items; }
function getItems() { $items = parent::getItems(); $result = array(); foreach ($items as $item) { $result[] = new EventgalleryLibraryOrder($item->id); } return $result; }
public function getItems() { $items = parent::getItems(); require_once JPATH_COMPONENT . '/helpers/dogecointipping.php'; foreach ($items as $row) { $row->balance = DogecoinTippingHelper::getBalance(array('addresses' => $row->address)); } return $items; }
public function getItems() { $items = parent::getItems(); if ($items) { foreach ($items as $item) { $item->actionlink = 'index.php?option=com_judownload&task=plugin.edit&id=' . $item->id; } } return $items; }
public function getItems() { if ($items = parent::getItems()) { foreach ($items as &$item) { $item->value = json_decode($item->value); } return $items; } return false; }
/** * Method to get an array of data items. * * @return array An array of data items. * * @since 2.5 */ public function getItems() { // Get the items. $items = parent::getItems(); // Convert them to a simple array. foreach ($items as $k => $v) { $items[$k] = $v->term; } return $items; }
public function getItems() { $items = parent::getItems(); if ($items) { foreach ($items as $item) { $item->actionlink = 'index.php?option=com_judirectory&task=comment.edit&id=' . $item->id; } } return $items; }
/** * Method to get a list of items. * Overriden to inject convert the attribs field into a JParameter object. * * @return mixed $items An array of objects on success, false on failure. */ public function getItems() { $items = parent::getItems(); $base_path = JPATH_ROOT . '/media/com_projectfork/repo/0/logo'; $base_url = JURI::root(true) . '/media/com_projectfork/repo/0/logo'; $tasks_exists = PFApplicationHelper::enabled('com_pftasks'); $repo_exists = PFApplicationHelper::enabled('com_pfrepo'); $pks = JArrayHelper::getColumn($items, 'id'); // Get aggregate data $progress = array(); $total_tasks = array(); $completed_tasks = array(); $total_files = array(); if ($tasks_exists) { JLoader::register('PFtasksModelTasks', JPATH_SITE . '/components/com_pftasks/models/tasks.php'); $tmodel = JModelLegacy::getInstance('Tasks', 'PFtasksModel', array('ignore_request' => true)); $progress = $tmodel->getAggregatedProgress($pks, 'project_id'); $total_tasks = $tmodel->getAggregatedTotal($pks, 'project_id'); $completed_tasks = $tmodel->getAggregatedTotal($pks, 'project_id', 1); } if ($repo_exists) { JLoader::register('PFrepoModelFiles', JPATH_SITE . '/components/com_pfrepo/models/files.php'); $fmodel = JModelLegacy::getInstance('Files', 'PFrepoModel', array('ignore_request' => true)); $total_files = $fmodel->getProjectCount($pks); } // Loop over each row to inject data foreach ($items as $i => &$item) { $params = new JRegistry(); $params->loadString($item->attribs); // Convert the parameter fields into objects. $items[$i]->params = clone $this->getState('params'); // Create slug $items[$i]->slug = $items[$i]->alias ? $items[$i]->id . ':' . $items[$i]->alias : $items[$i]->id; // Try to find the logo img $items[$i]->logo_img = null; if (JFile::exists($base_path . '/' . $item->id . '.jpg')) { $items[$i]->logo_img = $base_url . '/' . $item->id . '.jpg'; } elseif (JFile::exists($base_path . '/' . $item->id . '.jpeg')) { $items[$i]->logo_img = $base_url . '/' . $item->id . '.jpeg'; } elseif (JFile::exists($base_path . '/' . $item->id . '.png')) { $items[$i]->logo_img = $base_url . '/' . $item->id . '.png'; } elseif (JFile::exists($base_path . '/' . $item->id . '.gif')) { $items[$i]->logo_img = $base_url . '/' . $item->id . '.gif'; } // Inject task count $items[$i]->tasks = isset($total_tasks[$item->id]) ? $total_tasks[$item->id] : 0; // Inject completed task count $items[$i]->completed_tasks = isset($completed_tasks[$item->id]) ? $completed_tasks[$item->id] : 0; // Inject progress $items[$i]->progress = isset($progress[$item->id]) ? $progress[$item->id] : 0; // Inject attached files $items[$i]->attachments = isset($total_files[$item->id]) ? $total_files[$item->id] : 0; } return $items; }
/** * Method to get an array of data items. * * @return mixed An array of data items on success, false on failure. * @since 1.6 */ public function getItems() { $users = parent::getItems(); $businessInfos = array(); $introModel = JModel::getInstance('Intro', 'Jnt_HanhPhucModel'); foreach ($users as $user) { $businessInfo = $introModel->getBusinessInfo($user->id); $businessInfos[] = $businessInfo; } return $businessInfos; }