function display($tpl = null) { $this->canDo = ARKHelper::getActions(); $this->app = JFactory::getApplication(); $this->user = JFactory::getUser(); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { ARKHelper::error(implode("\n", $errors)); return false; } // Check if there are no matching items if (!count($this->items)) { ARKHelper::error(JText::_('COM_ARKEDITOR_LAYOUT_MANAGER_NO_TOOLBARS_FOUND')); } //now lets get default toolbars $editor = JPluginHelper::getPlugin('editors', 'arkeditor'); $params = new JRegistry($editor->params); $this->default = $params->get('toolbar', 'Publisher'); $this->defaultFT = $params->get('toolbar_ft', 'Basic'); $this->addToolbar(); parent::display($tpl); }
protected function addToolbar() { $bar = JToolBar::getInstance('toolbar'); $canDo = ARKHelper::getActions(); JToolBarHelper::title(JText::_('COM_ARKEDITOR_SUBMENU_PLUGIN_NAME'), 'puzzle'); require_once JPATH_COMPONENT . DS . 'helper.php'; $links = ARKHelper::getExternalLinks(); if ($canDo->get('core.edit')) { JToolBarHelper::editList('list.edit'); } //end if if ($canDo->get('core.edit.state')) { JToolBarHelper::publishList('list.publish'); JToolBarHelper::unpublishList('list.unpublish'); JToolbarHelper::checkin('list.checkin'); } //end if JToolBarHelper::help($this->app->input->get('view'), false, $links['ark-guide']); ARKHelper::addSubmenu($this->app->input->get('view')); JHtmlSidebar::setAction('index.php?option=com_arkeditor&view=list'); // FILTERS JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ARKHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'))); JHtmlSidebar::addFilter(JText::_('- Select Core Type -'), 'filter_iscore', JHtml::_('select.options', array(JHtml::_('select.option', '1', 'Core Plugins'), JHtml::_('select.option', '0', 'Not Core Plugins')), 'value', 'text', $this->state->get('filter.iscore'))); $this->sidebar = JHtmlSidebar::render(); }
function __construct($default = array()) { parent::__construct($default); $this->canDo = ARKHelper::getActions(); $this->registerTask('apply', 'save'); $this->registerTask('unpublish', 'publish'); $this->registerTask('edit', 'display'); $this->registerTask('add', 'display'); $this->registerTask('orderup', 'order'); $this->registerTask('orderdown', 'order'); }
function __construct($default = array()) { parent::__construct($default); $this->canDo = ARKHelper::getActions(); $this->registerTask('apply', 'save'); $this->registerTask('edit', 'display'); $this->registerTask('add', 'display'); $this->registerTask('trash', 'remove'); // drop-down menu $this->registerTask('remove', 'remove'); }
function display($tpl = null) { $this->canDo = ARKHelper::getActions(); $this->app = JFactory::getApplication(); $lang = JFactory::getLanguage(); $this->left = ARKModuleHelper::getModules('ark_icon'); $this->right = ARKModuleHelper::getModules('ark_cpanel'); $this->bottom = ARKModuleHelper::getModules('ark_footer'); $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { $this->canDo = ARKHelper::getActions(); $this->app = JFactory::getApplication(); $this->user = JFactory::getUser(); $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->params = $this->prepareForm($this->item); if (!$this->canDo->get('core.edit')) { $this->app->redirect(JRoute::_('index.php?option=com_arkeditor&view=list', false), JText::_('COM_ARKEDITOR_PLUGIN_PERM_NO_EDIT'), 'error'); return false; } //end if //language $lang = ARKHelper::getLanguage(); $tag = $lang->getTag(); JFactory::$language = $lang; //override Joomla default language class $name = $this->item->name; $plugin = 'plg_arkeditor' . $name; $pluginOverideFile = JPATH_COMPONENT . '/language/overrides/' . $tag . '.' . $plugin . '.ini'; $pluginLangFile = JPATH_COMPONENT . '/language/' . $tag . '/' . $tag . '.' . $plugin . '.ini'; if (JFile::exists($pluginOverideFile)) { //check in language overrides to see if user has installed an override language file $lang->loadFile($pluginOverideFile, $plugin); } else { if (JFile::exists($pluginLangFile)) { //load core language file if it exists $lang->load($plugin, JPATH_COMPONENT); } else { //load english default languge if (JFile::exists(JPATH_COMPONENT . '/language/en-GB/en-GB.plg_arkeditor' . $name . '.ini')) { $lang->load($plugin, JPATH_COMPONENT, 'en-GB'); } } } $this->item->description = JText::_($this->item->description); $this->form->bind($this->item); // Check for errors. if (count($errors = $this->get('Errors'))) { ARKHelper::error(implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); }
function __construct(&$subject) { parent::__construct($subject); $this->canDo = ARKHelper::getActions(); $this->app = JFactory::getApplication(); }
public static function addSubmenu($vName = false) { $user = JFactory::getUser(); $canDo = ARKHelper::getActions(); $subMenus = array('COM_ARKEDITOR_SUBMENU_CPANEL_NAME' => array('extension' => 'cpanel', 'permission' => '', 'hideinmob' => false, 'hideinipad' => false), 'COM_ARKEDITOR_SUBMENU_PLUGIN_NAME' => array('extension' => 'list', 'permission' => '', 'hideinmob' => false, 'hideinipad' => false), 'COM_ARKEDITOR_SUBMENU_INSTALL_NAME' => array('extension' => 'install', 'permission' => '', 'hideinmob' => false, 'hideinipad' => false), 'COM_ARKEDITOR_SUBMENU_UNINSTALL_NAME' => array('extension' => 'extension', 'permission' => '', 'hideinmob' => false, 'hideinipad' => false), 'COM_ARKEDITOR_SUBMENU_LAYOUT_NAME' => array('extension' => 'toolbars', 'permission' => '', 'hideinmob' => true, 'hideinipad' => true)); $dbo = JFactory::getDBO(); $sql = $dbo->getQuery(true); $sql->select('extension_id')->from('#__extensions')->where('type = "plugin"')->where('folder = "editors"')->where('element = "arkeditor"'); $dbo->setQuery($sql); if ($dbo->loadresult()) { $subMenus['COM_ARKEDITOR_SUBMENU_ARKEDITOR_NAME'] = array('extension' => 'cpanel&task=cpanel.editor', 'permission' => '', 'hideinmob' => false, 'hideinipad' => false); } else { $subMenus['COM_ARKEDITOR_SUBMENU_NOEDITOR_NAME'] = array('extension' => '#', 'permission' => '', 'hideinmob' => false, 'hideinipad' => false); } foreach ($subMenus as $name => $params) { // hide in iPad if (!$params['hideinipad'] || $params['hideinipad'] && !self::isiPad()) { // hide in mobile if (!$params['hideinmob'] || $params['hideinmob'] && !self::isMobile()) { if ($params['extension'] == 'install' && $user->authorise('core.manage', 'com_installer')) { JHtmlSidebar::addEntry(JText::_($name), 'index.php?option=com_installer', false); } elseif ($params['extension'] == 'extension' && ($user->authorise('core.manage', 'com_installer') && $user->authorise('core.delete', 'com_installer'))) { JHtmlSidebar::addEntry(JText::_($name), 'index.php?option=com_installer&view=manage&filter_group=arkeditor', false); } elseif (!$params['permission'] || $canDo->get($params['permission'])) { $url = $params['extension'] == '#' ? $params['extension'] : 'index.php?option=com_arkeditor&view=' . $params['extension']; JHtmlSidebar::addEntry(JText::_($name), $url, $params['extension'] == $vName); } } } } }
function display($tpl = null) { $this->canDo = ARKHelper::getActions(); $this->app = JFactory::getApplication(); $this->user = JFactory::getUser(); $this->item = ''; $this->getForm(); $cid = $this->app->input->get('cid', array(), 'array'); JArrayHelper::toInteger($cid, array(0)); if (!count($cid) && !$this->canDo->get('core.create')) { $this->app->redirect(JRoute::_('index.php?option=com_arkeditor&view=cpanel', false), JText::_('COM_ARKEDITOR_PLUGIN_PERM_NO_CREATE'), 'error'); return false; } elseif (!$this->canDo->get('core.edit')) { $this->app->redirect(JRoute::_('index.php?option=com_arkeditor&view=cpanel', false), JText::_('COM_ARKEDITOR_PLUGIN_PERM_NO_EDIT'), 'error'); return false; } //end if $lists = array(); $this->item = ARKHelper::getTable('toolbar'); // load the row from the db table $this->item->load(isset($cid[0]) ? $cid[0] : 0); // fail if checked out not by 'me' if ($this->item->isCheckedOut($this->user->get('id'))) { $msg = JText::sprintf('COM_ARKEDITOR_MSG_BEING_EDITED', JText::_('The toolbar'), $this->item->title); $this->app->redirect(JRoute::_('index.php?option=com_arkeditor&view=toolbars', false), $msg, 'error'); return false; } if (isset($cid[0])) { $this->item->checkout($this->user->get('id')); //now lets get default toolbars $params = ARKHelper::getEditorPluginConfig(); $this->default = $params->get('toolbar', 'back'); $this->defaultFT = $params->get('toolbar_ft', 'front'); $this->item->params = new JRegistry($this->item->params); $this->form->bind($this->item->params); //bind params options to form if (strtolower($this->item->name) == strtolower($this->default) || strtolower($this->item->name) == strtolower($this->defaultFT)) { $this->item->default = true; } else { $this->item->default = false; } } else { $this->item->params = ''; $this->item->default = false; } $db = JFactory::getDBO(); //set the default total number of plugin records $total = 0; $totalRows = 0; if (isset($cid[0])) { $total = 1; $config = ARKHelper::getEditorPluginConfig(); $toolbars = $config->get('toolbars'); if ($toolbars) { $toolbar = array(); $toolbar = $toolbars[$this->item->name]; $it = array(); if (!empty($toolbar)) { $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($toolbar)); } $pluginTitles = "'0',"; foreach ($it as $v) { $pluginTitles .= $db->quote($v) . ","; } $pluginTitles = rtrim($pluginTitles, ","); $sql = $db->getQuery(true); $sql->select('p.id,p.title,p.icon,p.row,p.name')->from('#__ark_editor_plugins p')->join('LEFT', '#__ark_editor_plugins parent on parent.id = p.parentid')->where('p.title NOT IN (' . $pluginTitles . ')')->where('p.published = 1')->where('p.title <> ' . $db->quote(''))->where('(p.parentid IS NULL OR parent.published = 1)')->where('p.name <> ' . $db->quote('imagemanager'))->where('p.name <> ' . $db->quote('treelink'))->where('p.name <> ' . $db->quote('styles'))->where('p.name <> ' . $db->quote('arkabout'))->order('p.row ASC, p.id ASC'); $plugins = $db->setQuery($sql)->loadObjectList(); $sql = $db->getQuery(true); $sql->select('p.title')->from('#__ark_editor_plugins p')->join('LEFT', '#__ark_editor_plugins parent on parent.id = p.parentid AND parent.published = 1')->where('p.title IN (' . $pluginTitles . ')')->where('p.published = 1')->where('p.name <> ' . $db->quote('styles'))->where('p.name <> ' . $db->quote('arkabout'))->order('p.id ASC'); $keys = $db->setQuery($sql)->loadColumn(); $sql = $db->getQuery(true); $sql->select('p.title,p.icon,p.name')->from('#__ark_editor_plugins p')->join('LEFT', '#__ark_editor_plugins parent on parent.id = p.parentid AND parent.published = 1')->where('p.title IN (' . $pluginTitles . ')')->where('p.published = 1')->where('p.name <> ' . $db->quote('styles'))->where('p.name <> ' . $db->quote('arkabout'))->order('p.id ASC'); $values = $db->setQuery($sql)->loadObjectList(); $items = array_combine($keys, $values); $this->items = $items; $this->toolbarplugins = $this->_getSortRowToolbars($toolbar); $this->assign('plugins', $plugins); } } $params = new JRegistry($this->item->params); $components = $params->get('components', array()); $db->setQuery("SELECT element as value, REPLACE(element,'com_','') as text FROM #__extensions WHERE type = 'component' ORDER BY element ASC"); $query = $db->getQuery(true); $query->select('element AS value, element AS text')->from('#__extensions')->where($db->quoteName('type') . ' = ' . $db->quote('component'))->order('element ASC'); $allcomponents = $db->loadObjectList(); foreach ($allcomponents as $component) { $component->text = str_replace('com_', '', $component->text); } $lists['components'] = JHTML::_('select.genericlist', $allcomponents, 'components[]', ' size="10" multiple', 'value', 'text', $components); $this->assign('lists', $lists); $this->assign('toolbar', $this->item); $this->assign('total', $total); //$this->assignRef('total', $total); $this->addToolbar(); parent::display($tpl); }
<span class="icon-<?php echo $icon; ?> "></span> <div><?php echo $text; ?> </div> </a> <?php } echo '<div id="arkcpanel">'; $base = 'index.php?option=com_arkeditor'; $view = '&view='; $task = '&task='; $canDo = ARKHelper::getActions(); $isMobile = ARKHelper::isMobile(); $isIOS = ARKHelper::isMobile() || ARKHelper::isiPad(); $user = JFactory::getUser(); quickiconButton($base . $view . 'list', 'puzzle', JText::_('COM_ARKEDITOR_QUICKICON_PLUGIN_NAME'), 'list'); if ($user->authorise('core.manage', 'com_installer')) { quickiconButton('index.php?option=com_installer', 'cube', JText::_('COM_ARKEDITOR_QUICKICON_INSTALL_NAME'), 'install'); } if ($user->authorise('core.manage', 'com_installer') && $user->authorise('core.delete', 'com_installer')) { quickiconButton('index.php?option=com_installer&view=manage&filter_group=arkeditor', 'trash', JText::_('COM_ARKEDITOR_QUICKICON_UNINSTALL_NAME'), 'plugin'); } if (!$isIOS) { quickiconButton($base . $view . 'toolbars', 'menu-3', JText::_('COM_ARKEDITOR_QUICKICON_LAYOUT_NAME'), 'toolbars'); } $db = JFactory::getDBO(); $db->setQuery('SELECT extension_id FROM #__extensions WHERE type = "plugin" AND folder= "editors" AND element = "arkeditor"');
function __construct($default = array()) { parent::__construct($default); $this->canDo = ARKHelper::getActions(); }