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();
 }
 protected function addToolbar()
 {
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_ARKEDITOR_SUBMENU_LAYOUT_NAME'), 'layout.png');
     require_once JPATH_COMPONENT . DS . 'helper.php';
     $links = ARKHelper::getExternalLinks();
     if ($this->canDo->get('core.create')) {
         JToolBarHelper::addNew('toolbars.add');
     }
     if ($this->canDo->get('core.edit')) {
         JToolBarHelper::editList('toolbars.edit');
     }
     if ($this->canDo->get('core.create')) {
         JToolBarHelper::custom('toolbars.copy', 'copy', 'copy', JText::_('JLIB_HTML_BATCH_COPY'), true);
     }
     if ($this->canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'toolbars.remove');
     }
     if ($this->canDo->get('core.edit.state')) {
         JToolbarHelper::checkin('toolbars.checkin');
     }
     JToolBarHelper::help($this->app->input->get('view'), false, $links['ark-guide']);
     JHtmlSidebar::setAction('index.php?option=com_arkeditor&view=' . JFactory::getApplication()->input->get('view', 'toolbars'));
     ARKHelper::addSubmenu($this->app->input->get('view'));
     $this->sidebar = JHtmlSidebar::render();
 }
Exemple #3
0
 /**
  * constructor
  *
  * @access	protected
  * @param	string	The event handler
  */
 function __construct($eventHandlerName)
 {
     $eventListenerClassName = 'ARK' . JString::ucfirst($eventHandlerName) . 'ControllerListener';
     if (class_exists($eventListenerClassName)) {
         $this->_eventHandler = new $eventListenerClassName($this);
     } else {
         ARKHelper::error('No Event listener ' . $eventListenerClassName . ' class found.');
     }
 }
 function addItem($label = '', $type = 'ok')
 {
     $links = ARKHelper::getExternalLinks();
     $html = array();
     $html[] = '<td width="6%"><i class="icon-' . $type . '"></i></td>';
     $html[] = '<td width="44%" class="stat">';
     $html[] = '<span>' . $label . '</span>';
     $html[] = '<a href="' . $links['ark-pro'] . '" target="_blank">' . JText::_('COM_ARKEDITOR_PRO_MORE_NAME') . '</a>';
     $html[] = '</td>';
     return implode("\n", $html);
 }
 protected function getOptions()
 {
     $options = array();
     $items = ARKHelper::getEditorToolbars();
     // Build the field options.
     if (!empty($items)) {
         foreach ($items as $item) {
             $options[] = JHtml::_('select.option', $item, $item);
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
 protected function addToolbar()
 {
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_ARKEDITOR'), 'arkeditor');
     require_once JPATH_COMPONENT . DS . 'helper.php';
     $links = ARKHelper::getExternalLinks();
     // TODO: Plumb In
     // JToolbarHelper::custom( $links['ark-guide'], 'help', 'help', 'Help' );
     // JToolbarHelper::custom( $links['ark'], 'warning', 'warning', 'Report a Bug' );
     JToolBarHelper::help($this->app->input->get('view'), false, $links['ark-guide']);
     if ($this->canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_arkeditor');
     }
     ARKHelper::addSubmenu($this->app->input->get('view'));
     $this->sidebar = JHtmlSidebar::render();
 }
        ?>
"></span>
			<div><?php 
        echo $text;
        ?>
</div>
		</a>
		<?php 
    }
    echo '<div id="arkcpanel">';
    $base = 'index.php?option=com_arkeditor';
    $view = '&amp;view=';
    $task = '&amp;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&amp;view=manage&amp;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"');
    $result = $db->loadresult();
    if ($result) {
 function getToolbarList()
 {
     $rows = array();
     arkimport('helper');
     $toolbars = ARKHelper::getEditorToolbars();
     if (!empty($toolbars)) {
         foreach ($toolbars as $toolbar) {
             $row = new stdclass();
             $row->text = ucfirst($toolbar);
             $row->value = $toolbar;
             $rows[] = $row;
         }
     }
     return $rows;
 }
 function prepareForm(&$item)
 {
     if ($item->iscore) {
         @($data = file_get_contents(JPATH_COMPONENT . DS . 'editor' . DS . 'plugins' . DS . $item->name . '.xml'));
     } else {
         @($data = file_get_contents(JPATH_PLUGINS . DS . 'arkeditor' . DS . $item->name . DS . $item->name . '.xml'));
     }
     if ($data) {
         $data = preg_replace(array('/\\<params group="options">/i', '/\\<params>/i', '/\\<params(.*)\\<\\/params\\>/is'), array('<params name="advanced">', '<params name="basic">', '<config><fields name="params"><fieldset$1</fieldset></fields></config>'), $data);
         $data = str_replace(array('<install', '</install', '<params', '</params', '<param', '</param'), array('<form', '</form', '<fieldset', '</fieldset', '<field', '</field'), $data);
         // Re-style fields to J3.0
         // Can't just str_replace because fields might already have a class
         $xml = ARKHelper::getXML($data, false);
         $nodes = $xml->xpath('//field[@type="radio" or @type="resizeradio"]');
         foreach ($nodes as $node) {
             $radio = 'btn-group';
             $class = (string) $node->attributes()->class ? (string) $node->attributes()->class . chr(32) . $radio : $radio;
             if ($node->attributes()->class) {
                 $node->attributes()->class = $class;
             } else {
                 $node->addAttribute('class', $class);
             }
         }
         $data = $xml->asXML();
     } else {
         $data = '<install><form>dummy data</form></install>';
     }
     //end if
     ARKForm::addFieldPath(JPATH_COMPONENT . DS . 'models' . DS . 'fields');
     $form = ARKForm::getInstance('com_arkeditor.plugin', $data, array(), true, '//config');
     //load plugins language file
     $lang = JFactory::getLanguage();
     $lang->load('com_plugins', JPATH_ADMINISTRATOR, null, false, false);
     JPluginHelper::importPlugin('content');
     $dispatcher = JDispatcher::getInstance();
     // Trigger the form preparation event.
     $jpara = new JRegistry($item->params);
     $data = $jpara->toArray();
     $results = $dispatcher->trigger('onContentPrepareForm', array($form, $data));
     $form->bind($data);
     return $form;
 }
Exemple #10
0
 function onCancel($id)
 {
     if (!$id) {
         //nothing to do do so bail out
         return;
     }
     //Checkin extension plugin
     $row = JTable::getInstance('extension');
     $row->load(array('custom_data' => $id));
     if ($row->extension_id) {
         if (!$row->checkin()) {
             ARKHelper::error('Failed to check in in extension');
         }
     }
 }
 /**
  * Method to get the field options.
  *
  * @return  array  The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     // Initialize variables.
     $values = array();
     $this->_texts = array();
     if (empty($this->value)) {
         foreach ($this->element->children() as $option) {
             // Only add <option /> elements.
             if ($option->getName() != 'option') {
                 continue;
             }
             // Create a new option object based on the <option /> element.
             $tmp = JHtml::_('select.option', (string) $option, (string) $option, 'value', 'text', false);
             // Add the option object to the result set.
             $this->_texts[] = $tmp;
             $tmp = JHtml::_('select.option', (string) $option['value'], (string) $option['value'], 'value', 'text', false);
             // Add the option object to the result set.
             $values[] = $tmp;
         }
     } else {
         $name = (string) $this->element['name'];
         $plugin = ARKHelper::getTable('plugin');
         $cid = JRequest::getVar('cid', array(0));
         $plugin->load($cid[0]);
         $registry = new JRegistry($plugin->params);
         $texts = $registry->get($name . '_text');
         foreach ($this->value as $key => $value) {
             //lets split option into array of  text and value
             $text = $texts[$key];
             if (!$text) {
                 $text = $value;
             }
             $tmp = JHTML::_('select.option', $text, $text, 'value', 'text', false);
             // Add the option object to the result set.
             $this->_texts[] = $tmp;
             $tmp = JHTML::_('select.option', $value, $value, 'value', 'text', false);
             // Add the option object to the result set.
             $values[] = $tmp;
         }
     }
     reset($this->_texts);
     reset($values);
     return $values;
 }
Exemple #12
0
 function checkin()
 {
     // Check for request forgeries
     JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));
     if (!$this->canDo->get('core.edit.state')) {
         $this->setRedirect(JRoute::_('index.php?option=com_arkeditor&view=list', false), JText::_('COM_ARKEDITOR_PLUGIN_PERM_NO_CHECK'), 'error');
         return false;
     }
     //end if
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $cid = JRequest::getVar('cid', array(0), 'post', 'array');
     $sql = $db->getQuery(true);
     JArrayHelper::toInteger($cid, array(0));
     if (count($cid) < 1) {
         ARKHelper::error(JText::_('COM_ARKEDITOR_PLUGIN_NO_CHECKIN'));
     }
     //end if
     $cids = implode(',', $cid);
     $sql->update('#__ark_editor_plugins')->set(array('checked_out = 0', 'checked_out_time = ' . $db->quote($db->getNullDate())))->where('id IN ( ' . $cids . ' )')->where('checked_out = ' . (int) $user->get('id'));
     $db->setQuery($sql);
     if (!$db->query()) {
         ARKHelper::error($db->getErrorMsg());
     }
     //end if
     $this->event_args = array('cid' => $cid, 'value' => true);
     $plural = count($cid) > 1 ? '(s)' : '';
     ARKHelper::error(JText::sprintf('COM_ARKEDITOR_PLUGIN_CHECKIN', (int) count($cid), $plural), 'message');
     $this->setRedirect(JRoute::_('index.php?option=com_arkeditor&view=list', false));
 }
 protected function addToolbar()
 {
     $this->app->input->set('hidemainmenu', true);
     $bar = JToolBar::getInstance('toolbar');
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $this->user->get('id'));
     JToolBarHelper::title(JText::_('COM_ARKEDITOR_SUBMENU_LAYOUT_NAME') . ':' . chr(32) . JText::_($this->item->name), 'list-view');
     if ($this->canDo->get('core.create') && !$checkedOut) {
         JToolBarHelper::apply('toolbars.apply');
         JToolBarHelper::save('toolbars.save');
     }
     //end if
     JToolBarHelper::cancel('toolbars.cancel', 'JTOOLBAR_CLOSE');
     ARKHelper::addSubmenu($this->app->input->get('view'));
     $this->sidebar = JHtmlSidebar::render();
 }
Exemple #14
0
									</div>

									<div class="cke_bot" >&nbsp;</div>

									</fieldset>
									<fieldset>
									<legend><?php 
    echo JText::_('COM_ARKEDITOR_LAYOUT_MANAGER_LAYOUT_TOOLBAR_AVAILABLE_BUTTONS');
    ?>
</legend>

									<div class="cke_top" >&nbsp;</div>

									<div class="sortableList" style="position: relative">
									<?php 
    $max = ARKHelper::getNextAvailablePluginRowId() + 1;
    for ($i = 1; $i <= $max; $i++) {
        ?>
										<div class="sortableListDiv">
											<span class="sortableListSpan">
											<ul class="sortableRow">
									   <?php 
        if ($i == $max) {
            for ($x = 1; $x <= 20; $x++) {
                ?>
													<li class="sortableItem spacer" id="icon0"><img src="<?php 
                echo ARKEDITOR_COMPONENT;
                ?>
/icons/spacer.png" alt="<?php 
                echo JText::_('Spacer');
                ?>
Exemple #15
0
 function remove()
 {
     // Check for request forgeries
     JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));
     if (!$this->canDo->get('core.delete')) {
         $this->setRedirect(JRoute::_('index.php?option=com_arkeditor&view=toolbars', false), JText::_('COM_ARKEDITOR_PLUGIN_PERM_NO_SAVE'), 'error');
         return false;
     }
     $db = JFactory::getDBO();
     $app = JFactory::getApplication();
     $cid = $app->input->get('cid', array(0), 'array');
     JArrayHelper::toInteger($cid, array(0));
     if (count($cid) < 1) {
         ARKHelper::error(JText::_('JWARNING_DELETE_MUST_SELECT'));
     }
     if (empty($cid)) {
         return ARKHelper::error(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
     }
     $cids = implode(',', $cid);
     $editor = JPluginHelper::getPlugin('editors', 'arkeditor');
     $params = new JRegistry($editor->params);
     $defaults = array(strtolower($params->get('toolbar', 'back')), strtolower($params->get('toolbar_ft', 'front')));
     $sql = $db->getQuery(true);
     $sql->select('count(1)')->from('#__ark_editor_toolbars')->where('id IN (' . $cids . ')')->where('LOWER(name)  IN (' . $db->quote(implode($db->quote(','), $defaults)) . ')');
     $total = $db->setQuery($sql)->loadResult();
     if ($msg = $db->getErrorMsg()) {
         return ARKHelper::error($msg);
     }
     if ($total > 0) {
         $this->setRedirect('index.php?option=com_arkeditor&view=toolbars');
         return ARKHelper::error(JText::_('COM_ARKEDITOR_TOOLBAR_NO_DEL_DEFAULT'));
     }
     $sql = $db->getQuery(true);
     $sql->select('count(1)')->from('#__ark_editor_toolbars')->where('id IN (' . $cids . ')')->where('iscore = 1');
     $total = $db->setQuery($sql)->loadResult();
     if ($msg = $db->getErrorMsg()) {
         return ARKHelper::error($msg);
     }
     if ($total > 0) {
         $this->setRedirect('index.php?option=com_arkeditor&view=toolbars');
         return ARKHelper::error(JText::_('COM_ARKEDITOR_TOOLBAR_NO_DEL_CORE'));
     }
     $sql = $db->getQuery(true);
     $sql->select('name')->from('#__ark_editor_toolbars')->where('id IN (' . $cids . ')');
     $rows = $db->setQuery($sql)->loadColumn();
     if (!$db->query()) {
         return ARKHelper::error($db->getErrorMsg());
     }
     $this->event_args = array('names' => $rows);
     //delete toolbars
     $sql = $db->getQuery(true);
     $sql->delete('#__ark_editor_toolbars')->where('id IN (' . $cids . ')');
     $db->setQuery($sql);
     if (!$db->query()) {
         ARKHelper::error($db->getErrorMsg());
     }
     $msg = JText::sprintf('COM_ARKEDITOR_TOOLBAR_DELETE', implode(',', $rows));
     $this->setRedirect('index.php?option=com_arkeditor&view=toolbars', $msg);
 }
Exemple #16
0
?>
	});
</script>
<form action="<?php 
echo JRoute::_('index.php?option=com_arkeditor&task=list.edit&cid=' . (int) $this->item->id);
?>
" method="post" name="adminForm" id="style-form" class="form-validate form-horizontal">
<?php 
if (!empty($this->sidebar)) {
    ?>
	<div id="sidebar-container" class="span2">
		<?php 
    echo $this->sidebar;
    ?>
		<?php 
    ARKHelper::fixBug();
    ?>
	</div>
	<div id="main-container" class="span10">
<?php 
} else {
    ?>
	<div id="main-container">
<?php 
}
?>
		<fieldset class="adminform">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#details" data-toggle="tab"><?php 
echo JText::_('JDETAILS');
?>
Exemple #17
0
 function getSelectedToolbarList()
 {
     $rows = array();
     arkimport('helper');
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     JArrayHelper::toInteger($cid, array(0));
     $db = JFactory::getDBO();
     $sql = $db->getQuery(true);
     $sql->select('title')->from('#__ark_editor_plugins')->where('id = ' . $cid[0]);
     $title = $db->setQuery($sql)->loadResult();
     if (!!$title && !is_string($title)) {
         ARKHelper::error($db->getErrorMsg());
     }
     $config = ARKHelper::getEditorPluginConfig();
     $toolbars = $config->get('toolbars');
     foreach ($toolbars as $key => $toolbar) {
         if (ARKHelper::in_array($title, $toolbar)) {
             $row = new stdclass();
             $row->text = ucfirst($key);
             $row->value = $key;
             $rows[] = $row;
         }
     }
     return $rows;
 }
Exemple #18
0
 protected static function &_load()
 {
     static $clean;
     if (isset($clean)) {
         return $clean;
     }
     $Itemid = JRequest::getInt('Itemid');
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $groups = implode(',', $user->getAuthorisedViewLevels());
     $lang = JFactory::getLanguage()->getTag();
     $clientId = (int) $app->getClientId();
     $cache = JFactory::getCache('com_modules', '');
     $cacheid = md5(serialize(array('com_arkeditor', $groups, $clientId, $lang)));
     if (!($clean = $cache->get($cacheid))) {
         $db = JFactory::getDbo();
         $excludes = array('-1');
         $sql = $db->getQuery(true);
         $sql->select('count(1)');
         $sql->from('#__modules');
         $sql->where('module = ' . $db->Quote('mod_inlinecustom'));
         $db->setQuery($sql);
         $moduleExist = $db->loadResult();
         if ($moduleExist) {
             $excludes[] = 'mod_arkpro';
         } else {
             $excludes[] = 'mod_arktip';
         }
         $query = $db->getQuery(true);
         //new JDatabaseQuery;
         $query->select('id, title, module, position, content, showtitle, params, mm.menuid');
         $query->from('#__modules AS m');
         $query->join('LEFT', '#__modules_menu AS mm ON mm.moduleid = m.id');
         $query->where('m.published = 1');
         $date = JFactory::getDate();
         $now = $date->toSQL();
         $nullDate = $db->getNullDate();
         $query->where('(m.publish_up = ' . $db->Quote($nullDate) . ' OR m.publish_up <= ' . $db->Quote($now) . ')');
         $query->where('(m.publish_down = ' . $db->Quote($nullDate) . ' OR m.publish_down >= ' . $db->Quote($now) . ')');
         $query->where('m.access IN (' . $groups . ')');
         $query->where('m.client_id = ' . $clientId);
         $query->where('(mm.menuid = ' . (int) $Itemid . ' OR (mm.menuid <= 0 OR mm.menuid IS NULL))');
         //fix as this is suppose to be a LEFT JOIN!!!
         // Filter by language
         if ($app->isSite() && $app->getLanguageFilter()) {
             $query->where('m.language IN (' . $db->Quote($lang) . ',' . $db->Quote('*') . ')');
         }
         $query->where('m.module NOT IN(' . $db->Quote(implode($db->Quote(','), $excludes), false) . ')');
         $query->order('position, ordering');
         // Set the query
         $db->setQuery($query);
         if (!($modules = $db->loadObjectList())) {
             ARKHelper::error(JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $db->getErrorMsg()));
             return false;
         }
         // Apply negative selections and eliminate duplicates
         $negId = $Itemid ? -(int) $Itemid : false;
         $dupes = array();
         $clean = array();
         for ($i = 0, $n = count($modules); $i < $n; $i++) {
             $module =& $modules[$i];
             // The module is excluded if there is an explicit prohibition, or if
             // the Itemid is missing or zero and the module is in exclude mode.
             $negHit = $negId === (int) $module->menuid || !$negId && (int) $module->menuid < 0;
             if (isset($dupes[$module->id])) {
                 // If this item has been excluded, keep the duplicate flag set,
                 // but remove any item from the cleaned array.
                 if ($negHit) {
                     unset($clean[$module->id]);
                 }
                 continue;
             }
             $dupes[$module->id] = true;
             // Only accept modules without explicit exclusions.
             if (!$negHit) {
                 //determine if this is a custom module
                 $file = $module->module;
                 $custom = substr($file, 0, 4) == 'mod_' ? 0 : 1;
                 $module->user = $custom;
                 // Custom module name is given by the title field, otherwise strip off "com_"
                 $module->name = $custom ? $module->title : substr($file, 4);
                 $module->style = null;
                 $module->position = strtolower($module->position);
                 $clean[$module->id] = $module;
             }
         }
         unset($dupes);
         // Return to simple indexing that matches the query order.
         $clean = array_values($clean);
         $cache->store($clean, $cacheid);
     }
     return $clean;
 }
Exemple #19
0
 public function onInstanceCreated(&$params)
 {
     $user = JFactory::getUser();
     if ($user->authorise('core.admin')) {
         return;
     }
     $query = $this->db->getQuery(true);
     $query->select('parentid,id,name,acl')->from('#__ark_editor_plugins')->where('published = 1');
     $this->db->setQuery($query);
     $plugins = $this->db->loadObjectList();
     if (!is_array($plugins)) {
         ARKHelper::error($this->db->getErrorMsg());
     }
     if (empty($plugins)) {
         return;
     }
     $groups = $user->getAuthorisedGroups();
     $js = '';
     $deniedPlugins = array();
     $removePlugins = array();
     foreach ($plugins as $plugin) {
         if (is_null($plugin->acl)) {
             continue;
         }
         $acl = json_decode($plugin->acl);
         $allow = true;
         if (empty($acl)) {
             $allow = false;
             $deniedPlugins[] = $plugin->id;
             $removePlugins[] = $plugin->name;
         } else {
             if ($groups) {
                 $allow = false;
                 for ($n = 0, $i = count($groups); $n < $i; $n++) {
                     if (in_array($groups[$n], $acl)) {
                         $allow = true;
                         break;
                     }
                     //end if
                 }
                 //end for loop
                 if (!$allow) {
                     $deniedPlugins[] = $plugin->id;
                     $removePlugins[] = $plugin->name;
                 }
             }
             //end if
             // check to see if parent plugin access view level is denied. If is then parent settings override
             if ($allow && in_array($plugin->parentid, $deniedPlugins)) {
                 $deniedPlugins[] = $plugin->id;
                 $removePlugins[] = $plugin->name;
             }
         }
     }
     if (empty($removePlugins)) {
         return;
     }
     $plugs = implode(',', $removePlugins);
     if ($plugs) {
         return "\r\n\t\t\t\t\r\n\t\t\t\teditor.on( 'configLoaded', function()\r\n\t\t\t\t{\r\n\t\t\t\t\tif(editor.config.removePlugins) \r\n\t\t\t\t\t\teditor.config.removePlugins += '," . $plugs . "';\r\n\t\t\t\t\telse \t\r\n\t\t\t\t\t\teditor.config.removePlugins += '" . $plugs . "';\r\n\t\t\t\t});";
     }
     return null;
 }
Exemple #20
0
 function __construct(&$subject)
 {
     parent::__construct($subject);
     $this->canDo = ARKHelper::getActions();
     $this->app = JFactory::getApplication();
 }
Exemple #21
0
 function __construct($default = array())
 {
     parent::__construct($default);
     $this->canDo = ARKHelper::getActions();
 }
# @license - GPLv2.0
# Author: WebxSolution Ltd
# Websites:  http://webx.solutions
# Terms of Use: An extension that is derived from the Ark Editor will only be allowed under the following conditions: http://arkextensions.com/terms-of-use
# ------------------------------------------------------------------------*/
defined('_JEXEC') or die;
// NOTE - For Non-Ajax Version Call Model Directly (See: administrator/components/com_installer/controllers/update.php)
if (!defined('_ARK_UPDATE_MODULE')) {
    /** ensure that functions are declared only once */
    define('_ARK_UPDATE_MODULE', 1);
    require_once JPATH_COMPONENT . DS . 'helper.php';
    JHtml::_('jquery.framework');
    $app = JFactory::getApplication();
    $doc = JFactory::getDocument();
    $eid = ARKHelper::getEID();
    $links = ARKHelper::getExternalLinks();
    $names = (object) array('root' => 'box-arkupdate', 'version' => 'version');
    $root = 'box-arkupdate';
    echo '<div id="arkupdate">';
    echo '<table class="table table-striped">';
    echo '<tr>';
    echo '<td class="muted ' . $names->version . '">' . JText::_('COM_ARKEDITOR_UPDATE_INTRO_NAME') . '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td class="buttoncol">';
    echo '<a class="btn btn-success pull-right" href="' . $links['joomla-update'] . '">' . JText::_('COM_ARKEDITOR_UPDATE_UPDATE_NAME') . '</a>';
    echo '<a class="btn btn-info pull-right" href="' . $links['ark-update'] . '" target="_blank">' . JText::_('COM_ARKEDITOR_UPDATE_MANUAL_NAME') . '</a>';
    echo '</td>';
    echo '</tr>';
    echo '</table>';
    echo '</div>';
 /**
  * Handles an XML parsing error
  *
  * @param   integer  $code  XML Error Code.
  * @param   integer  $line  Line on which the error happened.
  * @param   integer  $col   Column on which the error happened.
  *
  * @return  void
  *
  * @deprecated  12.1
  * @since   11.1
  *
  * @deprecated   12.1   Use PHP Exception
  */
 protected function _handleError($code, $line, $col)
 {
     ARKHelper::error('XML Parsing Error at ' . $line . ':' . $col . '. Error ' . $code . ': ' . xml_error_string($code));
 }
Exemple #24
0
 function update($parent)
 {
     $this->install($parent);
     $db = JFactory::getDBO();
     $dbserver = 'sqlsrv';
     switch (strtolower($db->name)) {
         case 'mysql':
         case 'mysqli':
             $dbserver = 'mysql';
             break;
         case 'postgresql':
             $dbserver = 'postgres';
             break;
     }
     if (method_exists($parent, 'extension_root')) {
         $sqlfile = $parent->getPath('extension_root') . DS . 'sql' . DS . $dbserver . '.sql';
     } else {
         $sqlfile = $parent->getParent()->getPath('extension_root') . DS . 'sql' . DS . $dbserver . '.sql';
     }
     // Don't modify below this line
     $buffer = file_get_contents($sqlfile);
     if ($buffer !== false) {
         jimport('joomla.installer.helper');
         $queries = JInstallerHelper::splitSql($buffer);
         if (count($queries) != 0) {
             foreach ($queries as $query) {
                 $query = trim($query);
                 if ($query != '' && $query[0] != '#') {
                     $db->setQuery($query);
                     if (!$db->query()) {
                         if (!class_exists('ARKHelper')) {
                             require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helper.php';
                         }
                         ARKHelper::error(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)));
                         return false;
                     }
                 }
             }
         }
     }
 }
         $statistic = '<p class="' . $colour . '"><strong>' . $stat . '</strong></p>';
     }
     //end if
     if ($link && $label) {
         $base = 'index.php?option=com_arkeditor&view=';
         $label = '<a href="' . $base . $link . '">' . $label . '</a>';
         $statistic = '<a href="' . $base . $link . '" class="badge-link">' . $statistic . '</a>';
     }
     //end if
     // RENDER STAT
     echo '<td>' . $label . '</td>';
     echo '<td>' . $statistic . '</td>';
 }
 $config = ARKHelper::getEditorPluginConfig();
 $toolbars = ARKHelper::getEditorToolbars(true);
 $plugins = ARKHelper::getEditorPlugins(true);
 $toolbars_core = JArrayHelper::getColumn($toolbars, 'iscore');
 $plugins_core = JArrayHelper::getColumn($plugins, 'iscore');
 $plugins_state = JArrayHelper::getColumn($plugins, 'published');
 echo '<div id="arkstats">';
 echo '<table class="table table-striped">';
 echo '<tr>';
 addStatistic(JText::_('COM_ARKEDITOR_STATISTIC_ALLTOOLBARS_NAME'), count($toolbars), 'info');
 addStatistic(JText::_('COM_ARKEDITOR_STATISTIC_ALLPLUGINS_NAME'), count($plugins), 'info', 'list&filter_state=*&filter_iscore=*');
 echo '</tr>';
 echo '<tr>';
 addStatistic(JText::_('COM_ARKEDITOR_STATISTIC_CORETOOLBARS_NAME'), count(array_keys($toolbars_core, 1)), 'inverse');
 addStatistic(JText::_('COM_ARKEDITOR_STATISTIC_COREPLUGINS_NAME'), count(array_keys($plugins_core, 1)), 'inverse', 'list&filter_state=*&filter_iscore=1');
 echo '</tr>';
 echo '<tr>';
 addStatistic(JText::_('COM_ARKEDITOR_STATISTIC_NONCORETOOLBARS_NAME'), count(array_keys($toolbars_core, 0)));