| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/note.php.tar |
home/wuectly/www/libraries/regularlabs/fields/note.php 0000604 00000004566 15245607134 0017235 0 ustar 00 <?php
/**
* @package Regular Labs Library
* @version 21.4.10972
*
* @author Peter van Westen <info@regularlabs.com>
* @link http://www.regularlabs.com
* @copyright Copyright © 2021 Regular Labs All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text as JText;
if ( ! is_file(JPATH_LIBRARIES . '/regularlabs/autoload.php'))
{
return;
}
require_once JPATH_LIBRARIES . '/regularlabs/autoload.php';
class JFormFieldRL_Note extends \RegularLabs\Library\Field
{
public $type = 'Note';
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$this->element = $element;
$element['label'] = $this->prepareText($element['label']);
$element['description'] = $this->prepareText($element['description']);
$element['translateDescription'] = false;
return parent::setup($element, $value, $group);
}
protected function getLabel()
{
if (empty($this->element['label']) && empty($this->element['description']))
{
return '';
}
$title = $this->element['label'] ? (string) $this->element['label'] : ($this->element['title'] ? (string) $this->element['title'] : '');
$heading = $this->element['heading'] ? (string) $this->element['heading'] : 'h4';
$description = (string) $this->element['description'];
$class = ! empty($this->class) ? $this->class : '';
$close = (string) $this->element['close'];
$controls = (int) $this->element['controls'];
$class = ! empty($class) ? ' class="' . $class . '"' : '';
$button = '';
$title = ! empty($title) ? JText::_($title) : '';
$description = ! empty($description) ? JText::_($description) : '';
if ($close)
{
$close = $close == 'true' ? 'alert' : $close;
$button = '<button type="button" class="close" data-dismiss="' . $close . '" aria-label="Close">×</button>';
}
if ($heading && $title)
{
$title = '<' . $heading . '>'
. $title
. '</' . $heading . '>';
}
if ($controls)
{
$title = '<div class="control-label"><label>'
. $title
. '</label></div>';
$description = '<div class="controls">'
. $description
. '</div>';
}
return '</div><div ' . $class . '>'
. $button
. $title
. $description;
}
protected function getInput()
{
return '';
}
}
home/wuectly/www/libraries/joomla/form/fields/note.php 0000604 00000003452 15245627620 0017151 0 ustar 00 <?php
/**
* @package Joomla.Platform
* @subpackage Form
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Form Field class for the Joomla Platform.
* Supports a one line text field.
*
* @link http://www.w3.org/TR/html-markup/input.text.html#input.text
* @since 1.7.0
*/
class JFormFieldNote extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.7.0
*/
protected $type = 'Note';
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
* @since 1.7.0
*/
protected function getLabel()
{
if (empty($this->element['label']) && empty($this->element['description']))
{
return '';
}
$title = $this->element['label'] ? (string) $this->element['label'] : ($this->element['title'] ? (string) $this->element['title'] : '');
$heading = $this->element['heading'] ? (string) $this->element['heading'] : 'h4';
$description = (string) $this->element['description'];
$class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
$close = (string) $this->element['close'];
$html = array();
if ($close)
{
$close = $close == 'true' ? 'alert' : $close;
$html[] = '<button type="button" class="close" data-dismiss="' . $close . '">×</button>';
}
$html[] = !empty($title) ? '<' . $heading . '>' . JText::_($title) . '</' . $heading . '>' : '';
$html[] = !empty($description) ? JText::_($description) : '';
return '</div><div ' . $class . '>' . implode('', $html);
}
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 1.7.0
*/
protected function getInput()
{
return '';
}
}
home/wuectly/www/administrator/components/com_users/tables/note.php 0000604 00000007406 15245741103 0022015 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/**
* User notes table class
*
* @since 2.5
*/
class UsersTableNote extends JTable
{
/**
* Constructor
*
* @param JDatabaseDriver &$db Database object
*
* @since 2.5
*/
public function __construct(&$db)
{
parent::__construct('#__user_notes', 'id', $db);
$this->setColumnAlias('published', 'state');
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_users.note'));
}
/**
* Overloaded store method for the notes table.
*
* @param boolean $updateNulls Toggle whether null values should be updated.
*
* @return boolean True on success, false on failure.
*
* @since 2.5
*/
public function store($updateNulls = false)
{
$date = JFactory::getDate()->toSql();
$userId = JFactory::getUser()->get('id');
$this->modified_time = $date;
$this->modified_user_id = $userId;
if (!((int) $this->review_time))
{
// Null date.
$this->review_time = $this->_db->getNullDate();
}
if (empty($this->id))
{
// New record.
$this->created_time = $date;
$this->created_user_id = $userId;
}
// Attempt to store the data.
return parent::store($updateNulls);
}
/**
* Method to set the publishing state for a row or list of rows in the database
* table. The method respects checked out rows by other users and will attempt
* to check-in rows that it can after adjustments are made.
*
* @param mixed $pks An optional array of primary key values to update. If not set the instance property value is used.
* @param integer $state The publishing state. eg. [0 = unpublished, 1 = published]
* @param integer $userId The user id of the user performing the operation.
*
* @return boolean True on success.
*
* @since 2.5
*/
public function publish($pks = null, $state = 1, $userId = 0)
{
$k = $this->_tbl_key;
// Sanitize input.
$pks = ArrayHelper::toInteger($pks);
$userId = (int) $userId;
$state = (int) $state;
// If there are no primary keys set check to see if the instance key is set.
if (empty($pks))
{
if ($this->$k)
{
$pks = array($this->$k);
}
// Nothing to set publishing state on, return false.
else
{
$this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED'));
return false;
}
}
$query = $this->_db->getQuery(true)
->update($this->_db->quoteName($this->_tbl))
->set($this->_db->quoteName('state') . ' = ' . (int) $state);
// Build the WHERE clause for the primary keys.
$query->where($k . '=' . implode(' OR ' . $k . '=', $pks));
// Determine if there is checkin support for the table.
if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time'))
{
$checkin = false;
}
else
{
$query->where('(checked_out = 0 OR checked_out = ' . (int) $userId . ')');
$checkin = true;
}
// Update the publishing state for rows with the given primary keys.
$this->_db->setQuery($query);
try
{
$this->_db->execute();
}
catch (RuntimeException $e)
{
$this->setError($this->_db->getMessage());
return false;
}
// If checkin is supported and all rows were adjusted, check them in.
if ($checkin && (count($pks) == $this->_db->getAffectedRows()))
{
// Checkin the rows.
foreach ($pks as $pk)
{
$this->checkin($pk);
}
}
// If the JTable instance value is in the list of primary keys that were set, set the instance.
if (in_array($this->$k, $pks))
{
$this->state = $state;
}
$this->setError('');
return true;
}
}
home/wuectly/www/administrator/components/com_users/models/note.php 0000604 00000006416 15245761057 0022040 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* User note model.
*
* @since 2.5
*/
class UsersModelNote extends JModelAdmin
{
/**
* The type alias for this content type.
*
* @var string
* @since 3.2
*/
public $typeAlias = 'com_users.note';
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return mixed A JForm object on success, false on failure
*
* @since 2.5
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_users.note', 'note', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
return $form;
}
/**
* Method to get a single record.
*
* @param integer $pk The id of the primary key.
*
* @return mixed Object on success, false on failure.
*
* @since 2.5
*/
public function getItem($pk = null)
{
$result = parent::getItem($pk);
// Get the dispatcher and load the content plugins.
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('content');
// Load the user plugins for backward compatibility (v3.3.3 and earlier).
JPluginHelper::importPlugin('user');
// Trigger the data preparation event.
$dispatcher->trigger('onContentPrepareData', array('com_users.note', $result));
return $result;
}
/**
* Method to get a table object, load it if necessary.
*
* @param string $name The table name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $options Configuration array for model. Optional.
*
* @return JTable The table object
*
* @since 2.5
*/
public function getTable($name = 'Note', $prefix = 'UsersTable', $options = array())
{
return JTable::getInstance($name, $prefix, $options);
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
{
// Get the application
$app = JFactory::getApplication();
// Check the session for previously entered form data.
$data = $app->getUserState('com_users.edit.note.data', array());
if (empty($data))
{
$data = $this->getItem();
// Prime some default values.
if ($this->getState('note.id') == 0)
{
$data->set('catid', $app->input->get('catid', $app->getUserState('com_users.notes.filter.category_id'), 'int'));
}
$userId = $app->input->get('u_id', 0, 'int');
if ($userId != 0)
{
$data->user_id = $userId;
}
}
$this->preprocessData('com_users.note', $data);
return $data;
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 2.5
*/
protected function populateState()
{
parent::populateState();
$userId = JFactory::getApplication()->input->get('u_id', 0, 'int');
$this->setState('note.user_id', $userId);
}
}