Esempio n. 1
0
 public function missingFilesOrTables($tables = array('categories', 'items'), $component = '', $table_prefix = '')
 {
     $component = $component ?: $this->type;
     if (!RLFunctions::extensionInstalled(strtolower($component))) {
         return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('RL_FILES_NOT_FOUND', JText::_('RL_' . strtoupper($component))) . '</fieldset>';
     }
     $group = $this->getGroup();
     if (!in_array($group, $tables) && !in_array($group, array_keys($tables))) {
         // no need to check database table for this group
         return false;
     }
     $table_list = $this->db->getTableList();
     $table = isset($tables[$group]) ? $tables[$group] : $group;
     $table = $this->db->getPrefix() . strtolower($table_prefix ?: $component) . '_' . $table;
     if (in_array($table, $table_list)) {
         // database table exists, so no error
         return false;
     }
     return '<fieldset class="alert alert-danger">' . JText::_('ERROR') . ': ' . JText::sprintf('RL_TABLE_NOT_FOUND', JText::_('RL_' . strtoupper($component))) . '</fieldset>';
 }
 public function __construct()
 {
     $this->db = JFactory::getDbo();
     $this->has = array();
     $this->has['easyblog'] = RLFunctions::extensionInstalled('easyblog');
     $this->has['flexicontent'] = RLFunctions::extensionInstalled('flexicontent');
     $this->has['form2content'] = RLFunctions::extensionInstalled('form2content');
     $this->has['k2'] = RLFunctions::extensionInstalled('k2');
     $this->has['zoo'] = RLFunctions::extensionInstalled('zoo');
     $this->has['akeebasubs'] = RLFunctions::extensionInstalled('akeebasubs');
     $this->has['hikashop'] = RLFunctions::extensionInstalled('hikashop');
     $this->has['mijoshop'] = RLFunctions::extensionInstalled('mijoshop');
     $this->has['redshop'] = RLFunctions::extensionInstalled('redshop');
     $this->has['virtuemart'] = RLFunctions::extensionInstalled('virtuemart');
     $this->has['cookieconfirm'] = RLFunctions::extensionInstalled('cookieconfirm');
     $this->types = array('menuitems' => 'Menu', 'homepage' => 'HomePage', 'date' => 'DateTime.Date', 'seasons' => 'DateTime.Seasons', 'months' => 'DateTime.Months', 'days' => 'DateTime.Days', 'time' => 'DateTime.Time', 'usergrouplevels' => 'Users.UserGroupLevels', 'users' => 'Users.Users', 'languages' => 'Languages', 'ips' => 'IPs', 'geocontinents' => 'Geo.Continents', 'geocountries' => 'Geo.Countries', 'georegions' => 'Geo.Regions', 'geopostalcodes' => 'Geo.Postalcodes', 'templates' => 'Templates', 'urls' => 'URLs', 'devices' => 'Agents.Devices', 'os' => 'Agents.OS', 'browsers' => 'Agents.Browsers', 'components' => 'Components', 'tags' => 'Tags', 'contentpagetypes' => 'Content.PageTypes', 'cats' => 'Content.Categories', 'articles' => 'Content.Articles', 'easyblogpagetypes' => 'EasyBlog.PageTypes', 'easyblogcats' => 'EasyBlog.Categories', 'easyblogtags' => 'EasyBlog.Tags', 'easyblogitems' => 'EasyBlog.Items', 'flexicontentpagetypes' => 'FlexiContent.PageTypes', 'flexicontenttags' => 'FlexiContent.Tags', 'flexicontenttypes' => 'FlexiContent.Types', 'form2contentprojects' => 'Form2Content.Projects', 'k2pagetypes' => 'K2.PageTypes', 'k2cats' => 'K2.Categories', 'k2tags' => 'K2.Tags', 'k2items' => 'K2.Items', 'zoopagetypes' => 'Zoo.PageTypes', 'zoocats' => 'Zoo.Categories', 'zooitems' => 'Zoo.Items', 'akeebasubspagetypes' => 'AkeebaSubs.PageTypes', 'akeebasubslevels' => 'AkeebaSubs.Levels', 'hikashoppagetypes' => 'HikaShop.PageTypes', 'hikashopcats' => 'HikaShop.Categories', 'hikashopproducts' => 'HikaShop.Products', 'mijoshoppagetypes' => 'MijoShop.PageTypes', 'mijoshopcats' => 'MijoShop.Categories', 'mijoshopproducts' => 'MijoShop.Products', 'redshoppagetypes' => 'RedShop.PageTypes', 'redshopcats' => 'RedShop.Categories', 'redshopproducts' => 'RedShop.Products', 'virtuemartpagetypes' => 'VirtueMart.PageTypes', 'virtuemartcats' => 'VirtueMart.Categories', 'virtuemartproducts' => 'VirtueMart.Products', 'cookieconfirm' => 'CookieConfirm', 'php' => 'PHP');
     $this->thirdparty = array('EasyBlog', 'FlexiContent', 'Form2Content', 'K2', 'Zoo', 'AkeebaSubs', 'HikaShop', 'MijoShop', 'RedShop', 'VirtueMart', 'CookieConfirm');
     $this->nonarray = array('PHP');
     $this->setIdNames();
     $this->classes = array();
 }
 protected function getInput()
 {
     $this->params = $this->element->attributes();
     $is_installed = RLFunctions::extensionInstalled($this->get('extension'), $this->get('extension_type'), $this->get('folder'));
     return '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="' . (int) $is_installed . '">';
 }