Ejemplo n.º 1
0
 /**
  * Gets a list of the actions that can be performed.
  *
  * @return  JObject
  *
  * @since   1.6
  * @todo    Refactor to work with notes
  */
 public static function getActions()
 {
     if (empty(self::$actions)) {
         $user = JFactory::getUser();
         self::$actions = new JObject();
         $actions = array('core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete');
         foreach ($actions as $action) {
             self::$actions->set($action, $user->authorise($action, 'com_tz_pinboard'));
         }
     }
     return self::$actions;
 }
Ejemplo n.º 2
0
 /**
  * Add the page title and toolbar.
  *
  * @since    1.6
  */
 protected function addToolbar()
 {
     $canDo = TZ_PinboardHelperUsers::getActions();
     JToolBarHelper::title(JText::_('COM_USERS_VIEW_USERS_TITLE'), 'user');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('user.add');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('user.edit');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'users.delete');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_tz_pinboard');
         JToolBarHelper::divider();
     }
     JToolBarHelper::help('JHELP_USERS_USER_MANAGER');
     JHtmlSidebar::setAction('index.php?option=com_users&view=users');
     JHtmlSidebar::addFilter(JText::_('COM_USERS_FILTER_STATE'), 'filter_state', JHtml::_('select.options', TZ_PinboardHelperUsers::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
 }
Ejemplo n.º 3
0
 /**
  * Add the page title and toolbar.
  *
  * @since    1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', 1);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = TZ_PinboardHelperUsers::getActions();
     $isNew = $this->item->id == 0;
     $isProfile = $this->item->id == $user->id;
     JToolBarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_USER_TITLE' : ($isProfile ? 'COM_USERS_VIEW_EDIT_PROFILE_TITLE' : 'COM_USERS_VIEW_EDIT_USER_TITLE')), $isNew ? 'user-add' : ($isProfile ? 'user-profile' : 'user-edit'));
     if ($canDo->get('core.edit') || $canDo->get('core.create')) {
         JToolBarHelper::apply('user.apply');
         JToolBarHelper::save('user.save');
     }
     if ($canDo->get('core.create') && $canDo->get('core.manage')) {
         JToolBarHelper::save2new('user.save2new');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('user.cancel');
     } else {
         JToolBarHelper::cancel('user.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_USERS_USER_MANAGER_EDIT');
 }
Ejemplo n.º 4
0
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL

# Websites: http://www.templaza.com

# Technical Support:  Forum - http://templaza.com/Forum

-------------------------------------------------------------------------*/
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
// Load the tooltip behavior.
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
$canDo = TZ_PinboardHelperUsers::getActions();
// Get the form fieldsets.
$fieldsets = $this->form->getFieldsets();
?>

<script type="text/javascript">
    Joomla.submitbutton = function (task) {
        if (task == 'user.cancel' || document.formvalidator.isValid(document.id('user-form'))) {
            Joomla.submitform(task, document.getElementById('user-form'));
        }
    }
</script>

<form action="<?php 
echo JRoute::_('index.php?option=com_tz_pinboard&layout=edit&id=' . (int) $this->item->id);
?>