You've already forked joomla_test
first commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
111
administrator/components/com_templates/views/style/tmpl/edit.php
Normal file
111
administrator/components/com_templates/views/style/tmpl/edit.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 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.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 form-horizontal">
|
||||
<fieldset>
|
||||
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'details')); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'details', JText::_('JDETAILS', true)); ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('title'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('title'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('template'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('template'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('client_id'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('client_id'); ?>
|
||||
<input type="text" size="35" value="<?php echo $this->item->client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> " class="readonly" readonly="readonly" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('home'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('home'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($this->item->id) : ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('id'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<span class="disabled"><?php echo $this->item->id; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->item->xml) : ?>
|
||||
<?php if ($text = trim($this->item->xml->description)) : ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">
|
||||
<?php echo JText::_('COM_TEMPLATES_TEMPLATE_DESCRIPTION'); ?>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<span class="disabled"><?php echo JText::_($text); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<div class="alert alert-error"><?php echo JText::_('COM_TEMPLATES_ERR_XML'); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'options', JText::_('JOPTIONS', true)); ?>
|
||||
<?php //get the menu parameters that are automatically set but may be modified.
|
||||
echo $this->loadTemplate('options'); ?>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
|
||||
<?php if ($user->authorise('core.edit', 'com_menu') && $this->item->client_id == 0):?>
|
||||
<?php if ($canDo->get('core.edit.state')) : ?>
|
||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'assignment', JText::_('COM_TEMPLATES_MENUS_ASSIGNMENT', true)); ?>
|
||||
<?php echo $this->loadTemplate('assignment'); ?>
|
||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||
<?php endif; ?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
||||
</fieldset>
|
||||
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Initiasile related data.
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_menus/helpers/menus.php';
|
||||
$menuTypes = MenusHelper::getMenuLinks();
|
||||
$user = JFactory::getUser();
|
||||
?>
|
||||
<label id="jform_menuselect-lbl" for="jform_menuselect"><?php echo JText::_('JGLOBAL_MENU_SELECTION'); ?></label>
|
||||
<div class="btn-toolbar">
|
||||
<button class="btn" type="button" class="jform-rightbtn" onclick="$$('.chk-menulink').each(function(el) { el.checked = !el.checked; });">
|
||||
<i class="icon-checkbox-partial"></i> <?php echo JText::_('JGLOBAL_SELECTION_INVERT'); ?>
|
||||
</button>
|
||||
</div>
|
||||
<div id="menu-assignment">
|
||||
<ul class="menu-links thumbnails">
|
||||
|
||||
<?php foreach ($menuTypes as &$type) : ?>
|
||||
<li class="span3">
|
||||
<div class="thumbnail">
|
||||
<button class="btn" type="button" class="jform-rightbtn" onclick="$$('.<?php echo $type->menutype; ?>').each(function(el) { el.checked = !el.checked; });">
|
||||
<i class="icon-checkbox-partial"></i> <?php echo JText::_('JGLOBAL_SELECTION_INVERT'); ?>
|
||||
</button>
|
||||
<h5><?php echo $type->title ? $type->title : $type->menutype; ?></h5>
|
||||
|
||||
<?php foreach ($type->links as $link) : ?>
|
||||
<label class="checkbox small" for="link<?php echo (int) $link->value;?>" >
|
||||
<input type="checkbox" name="jform[assigned][]" value="<?php echo (int) $link->value;?>" id="link<?php echo (int) $link->value;?>"<?php if ($link->template_style_id == $this->item->id):?> checked="checked"<?php endif;?><?php if ($link->checked_out && $link->checked_out != $user->id):?> disabled="disabled"<?php else:?> class="chk-menulink <?php echo $type->menutype; ?>"<?php endif;?> />
|
||||
<?php echo $link->text; ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Load chosen.css
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
?>
|
||||
<?php
|
||||
echo JHtml::_('bootstrap.startAccordion', 'templatestyleOptions', array('active' => 'collapse0'));
|
||||
$fieldSets = $this->form->getFieldsets('params');
|
||||
$i = 0;
|
||||
|
||||
foreach ($fieldSets as $name => $fieldSet) :
|
||||
$label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_TEMPLATES_'.$name.'_FIELDSET_LABEL';
|
||||
echo JHtml::_('bootstrap.addSlide', 'templatestyleOptions', JText::_($label), 'collapse' . $i++);
|
||||
if (isset($fieldSet->description) && trim($fieldSet->description)) :
|
||||
echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>';
|
||||
endif;
|
||||
?>
|
||||
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $field->label; ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $field->input; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;
|
||||
echo JHtml::_('bootstrap.endSlide');
|
||||
endforeach;
|
||||
echo JHtml::_('bootstrap.endAccordion');
|
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
103
administrator/components/com_templates/views/style/view.html.php
Normal file
103
administrator/components/com_templates/views/style/view.html.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* View to edit a template style.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
* @since 1.6
|
||||
*/
|
||||
class TemplatesViewStyle extends JViewLegacy
|
||||
{
|
||||
protected $item;
|
||||
|
||||
protected $form;
|
||||
|
||||
protected $state;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$this->item = $this->get('Item');
|
||||
$this->state = $this->get('State');
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
JError::raiseError(500, implode("\n", $errors));
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar()
|
||||
{
|
||||
JFactory::getApplication()->input->set('hidemainmenu', true);
|
||||
|
||||
$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');
|
||||
JToolbarHelper::save('style.save');
|
||||
}
|
||||
|
||||
// If an existing item, can save to a copy.
|
||||
if (!$isNew && $canDo->get('core.create'))
|
||||
{
|
||||
JToolbarHelper::save2copy('style.save2copy');
|
||||
}
|
||||
|
||||
if (empty($this->item->id))
|
||||
{
|
||||
JToolbarHelper::cancel('style.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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user