Beispiel #1
2
 /**
  * Setup the Toolbar.
  */
 protected function _setToolbar()
 {
     $state = $this->get('State');
     $canDo = TemplatesHelper::getActions();
     $isSite = $state->get('filter.client_id') == 0;
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('style.edit');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::custom('styles.sethome', 'default.png', 'default_f2.png', 'Templates_Toolbar_Set_Home', true);
     }
     JToolBarHelper::title(JText::_('Templates_Manager_Styles'), 'thememanager');
     if ($canDo->get('core.create') && $isSite) {
         JToolBarHelper::addNew('styles.duplicate', 'Templates_Toolbar_Save_Copy');
     }
     if ($canDo->get('core.delete') && $isSite) {
         JToolBarHelper::deleteList('', 'styles.delete');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_templates');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.templates');
 }
Beispiel #2
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title($isNew ? JText::_('COM_TEMPLATES_MANAGER_ADD_STYLE') : JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('style.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     // Get the help information for the template item.
     $lang = JFactory::getLanguage();
     $help = $this->get('Help');
     if ($lang->hasKey($help->url)) {
         $debug = $lang->setDebug(false);
         $url = JText::_($help->url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     JToolBarHelper::help($help->key, false, $url);
 }
Beispiel #3
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = TemplatesHelper::getActions();
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'thememanager');
     if ($canDo->get('core.edit.state')) {
         JToolbarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.edit')) {
         JToolbarHelper::editList('style.edit');
     }
     if ($canDo->get('core.create')) {
         JToolbarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'styles.delete');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_templates');
         JToolbarHelper::divider();
     }
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
     JHtmlSidebar::setAction('index.php?option=com_templates&view=styles');
     JHtmlSidebar::addFilter(JText::_('COM_TEMPLATES_FILTER_TEMPLATE'), 'filter_template', JHtml::_('select.options', TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.template')));
     JHtmlSidebar::addFilter(JText::_('JGLOBAL_FILTER_CLIENT'), 'filter_client_id', JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')));
 }
Beispiel #4
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = TemplatesHelper::getActions();
     $isSite = $state->get('filter.client_id') == 0;
     JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'thememanager');
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('style.edit');
     }
     if ($canDo->get('core.create')) {
         JToolBarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'styles.delete');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_templates');
         JToolBarHelper::divider();
     }
     JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
 }
Beispiel #5
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     Request::setVar('hidemainmenu', true);
     $isNew = $this->item->id == 0;
     $canDo = TemplatesHelper::getActions();
     Toolbar::title($isNew ? Lang::txt('COM_TEMPLATES_MANAGER_ADD_STYLE') : Lang::txt('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         Toolbar::apply('style.apply');
         Toolbar::save('style.save');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         Toolbar::save2copy('style.save2copy');
     }
     if (empty($this->item->id)) {
         Toolbar::cancel('style.cancel');
     } else {
         Toolbar::cancel('style.cancel', 'JTOOLBAR_CLOSE');
     }
     Toolbar::divider();
     // Get the help information for the template item.
     $lang = Lang::getRoot();
     $help = $this->get('Help');
     if ($lang->hasKey($help->url)) {
         $debug = $lang->setDebug(false);
         $url = Lang::txt($help->url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     Toolbar::help('style');
     //$help->key, false, $url);
 }
Beispiel #6
0
 /**
  * Setup the Toolbar
  *
  * @since	1.6
  */
 protected function _setToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title($isNew ? JText::_('Templates_Manager_Add_Style') : JText::_('Templates_Manager_Edit_Style'));
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('style.apply');
         JToolBarHelper::save('style.save');
         JToolBarHelper::addNew('style.save2new', 'JToolbar_Save_and_new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('style.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JToolbar_Save_as_Copy', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('style.cancel');
     } else {
         JToolBarHelper::cancel('style.cancel', 'JToolbar_Close');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.style.edit');
 }
Beispiel #7
0
 /**
  * Setup the Toolbar
  */
 protected function _setToolbar()
 {
     $user = JFactory::getUser();
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title(JText::_('Templates_Manager_View_Template'), 'thememanager');
     JToolBarHelper::cancel('template.cancel', 'JToolbar_Close');
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.template.view');
 }
Beispiel #8
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     Request::setVar('hidemainmenu', true);
     $canDo = TemplatesHelper::getActions();
     Toolbar::title(Lang::txt('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'thememanager');
     Toolbar::cancel('template.cancel', 'JTOOLBAR_CLOSE');
     Toolbar::divider();
     Toolbar::help('template');
 }
Beispiel #9
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'thememanager');
     JToolBarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
 }
Beispiel #10
0
 /**
  * Add the page title and toolbar.
  *
  * @return	void
  * @since	1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = TemplatesHelper::getActions();
     Toolbar::title(Lang::txt('COM_TEMPLATES_MANAGER_TEMPLATES'), 'thememanager');
     if ($canDo->get('core.admin')) {
         Toolbar::preferences('com_templates');
         Toolbar::divider();
     }
     Toolbar::help('templates');
 }
Beispiel #11
0
 /**
  * Add the page title and toolbar.
  *
  * @return	void
  * @since	1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_TEMPLATES'), 'thememanager');
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_templates');
         JToolBarHelper::divider();
     }
     JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES');
 }
Beispiel #12
0
 /**
  * Setup the Toolbar.
  */
 protected function _setToolbar()
 {
     $state = $this->get('State');
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title(JText::_('Templates_Manager_Templates'), 'thememanager');
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_templates');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.templates');
 }
Beispiel #13
0
 /**
  * Add the page title and toolbar.
  *
  * @return  void
  * @since   1.6
  */
 protected function addToolbar()
 {
     $canDo = TemplatesHelper::getActions();
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_TEMPLATES'), 'thememanager');
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_templates');
         JToolbarHelper::divider();
     }
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES');
     JHtmlSidebar::setAction('index.php?option=com_templates&view=templates');
     JHtmlSidebar::addFilter(JText::_('JGLOBAL_FILTER_CLIENT'), 'filter_client_id', JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')));
     $this->sidebar = JHtmlSidebar::render();
 }
Beispiel #14
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $canDo = TemplatesHelper::getActions();
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_EDIT_FILE'), 'thememanager');
     // Can save the item.
     if ($canDo->get('core.edit')) {
         JToolbarHelper::apply('source.apply');
         JToolbarHelper::save('source.save');
     }
     JToolbarHelper::cancel('source.cancel');
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT_SOURCE');
 }
Beispiel #15
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     Request::setVar('hidemainmenu', true);
     $canDo = TemplatesHelper::getActions();
     Toolbar::title(Lang::txt('COM_TEMPLATES_MANAGER_EDIT_FILE'), 'thememanager');
     // Can save the item.
     if ($canDo->get('core.edit')) {
         Toolbar::apply('source.apply');
         Toolbar::save('source.save');
     }
     Toolbar::cancel('source.cancel');
     Toolbar::divider();
     Toolbar::help('source');
 }
Beispiel #16
0
 /**
  * Setup the Toolbar
  */
 protected function _setToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title(JText::_('Templates_Manager_Edit_file'));
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('source.apply');
         JToolBarHelper::save('source.save');
     }
     JToolBarHelper::cancel('source.cancel');
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.source.edit');
 }
Beispiel #17
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $canDo = TemplatesHelper::getActions();
     JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_EDIT_FILE'), 'thememanager');
     // Can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('source.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('source.save', 'JTOOLBAR_SAVE');
     }
     JToolBarHelper::cancel('source.cancel', 'JTOOLBAR_CANCEL');
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT_SOURCE');
 }
Beispiel #18
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     $user = JFactory::getUser();
     $canDo = TemplatesHelper::getActions();
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'thememanager');
     JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
     // Add a copy button
     if ($user->authorise('core.create', 'com_templates')) {
         $title = JText::_('JLIB_HTML_BATCH_COPY');
         $dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-copy\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
         $bar->appendButton('Custom', $dhtml, 'upload');
     }
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
 }
 public function display($tpl = null)
 {
     $JSNMedia = JSNFactory::getMedia();
     $JSNMedia->addStyleSheet(JSN_POWERADMIN_STYLE_URI . 'styles.css');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.mousecheck.js");
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.submenu.js");
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.manage-styles.js");
     $JSNMedia->addStyleDeclaration("\n\t\t.template-item {\n\t\t\tbackground: url(" . JSN_POWERADMIN_IMAGES_URI . "icons-24/icon-24-loading-circle.gif) no-repeat center center;\n\t\t}\n\t\t.loading {\n\t\t\tbackground: url(" . JSN_POWERADMIN_IMAGES_URI . "icons-16/icon-16-loading-circle.gif) no-repeat center right;\n\t\t}\n\t\t");
     $JSNMedia->addScriptDeclaration("\n            (function (\$){\n               \$(document).ready(function (){\n                    \$('#client-switch').change(function (e) {\n                        var val =\$(this).attr('value');\n                        if(val == 0){\n                            \$('.template-list').hide();\n                            \$('#site').show();\n                        }else{\n                            \$('.template-list').hide();\n                            \$('#admin').show();\n                        }\n                    })\n\t           });\n            })(JoomlaShine.jQuery);\n        ");
     // Add javascript lang translation
     $jsnLang = new JSNJavascriptLanguages();
     $jsnLang->addLang('JSN_POWERADMIN_TM_MAKE_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE');
     $jsnLang->addLang('JSN_POWERADMIN_TM_MAKE_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CLOSE_BEFORE_DELETE');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CLOSE_BEFORE_UNINSTALL');
     $jsnLang->addLang('JSN_POWERADMIN_TM_ALREADY_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CANNOT_DELETE_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CANNOT_UNINSTALL_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_DELETE_STYLE_CONFIRM');
     $jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE_CONFIRM');
     $JSNMedia->addScriptDeclaration($jsnLang->loadLang());
     $model = $this->getModel('templates');
     $rows = $model->getTemplates();
     $adminRows = $model->getTemplates(1);
     // Check permission for removing styles.
     JSNFactory::import('components.com_templates.helpers.templates');
     $canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_templates') : TemplatesHelper::getActions();
     $canDelete = $canDo->get('core.delete');
     $canDelete = '<input type="hidden" id="candelete" value="' . $canDelete . '"></input>';
     echo $canDelete;
     // Check permission for uninstalling template.
     JSNFactory::import('components.com_installer.helpers.installer');
     $canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_installer') : TemplatesHelper::getActions();
     $canUninstall = $canDo->get('core.delete');
     $canUninstall = '<input type="hidden" id="canuninstall" value="' . $canUninstall . '"></input>';
     echo $canUninstall;
     //assign to view
     $this->assign('templates', $rows);
     $this->assign('adminTemplates', $adminRows);
     $this->assign('canDelete', $canDelete);
     return parent::display();
 }
 function delete()
 {
     JSNFactory::import('components.com_templates.helpers.templates');
     $canDo = TemplatesHelper::getActions();
     if (!$canDo->get('core.delete')) {
         $response = array('isDeleted' => false);
         echo json_encode($response);
         jexit();
     }
     $id = JRequest::getVar('id', array(), 'GET', 'array');
     JSNFactory::import('components.com_templates.models.style');
     JSNFactory::import('components.com_templates.tables.style');
     JFactory::getLanguage()->load('com_templates');
     $model = $this->getModel('Style', 'TemplatesModel', array('ignore_request' => true));
     $model->delete($id);
     $isDeleted = $this->isDeleted($id[0]);
     $response = array('isDeleted' => $isDeleted, 'message' => $model->getError());
     echo json_encode($response);
     jexit();
 }
Beispiel #21
0
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_templates
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();
$canDo = TemplatesHelper::getActions();
?>
<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'style.cancel' || document.formvalidator.isValid(document.id('style-form'))) {
			Joomla.submitform(task, document.getElementById('style-form'));
		}
	}
</script>

<form action="<?php 
echo JRoute::_('index.php?option=com_templates&layout=edit&id=' . (int) $this->item->id);
?>
" method="post" name="adminForm" id="style-form" class="form-validate">
	<div class="width-60 fltlft">
Beispiel #22
0
/*
 * ------------------------------------------------------------------------
 * Copyright (C) 2009 - 2013 The YouTech JSC. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: The YouTech JSC
 * Websites: http://www.smartaddons.com - http://www.cmsportal.net
 * ------------------------------------------------------------------------
*/
// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();
$canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_templates') : TemplatesHelper::getActions();
// Form template
$form = JForm::getInstance('com_templates.style', 'style', array('control' => 'jform', 'load_data' => true));
// Get cookie of backend tab param
$tabcookie = isset($_COOKIE[$this->nameOfSJTemplate() . '_backend_tab']) && $_COOKIE[$this->nameOfSJTemplate() . '_backend_tab'] != "" ? $_COOKIE[$this->nameOfSJTemplate() . '_backend_tab'] : 'overview';
?>
<div class="yt-templatebackend yt-jv<?php 
echo J_VERSION;
?>
">
    <form action="<?php 
echo JRoute::_('index.php?option=com_templates&layout=edit&id=' . JRequest::getInt('id'));
?>
" method="post" name="adminForm" id="style-form" class="form-validate">
		
    	<div class="yt-nav-template clearfix">
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  *
  * @return  void
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $canDo = TemplatesHelper::getActions();
     if ($canDo->get('core.edit') && $canDo->get('core.create') && $canDo->get('core.admin')) {
         $showButton = true;
     } else {
         $showButton = false;
     }
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     $explodeArray = explode('.', $this->fileName);
     $ext = end($explodeArray);
     JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'eye thememanager');
     // Add a Apply and save button
     if ($this->type == 'file') {
         if ($showButton) {
             JToolbarHelper::apply('template.apply');
             JToolbarHelper::save('template.save');
         }
     } elseif ($this->type == 'image') {
         if ($showButton) {
             JToolbarHelper::custom('template.cropImage', 'move', 'move', 'COM_TEMPLATES_BUTTON_CROP', false, false);
             JToolbarHelper::modal('resizeModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RESIZE');
         }
     } elseif ($this->type == 'archive') {
         if ($showButton) {
             JToolbarHelper::custom('template.extractArchive', 'arrow-down', 'arrow-down', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', false, false);
         }
     }
     // Add a copy template button
     if ($this->hathor->home == 0) {
         if ($showButton) {
             JToolbarHelper::modal('collapseModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
         }
     }
     // Add a Template preview button
     if ($this->preview->client_id == 0) {
         $bar->appendButton('Link', 'picture', 'COM_TEMPLATES_BUTTON_PREVIEW', JUri::root() . 'index.php?tp=1&templateStyle=' . $this->preview->id);
     }
     // Add Manage folders button
     if ($showButton) {
         JToolbarHelper::modal('folderModal', 'icon-folder icon white', 'COM_TEMPLATES_BUTTON_FOLDERS');
     }
     // Add a new file button
     if ($showButton) {
         JToolbarHelper::modal('fileModal', 'icon-file', 'COM_TEMPLATES_BUTTON_FILE');
     }
     // Add a Rename file Button
     if ($this->hathor->home == 0) {
         if ($showButton && $this->type != 'home') {
             JToolbarHelper::modal('renameModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RENAME_FILE');
         }
     }
     // Add a Delete file Button
     if ($showButton && $this->type != 'home') {
         JToolbarHelper::modal('deleteModal', 'icon-remove', 'COM_TEMPLATES_BUTTON_DELETE_FILE');
     }
     // Add a Compile Button
     if ($showButton) {
         if ($ext == 'less') {
             JToolbarHelper::custom('template.less', 'play', 'play', 'COM_TEMPLATES_BUTTON_LESS', false, false);
         }
     }
     if ($this->type == 'home') {
         JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
     } else {
         JToolbarHelper::cancel('template.close', 'COM_TEMPLATES_BUTTON_CLOSE_FILE');
     }
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
 }
Beispiel #24
0
 * @package       CANVAS Framework for Joomla!
 *------------------------------------------------------------------------------
 * @copyright     Copyright (C) 2004-2013 ThemezArt.com. All Rights Reserved.
 * @license       GNU General Public License version 2 or later; see LICENSE.txt
 * @authors       ThemezArt
 *                & t3-framework.org as base version
 * @Link:         http://themezart.com/canvas-framework 
 *------------------------------------------------------------------------------
 */
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();
$canDo = method_exists('TemplatesHelper', 'getActions') ? TemplatesHelper::getActions() : JHelperContent::getActions('com_templates');
$iswritable = is_writable('canvastest.txt');
if ($iswritable) {
    ?>
<div id="canvas-admin-writable-message" class="alert warning">
	<button type="button" class="close" data-dismiss="alert">×</button>
	<strong><?php 
    echo JText::_('CANVAS_MSG_WARNING');
    ?>
</strong> <?php 
    echo JText::_('CANVAS_MSG_FILE_NOT_WRITABLE');
    ?>
</div>
<?php 
}
?>