You've already forked joomla_test
first commit
This commit is contained in:
1
administrator/components/com_users/views/note/index.html
Normal file
1
administrator/components/com_users/views/note/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
79
administrator/components/com_users/views/note/tmpl/edit.php
Normal file
79
administrator/components/com_users/views/note/tmpl/edit.php
Normal file
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @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::_('behavior.formvalidation');
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == 'note.cancel' || document.formvalidator.isValid(document.id('note-form')))
|
||||
{
|
||||
Joomla.submitform(task, document.getElementById('note-form'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_users&view=note&id='.(int) $this->item->id);?>" method="post" name="adminForm" id="note-form" class="form-validate form-horizontal">
|
||||
<fieldset class="adminform">
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('subject'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('subject'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('user_id'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('user_id'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('catid'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('catid'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('state'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('state'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('review_time'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('review_time'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<div class="control-label">
|
||||
<?php echo $this->form->getLabel('body'); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $this->form->getInput('body'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</fieldset>
|
||||
</form>
|
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
122
administrator/components/com_users/views/note/view.html.php
Normal file
122
administrator/components/com_users/views/note/view.html.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_users
|
||||
*
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* User note edit view
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_users
|
||||
* @since 2.5
|
||||
*/
|
||||
class UsersViewNote extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* The edit form.
|
||||
*
|
||||
* @var JForm
|
||||
* @since 2.5
|
||||
*/
|
||||
protected $form;
|
||||
|
||||
/**
|
||||
* The item data.
|
||||
*
|
||||
* @var object
|
||||
* @since 2.5
|
||||
*/
|
||||
protected $item;
|
||||
|
||||
/**
|
||||
* The model state.
|
||||
*
|
||||
* @var JObject
|
||||
* @since 2.5
|
||||
*/
|
||||
protected $state;
|
||||
|
||||
/**
|
||||
* Override the display method for 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 a JError object.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Initialise view variables.
|
||||
$this->state = $this->get('State');
|
||||
$this->item = $this->get('Item');
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Get the component HTML helpers
|
||||
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
||||
|
||||
parent::display($tpl);
|
||||
$this->addToolbar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the toolbar.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function addToolbar()
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$input->set('hidemainmenu', 1);
|
||||
|
||||
$user = JFactory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = UsersHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
|
||||
|
||||
JToolbarHelper::title(JText::_('COM_USERS_NOTES'), 'user');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && ($canDo->get('core.edit') || (count($user->getAuthorisedCategories('com_users', 'core.create')))))
|
||||
{
|
||||
JToolbarHelper::apply('note.apply');
|
||||
JToolbarHelper::save('note.save');
|
||||
}
|
||||
|
||||
if (!$checkedOut && (count($user->getAuthorisedCategories('com_users', 'core.create'))))
|
||||
{
|
||||
JToolbarHelper::save2new('note.save2new');
|
||||
}
|
||||
|
||||
// If an existing item, can save to a copy.
|
||||
if (!$isNew && (count($user->getAuthorisedCategories('com_users', 'core.create')) > 0))
|
||||
{
|
||||
JToolbarHelper::save2copy('note.save2copy');
|
||||
}
|
||||
if (empty($this->item->id))
|
||||
{
|
||||
JToolbarHelper::cancel('note.cancel');
|
||||
}
|
||||
else
|
||||
{
|
||||
JToolbarHelper::cancel('note.cancel', 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
|
||||
JToolbarHelper::divider();
|
||||
JToolbarHelper::help('JHELP_USERS_USER_NOTES_EDIT');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user