public function __construct($config = array()) { if (defined('JLEGACY_CMS')) { $sql = "SELECT id,params FROM #__plugins WHERE element = 'jckeditor' AND folder ='editors'"; } else { $sql = "SELECT extension_id as id, params FROM #__extensions WHERE element = 'jckeditor' AND folder ='editors'"; } //end if $database = JFactory::getDBO(); $database->setQuery($sql); $result = $database->loadObject(); $this->_editor = $result; $this->_basepath = JPATH_CONFIGURATION . DS . 'templates'; $basepath = $this->_basepath; if (defined('JLEGACY_CMS')) { $sql = "SELECT template as value,template as text, case when client_id = 0 AND menuid = 0 then 1 else 0 end as system_default FROM #__templates_menu WHERE client_id = 0"; } else { $sql = "SELECT template as value,template as text, case when client_id = 0 AND home = 1 then 1 else 0 end as system_default FROM #__template_styles WHERE client_id = 0"; } //end if $database->setQuery($sql); $result = $database->loadObjectList(); $this->_templates = $result; for ($i = 0; $i < count($this->_templates); $i++) { if ($this->_templates[$i]->system_default) { $this->_defaultTemplate = $this->_templates[$i]->value; break; } } $this->_excludeFilter = 'ieonly|ie7only|ie8only|_ie|_rtl|ie7|ie8|_Konqueror|_mozilla|_opera|print'; parent::__construct($config); }
public function __construct($config = array()) { if (defined('JLEGACY_CMS')) { $sql = "SELECT id,params FROM #__plugins WHERE element = 'jckeditor' AND folder ='editors'"; } else { $sql = "SELECT extension_id as id, params FROM #__extensions WHERE element = 'jckeditor' AND folder ='editors'"; } //end if $database = JFactory::getDBO(); $database->setQuery($sql); $result = $database->loadObject(); $this->_editor = $result; parent::__construct($config); }
public function __construct($config = array()) { $path = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor'; $files = JFolder::files($path, $filter = '\\.php$', true, true); $permisson = fileperms(JPATH_CONFIGURATION . DS . 'index.php'); $permisson = decoct($permisson & 0777); $folderPermisson = fileperms(JPATH_CONFIGURATION . DS . 'components'); $folderPermisson = decoct($folderPermisson & 0777); $files = JFolder::files($path, $filter = '\\.php$', true, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'install')); $folders = JFolder::folders($path, $filter = '.', true, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX', 'install')); $path = JPATH_CONFIGURATION . DS . 'images'; $imageFolders = JFolder::folders($path, $filter = '.', true, true); array_unshift($imageFolders, $path); $this->_permission = $permisson; $this->_folderPermission = $folderPermisson; $this->_files = $files; $this->_folders = $folders; $this->_imageFolders = $imageFolders; parent::__construct($config); }
public function __construct($config = array()) { if (defined('JLEGACY_CMS')) { $sql = "SELECT id,params FROM #__plugins WHERE element = 'jckeditor' AND folder ='editors'"; } else { $sql = "SELECT extension_id as id, params FROM #__extensions WHERE element = 'jckeditor' AND folder ='editors'"; } //end if JHtml::$formatOptions['option.attr'] = 'attr'; $database = JFactory::getDBO(); $database->setQuery($sql); $result = $database->loadObject(); $this->_editor = $result; $this->_basepath = JPATH_CONFIGURATION . DS . 'templates'; $basepath = $this->_basepath; if (defined('JLEGACY_CMS')) { $sql = "SELECT template as value,template as text,1 as system_default FROM #__templates_menu WHERE client_id = 0 AND menuid = 1\n UNION\n SELECT template as value,template as text, 0 as system_default FROM #__templates_menu s\n WHERE client_id = 0 And menuid = 0 AND NOT exists (SELECT 1 FROM #__templates_menu d WHERE d.template = s.template AND client_id = 0 And menuid = 1)"; } else { $sql = "SELECT template as value,template as text, 1 as system_default FROM #__template_styles WHERE client_id = 0 And home = 1\n UNION\n SELECT template as value,template as text, 0 as system_default FROM #__template_styles s\n WHERE client_id = 0 And home = 0 AND NOT exists (SELECT 1 FROM #__template_styles d WHERE d.template = s.template AND client_id = 0 And home = 1)"; } //end if $database->setQuery($sql); $results = $database->loadObjectList(); $list = array(); for ($i = 0; $i < count($results); $i++) { if (JFolder::exists($this->_basepath . DS . $results[$i]->value)) { $list[] = $results[$i]; } } $this->_templates = $list; for ($i = 0; $i < count($this->_templates); $i++) { if ($this->_templates[$i]->system_default) { $this->_defaultTemplate = $this->_templates[$i]->value; break; } } $this->_excludeFilter = 'ieonly|ie7only|ie8only|_ie|_rtl|ie7|ie8|_Konqueror|_mozilla|_opera|print'; parent::__construct($config); }