mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-06-04 15:30:48 +00:00
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:
parent
276c32922e
commit
8688bfd9cc
|
@ -9,20 +9,17 @@
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
$fieldSets = $this->form->getFieldsets('params');
|
$fieldSets = $this->form->getFieldsets('params'); ?>
|
||||||
foreach ($fieldSets as $name => $fieldSet) :
|
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
|
||||||
?>
|
<div class="tab-pane" id="params-<?php echo $name; ?>">
|
||||||
<div class="tab-pane" id="params-<?php echo $name;?>">
|
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
|
||||||
<?php
|
<?php echo '<p class="alert alert-info">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; ?>
|
||||||
if (isset($fieldSet->description) && trim($fieldSet->description)) :
|
<?php endif; ?>
|
||||||
echo '<p class="alert alert-info">'.$this->escape(JText::_($fieldSet->description)).'</p>';
|
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
||||||
endif;
|
<div class="control-group">
|
||||||
?>
|
<div class="control-label"><?php echo $field->label; ?></div>
|
||||||
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
<div class="controls"><?php echo $field->input; ?></div>
|
||||||
<div class="control-group">
|
</div>
|
||||||
<div class="control-label"><?php echo $field->label; ?></div>
|
<?php endforeach; ?>
|
||||||
<div class="controls"><?php echo $field->input; ?></div>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
|
@ -23,40 +23,48 @@ class WeblinksViewWeblink extends JViewLegacy
|
||||||
protected $form;
|
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)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
$this->state = $this->get('State');
|
$this->state = $this->get('State');
|
||||||
$this->item = $this->get('Item');
|
$this->item = $this->get('Item');
|
||||||
$this->form = $this->get('Form');
|
$this->form = $this->get('Form');
|
||||||
|
|
||||||
// Check for errors.
|
// Check for errors.
|
||||||
if (count($errors = $this->get('Errors')))
|
if (count($errors = $this->get('Errors')))
|
||||||
{
|
{
|
||||||
JError::raiseError(500, implode("\n", $errors));
|
JError::raiseError(500, implode("\n", $errors));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addToolbar();
|
$this->addToolbar();
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the page title and toolbar.
|
* Add the page title and toolbar.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function addToolbar()
|
protected function addToolbar()
|
||||||
{
|
{
|
||||||
JFactory::getApplication()->input->set('hidemainmenu', true);
|
JFactory::getApplication()->input->set('hidemainmenu', true);
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$isNew = ($this->item->id == 0);
|
$isNew = ($this->item->id == 0);
|
||||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
$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.
|
// 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');
|
JToolbarHelper::title($isNew ? JText::_('COM_WEBLINKS_MANAGER_WEBLINK_NEW') : JText::_('COM_WEBLINKS_MANAGER_WEBLINK_EDIT'), 'link weblinks');
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
|
|
||||||
JHtml::_('bootstrap.tooltip');
|
JHtml::_('bootstrap.tooltip');
|
||||||
JHtml::_('behavior.multiselect');
|
JHtml::_('behavior.multiselect');
|
||||||
|
@ -129,7 +129,7 @@ if ($saveOrder)
|
||||||
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
|
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($canEdit) : ?>
|
<?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 echo $this->escape($item->title); ?></a>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php echo $this->escape($item->title); ?>
|
<?php echo $this->escape($item->title); ?>
|
||||||
|
@ -150,7 +150,7 @@ if ($saveOrder)
|
||||||
<td class="small nowrap hidden-phone">
|
<td class="small nowrap hidden-phone">
|
||||||
<?php if ($item->language == '*') : ?>
|
<?php if ($item->language == '*') : ?>
|
||||||
<?php echo JText::alt('JALL', '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) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
|
<?php echo $item->language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -23,9 +23,11 @@ class WeblinksViewWeblinks extends JViewLegacy
|
||||||
protected $state;
|
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)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
|
@ -52,6 +54,8 @@ class WeblinksViewWeblinks extends JViewLegacy
|
||||||
/**
|
/**
|
||||||
* Add the page title and toolbar.
|
* Add the page title and toolbar.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function addToolbar()
|
protected function addToolbar()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user