Update view.html.php (#234)

* Update view.html.php

* Update edit_params.php

* Update view.html.php

* Update default.php

* Update view.html.php

* Update view.html.php
This commit is contained in:
zero-24 2016-07-03 12:04:21 +02:00 committed by Chris Davenport
parent 276c32922e
commit 8688bfd9cc
4 changed files with 37 additions and 28 deletions

View File

@ -9,20 +9,17 @@
defined('_JEXEC') or die;
$fieldSets = $this->form->getFieldsets('params');
foreach ($fieldSets as $name => $fieldSet) :
?>
<div class="tab-pane" id="params-<?php echo $name;?>">
<?php
if (isset($fieldSet->description) && trim($fieldSet->description)) :
echo '<p class="alert alert-info">'.$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; ?>
$fieldSets = $this->form->getFieldsets('params'); ?>
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
<div class="tab-pane" id="params-<?php echo $name; ?>">
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
<?php echo '<p class="alert alert-info">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; ?>
<?php 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; ?>
</div>
<?php endforeach; ?>

View File

@ -23,40 +23,48 @@ class WeblinksViewWeblink extends JViewLegacy
protected $form;
/**
* Display the view
* Display the view.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
$this->state = $this->get('State');
$this->item = $this->get('Item');
$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.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
// Since we don't track these assets at the item level, use the category id.
$canDo = JHelperContent::getActions('com_weblinks', 'category', $this->item->catid);
$canDo = JHelperContent::getActions('com_weblinks', 'category', $this->item->catid);
JToolbarHelper::title($isNew ? JText::_('COM_WEBLINKS_MANAGER_WEBLINK_NEW') : JText::_('COM_WEBLINKS_MANAGER_WEBLINK_EDIT'), 'link weblinks');

View File

@ -9,7 +9,7 @@
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
@ -129,7 +129,7 @@ if ($saveOrder)
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<a href="<?php echo JRoute::_('index.php?option=com_weblinks&task=weblink.edit&id='.(int) $item->id); ?>">
<a href="<?php echo JRoute::_('index.php?option=com_weblinks&task=weblink.edit&id=' . (int) $item->id); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
@ -150,7 +150,7 @@ if ($saveOrder)
<td class="small nowrap hidden-phone">
<?php if ($item->language == '*') : ?>
<?php echo JText::alt('JALL', 'language'); ?>
<?php else:?>
<?php else : ?>
<?php echo $item->language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . '&nbsp;' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
<?php endif;?>
</td>

View File

@ -23,9 +23,11 @@ class WeblinksViewWeblinks extends JViewLegacy
protected $state;
/**
* Display the view
* Display the view.
*
* @return void
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
@ -52,6 +54,8 @@ class WeblinksViewWeblinks extends JViewLegacy
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()