Beispiel #1
0
 function _loadItems()
 {
     // Get a database connector
     $db = JFactory::getDBO();
     $sql = $db->getQuery(true);
     $sql->select('id, tag, filename')->from('#__jcklanguages')->order('id DESC');
     if ($search = $this->state->get('filter.string')) {
         $sql->where('title LIKE ' . $db->Quote('%' . $db->getEscaped($search, true) . '%', false));
     }
     $rows = $db->setQuery($sql)->loadObjectList();
     // Get the plugin base path
     $baseDir = JPATH_COMPONENT . '/language';
     $numRows = count($rows);
     for ($i = 0; $i < $numRows; $i++) {
         $row =& $rows[$i];
         // Get the plugin xml file
         $xmlfile = $baseDir . '/overrides/' . $row->filename;
         if (!file_exists($xmlfile)) {
             $xmlfile = $baseDir . '/' . $row->tag . '/' . $row->filename;
         }
         if (file_exists($xmlfile)) {
             if ($data = JCKHelper::parseXMLInstallFile($xmlfile)) {
                 foreach ($data as $key => $value) {
                     $row->{$key} = $value;
                 }
             }
         }
     }
     $this->setState('pagination.total', $numRows);
     if ($this->state->get('pagination.limit') > 0) {
         $this->_items = array_slice($rows, $this->state->get('pagination.offset'), $this->state->get('pagination.limit'));
     } else {
         $this->_items = $rows;
     }
 }
Beispiel #2
0
 function _loadItems()
 {
     // Get a database connector
     $db = JFactory::getDBO();
     $sql = $db->getQuery(true);
     $sql->select('id, title, type, name')->from('#__jckplugins')->where('type = "plugin"')->where('iscore = 0')->order('name');
     if ($search = $this->state->get('filter.string')) {
         $sql->where('title LIKE ' . $db->Quote('%' . $db->getEscaped($search, true) . '%', false));
     }
     $rows = $db->setQuery($sql)->loadObjectList();
     // Get the plugin base path
     $baseDir = JCK_PLUGINS;
     $numRows = count($rows);
     for ($i = 0; $i < $numRows; $i++) {
         $row =& $rows[$i];
         // Get the plugin xml file
         $xmlfile = $baseDir . DS . $row->name . DS . $row->name . ".xml";
         if (file_exists($xmlfile)) {
             if ($data = JCKHelper::parseXMLInstallFile($xmlfile)) {
                 foreach ($data as $key => $value) {
                     if ($value) {
                         $row->{$key} = $value;
                     }
                 }
             }
         }
     }
     $this->setState('pagination.total', $numRows);
     if ($this->state->get('pagination.limit') > 0) {
         $this->_items = array_slice($rows, $this->state->get('pagination.offset'), $this->state->get('pagination.limit'));
     } else {
         $this->_items = $rows;
     }
 }