function jaGetDefaultService() { $services = jaGetListServices(); $default = new stdClass(); foreach ($services as $id => $sv) { if ($id == 0 || $sv->ws_default) { $default = $sv; } } //set default values if (!isset($default->ws_mode)) { $default->ws_mode = 'local'; } if (!isset($default->ws_uri)) { $default->ws_uri = 'http://update.joomlart.com/service/'; } if (!isset($default->ws_user)) { $default->ws_user = '******'; } if (!isset($default->ws_pass)) { $default->ws_pass = ''; } return $default; }
/** * get list of extensions (all type) that installed on your sites * (The result will be storaged into the '_updateExtensions' property of object). * - this list will be collected from many tables * - the field 'extKey' will be used to identify extension, * it is got from different information (depend on extension type) * * @param (int) $limitstart * @param (int) $limit * @param (array) $lists - other params */ function _loadExtensions($limitstart = 0, $limit = 20, $lists = array()) { // Initialise variables. $app = JFactory::getApplication('administrator'); $type = JRequest::getVar('type', '') != '' ? JRequest::getVar('type') : $lists['extionsion_type']; $sFilter = $this->_getFilterExtensions(); $db = JFactory::getDbo(); $query = "\r\r\n\t\t\t\tSELECT \r\r\n\t\t\t\t\t`type`, `element` AS extKey,\r\r\n\t\t\t\t\textension_id AS id, name, params, protected, `state` AS enabled, \r\r\n\t\t\t\t\telement, client_id, folder \r\r\n\t\t\t\tFROM #__extensions \r\r\n\t\t\t\tWHERE (`type` = " . $db->Quote($type) . " OR '' = " . $db->Quote($type) . ")\r\r\n\t\t\t\tAND `element` NOT LIKE '%jaupdater.%'\r\r\n\t\t\t\t{$sFilter}\r\r\n\t\t\t\tGROUP BY extension_id\r\r\n\t\t\t\tORDER BY `type`, `name`\r\r\n\t\t\t\tLIMIT {$limitstart}, {$limit}"; //echo nl2br($query); //die($query); $db->setQuery($query); $rows = $db->loadObjectList(); $this->_updateExtensions = array(); $aSettings = $this->getListExtensionSettings(); $services = jaGetListServices(); $helper = new JaextmanagerHelper($aSettings, $services); foreach ($rows as $obj) { if (($obj2 = $helper->loadExtension($obj, $obj->type)) !== false) { $this->_updateExtensions[] = $obj2; } } }
function displayConfigExtensions($tpl = null) { JToolBarHelper::save("config_extensions"); // Initialize variables $model =& $this->getModel('default'); $extension = $model->_getProduct(); $params = $model->getComponentParams(); $services = jaGetListServices(); $configId = $extension->serviceKey; $listServices = JHTML::_('select.radiolist', $services, "params[{$configId}]", 'class="inputbox"', 'id', 'ws_name', $params->get($configId)); $this->assignRef('listServices', $listServices); //print_r($services); $this->assignRef('configId', $configId); $this->assignRef('services', $services); $this->assignRef('params', $params); $this->assignRef('extension', $extension); parent::display($tpl); }
/** * Display List of items */ function displayListItems($tpl = null) { $services = jaGetListServices(); foreach ($services as $service) { JToolBarHelper::custom('config_extensions_' . $service->id, 'default', 'default', $service->ws_name, true); } JToolBarHelper::custom('checkupdate', 'preview', 'preview', JText::_('CHECK_UPDATE'), true); JToolBarHelper::custom('recovery', 'restore', 'restore', JText::_('ROLLBACK'), true); // JToolBarHelper::preferences(JACOMPONENT); $model = $this->getModel('default'); //$components = &$this->get("components"); $lists = $model->_getUsListExtensions(); $listExtensions = $model->getListExtensions(); $state = $this->get('State'); $pagination = $model->getPagination(); $boxType = JHtml::_('select.genericlist', $model->getListExtensionType(), 'extionsion_type', 'class="inputbox"', 'value', 'text', JRequest::getVar('extionsion_type')); $comUri = $this->get("comUri"); //$this->assignRef('components', $components); $this->assignRef('services', $services); $this->assignRef('listExtensions', $listExtensions); $this->assignRef('pagination', $pagination); $this->assignRef('boxType', $boxType); $this->assignRef('comUri', $comUri); $this->assignRef('lists', $lists); parent::display($tpl); }
function _loadExtensions($limitstart = 0, $limit = 20, $lists = array()) { global $mainframe, $option; $type = JRequest::getVar('type', '') != '' ? JRequest::getVar('type') : $lists['extionsion_type']; $aFilter = $this->_getFilterExtensions(); $db =& JFactory::getDBO(); $aUnion = array(); $aUnion['component'] = "\n\t\t\t\tSELECT \n\t\t\t\t\t'component' AS `type`, `option` AS extKey,\n\t\t\t\t\tid, name, params, iscore, enabled, \n\t\t\t\t\t`option`, '' AS module, '' AS element, '0' AS client_id, '' AS folder \n\t\t\t\tFROM #__components \n\t\t\t\t{$aFilter['com']} \n\t\t\t\tGROUP BY `option`\n\t\t\t\t"; $aUnion['module'] = "\n\t\t\t\tSELECT \n\t\t\t\t\t'module' AS `type`, module AS extKey,\n\t\t\t\t\tid, title AS name, params, iscore, published AS enabled, \n\t\t\t\t\t'' AS `option`, module, '' AS element, client_id, '' AS folder \n\t\t\t\tFROM #__modules \n\t\t\t\t{$aFilter['mod']} \n\t\t\t\tGROUP BY `module`\n\t\t\t\t"; $aUnion['plugin'] = "\n\t\t\t\tSELECT \n\t\t\t\t\t'plugin' AS `type`, element AS extKey,\n\t\t\t\t\tid, name, params, iscore, published AS enabled, \n\t\t\t\t\t'' AS `option`, '' AS module, element, '0' AS client_id, folder \n\t\t\t\tFROM #__plugins \n\t\t\t\t{$aFilter['plg']} \n\t\t\t\t"; /** * do not group plugin, because some plugin have same name but difference from group * Ex: K2 have three 3 plugin with same name * GROUP BY `element` */ $aUnion['template'] = "\n\t\t\t\tSELECT \n\t\t\t\t\t'template' AS `type`, template AS extKey,\n\t\t\t\t\ttemplate AS id, template AS name, '' AS params, '0' AS iscore, '1' AS enabled, \n\t\t\t\t\t'' AS `option`, '' AS module, '' AS element, client_id, '' AS folder \n\t\t\t\tFROM #__templates_menu \n\t\t\t\t{$aFilter['tpl']} \n\t\t\t\tGROUP BY `template`\n\t\t\t\t"; if (array_key_exists($type, $aUnion)) { $query = $aUnion[$type]; } else { $query = implode(" UNION ", $aUnion); } $query .= "\n\t\t\t\tORDER BY iscore, name\n\t\t\t\tLIMIT {$limitstart}, {$limit}"; $db->setQuery($query); $rows = $db->loadObjectList(); $this->_updateExtensions = array(); $params = $this->getComponentParams(); $services = jaGetListServices(); $helper = new JaextmanagerHelper($params, $services); foreach ($rows as $obj) { if (($obj = $helper->loadExtension($obj, $obj->type)) !== false) { $this->_updateExtensions[] = $obj; } } }
/** * Display List of items */ function displayListItems($tpl = null) { global $mainframe, $option, $jauc; /* * Set toolbar items for the page */ $services = jaGetListServices(); foreach ($services as $service) { JToolBarHelper::custom('config_extensions_' . $service->id, 'default', 'default', $service->ws_name, true); } JToolBarHelper::custom('checkupdate', 'preview', 'preview', JText::_('Check Update'), true); JToolBarHelper::custom('recovery', 'restore', 'restore', JText::_('Rollback'), true); // JToolBarHelper::preferences(JACOMPONENT); JToolBarHelper::help('screen.jauc'); $model =& $this->getModel('default'); //$components = &$this->get("components"); $listExtensions = $model->getListExtensions(); $state = $this->get('State'); $pagination = $model->getPagination(); $boxType = JHTML::_('select.genericlist', $model->getListExtensionType(), 'extionsion_type', 'class="inputbox"', 'value', 'text', JRequest::getVar('extionsion_type')); //$this->assignRef('components', $components); $this->assignRef('services', $services); $this->assignRef('listExtensions', $listExtensions); $this->assignRef('pagination', $pagination); $this->assignRef('boxType', $boxType); $this->assignRef('comUri', $this->get("comUri")); parent::display($tpl); }