Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
PK鳊[���DDcheckin.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @subpackage com_checkin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
if (!JFactory::getUser()->authorise('core.manage',
'com_checkin'))
{
throw new
JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'),
403);
}
$controller = JControllerLegacy::getInstance('Checkin');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
PK鳊[�o���checkin.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<extension type="component" version="3.1"
method="upgrade">
<name>com_checkin</name>
<author>Joomla! Project</author>
<creationDate>April 2006</creationDate>
<copyright>(C) 2005 - 2020 Open Source Matters. All rights
reserved.</copyright>
<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>COM_CHECKIN_XML_DESCRIPTION</description>
<administration>
<files folder="admin">
<filename>checkin.php</filename>
<filename>config.xml</filename>
<filename>controller.php</filename>
<folder>models</folder>
<folder>views</folder>
</files>
<languages folder="admin">
<language
tag="en-GB">language/en-GB.com_checkin.ini</language>
<language
tag="en-GB">language/en-GB.com_checkin.sys.ini</language>
</languages>
</administration>
</extension>
PK鳊[C�5HH
config.xmlnu�[���<?xml version="1.0"
encoding="utf-8"?>
<config>
<fieldset
name="permissions"
label="JCONFIG_PERMISSIONS_LABEL"
description="JCONFIG_PERMISSIONS_DESC"
>
<field
name="rules"
type="rules"
label="JCONFIG_PERMISSIONS_LABEL"
filter="rules"
validate="rules"
component="com_checkin"
section="component">
<action
name="core.admin"
title="JACTION_ADMIN"
description="JACTION_ADMIN_COMPONENT_DESC" />
<action
name="core.manage"
title="JACTION_MANAGE"
description="JACTION_MANAGE_COMPONENT_DESC" />
</field>
</fieldset>
</config>
PK鳊[�I
RRcontroller.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @subpackage com_checkin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Checkin Controller
*
* @since 1.6
*/
class CheckinController extends JControllerLegacy
{
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe URL parameters and their
variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return CheckinController A JControllerLegacy object to support
chaining.
*/
public function display($cachable = false, $urlparams = array())
{
// Load the submenu.
$this->addSubmenu($this->input->getWord('option',
'com_checkin'));
return parent::display();
}
/**
* Check in a list of items.
*
* @return void
*/
public function checkin()
{
// Check for request forgeries
$this->checkToken();
$ids = $this->input->get('cid', array(),
'array');
if (empty($ids))
{
JError::raiseWarning(500,
JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));
}
else
{
// Get the model.
/** @var CheckinModelCheckin $model */
$model = $this->getModel();
// Checked in the items.
$this->setMessage(JText::plural('COM_CHECKIN_N_ITEMS_CHECKED_IN',
$model->checkin($ids)));
}
$this->setRedirect('index.php?option=com_checkin');
}
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*
* @since 1.6
*/
protected function addSubmenu($vName)
{
JHtmlSidebar::addEntry(
JText::_('JGLOBAL_SUBMENU_CHECKIN'),
'index.php?option=com_checkin',
$vName == 'com_checkin'
);
JHtmlSidebar::addEntry(
JText::_('JGLOBAL_SUBMENU_CLEAR_CACHE'),
'index.php?option=com_cache',
$vName == 'cache'
);
JHtmlSidebar::addEntry(
JText::_('JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE'),
'index.php?option=com_cache&view=purge',
$vName == 'purge'
);
}
}
PK鳊[?���models/checkin.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @subpackage com_checkin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Checkin Model
*
* @since 1.6
*/
class CheckinModelCheckin extends JModelList
{
/**
* Count of the total items checked out
*
* @var integer
*/
protected $total;
/**
* Unused class variable
*
* @var object
* @deprecated 4.0
*/
protected $tables;
/**
* Constructor.
*
* @param array $config An optional associative array of configuration
settings.
*
* @see JController
* @since 3.5
*/
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'table',
'count',
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note: Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
* @since 1.6
*/
protected function populateState($ordering = 'table', $direction
= 'asc')
{
$this->setState('filter.search',
$this->getUserStateFromRequest($this->context .
'.filter.search', 'filter_search'));
// List state information.
parent::populateState($ordering, $direction);
}
/**
* Checks in requested tables
*
* @param array $ids An array of table names. Optional.
*
* @return integer Checked in item count
*
* @since 1.6
*/
public function checkin($ids = array())
{
$db = $this->getDbo();
$nullDate = $db->getNullDate();
if (!is_array($ids))
{
return 0;
}
// This int will hold the checked item count.
$results = 0;
$dispatcher = \JEventDispatcher::getInstance();
foreach ($ids as $tn)
{
// Make sure we get the right tables based on prefix.
if (stripos($tn,
JFactory::getApplication()->get('dbprefix')) !== 0)
{
continue;
}
$fields = $db->getTableColumns($tn);
if (!(isset($fields['checked_out']) &&
isset($fields['checked_out_time'])))
{
continue;
}
$query = $db->getQuery(true)
->update($db->quoteName($tn))
->set($db->quoteName('checked_out') . ' =
DEFAULT')
->set($db->quoteName('checked_out_time') . ' =
' . $db->quote($nullDate))
->where($db->quoteName('checked_out') . ' >
0');
$db->setQuery($query);
if ($db->execute())
{
$results = $results + $db->getAffectedRows();
$dispatcher->trigger('onAfterCheckin', array($tn));
}
}
return $results;
}
/**
* Get total of tables
*
* @return integer Total to check-in tables
*
* @since 1.6
*/
public function getTotal()
{
if (!isset($this->total))
{
$this->getItems();
}
return $this->total;
}
/**
* Get tables
*
* @return array Checked in table names as keys and checked in item
count as values.
*
* @since 1.6
*/
public function getItems()
{
if (!isset($this->items))
{
$db = $this->getDbo();
$tables = $db->getTableList();
// This array will hold table name as key and checked in item count as
value.
$results = array();
foreach ($tables as $i => $tn)
{
// Make sure we get the right tables based on prefix.
if (stripos($tn,
JFactory::getApplication()->get('dbprefix')) !== 0)
{
unset($tables[$i]);
continue;
}
if ($this->getState('filter.search') &&
stripos($tn, $this->getState('filter.search')) === false)
{
unset($tables[$i]);
continue;
}
$fields = $db->getTableColumns($tn);
if (!(isset($fields['checked_out']) &&
isset($fields['checked_out_time'])))
{
unset($tables[$i]);
continue;
}
}
foreach ($tables as $tn)
{
$query = $db->getQuery(true)
->select('COUNT(*)')
->from($db->quoteName($tn))
->where('checked_out > 0');
$db->setQuery($query);
if ($db->execute())
{
$results[$tn] = $db->loadResult();
// Show only tables with items to checkin.
if ((int) $results[$tn] === 0)
{
unset($results[$tn]);
}
}
else
{
continue;
}
}
$this->total = count($results);
// Order items by table
if ($this->getState('list.ordering') == 'table')
{
if (strtolower($this->getState('list.direction')) ==
'asc')
{
ksort($results);
}
else
{
krsort($results);
}
}
// Order items by number of items
else
{
if (strtolower($this->getState('list.direction')) ==
'asc')
{
asort($results);
}
else
{
arsort($results);
}
}
// Pagination
$limit = (int) $this->getState('list.limit');
if ($limit !== 0)
{
$this->items = array_slice($results,
$this->getState('list.start'), $limit);
}
else
{
$this->items = $results;
}
}
return $this->items;
}
}
PK鳊[%k�Kmodels/forms/filter_checkin.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
inputmode="search"
label="COM_CHECKIN_FILTER_SEARCH_LABEL"
description="COM_CHECKIN_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
noresults="COM_CHECKIN_NO_ITEMS"
/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
description="JGLOBAL_SORT_BY"
onchange="this.form.submit();"
default="table ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="table
ASC">COM_CHECKIN_DATABASE_TABLE_ASC</option>
<option value="table
DESC">COM_CHECKIN_DATABASE_TABLE_DESC</option>
<option value="count
ASC">COM_CHECKIN_ITEMS_TO_CHECK_IN_ASC</option>
<option value="count
DESC">COM_CHECKIN_ITEMS_TO_CHECK_IN_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIMIT"
description="JGLOBAL_LIMIT"
class="input-mini"
default="5"
onchange="this.form.submit();"
/>
</fields>
</form>
PK鳊[j�b��views/checkin/tmpl/default.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @subpackage com_checkin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo
JRoute::_('index.php?option=com_checkin'); ?>"
method="post" name="adminForm"
id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<?php echo
JLayoutHelper::render('joomla.searchtools.default',
array('view' => $this)); ?>
<?php if ($this->total > 0) : ?>
<table id="global-checkin" class="table
table-striped">
<thead>
<tr>
<th width="1%"><?php echo
JHtml::_('grid.checkall'); ?></th>
<th><?php echo JHtml::_('searchtools.sort',
'COM_CHECKIN_DATABASE_TABLE', 'table', $listDirn,
$listOrder); ?></th>
<th><?php echo JHtml::_('searchtools.sort',
'COM_CHECKIN_ITEMS_TO_CHECK_IN', 'count', $listDirn,
$listOrder); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php $i = 0; ?>
<?php foreach ($this->items as $table => $count) : ?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center"><?php echo
JHtml::_('grid.id', $i, $table); ?></td>
<td>
<label for="cb<?php echo $i ?>">
<?php echo JText::sprintf('COM_CHECKIN_TABLE',
$table); ?>
</label>
</td>
<td>
<span class="label label-warning"><?php echo
$count; ?></span>
</td>
</tr>
<?php $i++; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<input type="hidden" name="task"
value="" />
<input type="hidden" name="boxchecked"
value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
PK鳊[�pTp��views/checkin/tmpl/default.xmlnu�[���<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CHECKIN_CHECKIN_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_CHECKIN_CHECKIN_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
PK鳊[�XwI~~views/checkin/view.html.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @subpackage com_checkin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Checkin component
*
* @since 1.0
*/
class CheckinViewCheckin extends JViewLegacy
{
/**
* Unused class variable
*
* @var object
* @deprecated 4.0
*/
protected $tables;
/**
* An array of items
*
* @var array
*/
protected $items;
/**
* The pagination object
*
* @var JPagination
*/
protected $pagination;
/**
* The model state
*
* @var object
*/
protected $state;
/**
* The sidebar markup
*
* @var string
*/
protected $sidebar;
/**
* Execute and display a template script.
*
* @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->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->total = $this->get('Total');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
return parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
JToolbarHelper::title(JText::_('COM_CHECKIN_GLOBAL_CHECK_IN'),
'checkin');
JToolbarHelper::custom('checkin', 'checkin.png',
'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
if (JFactory::getUser()->authorise('core.admin',
'com_checkin'))
{
JToolbarHelper::divider();
JToolbarHelper::preferences('com_checkin');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_SITE_MAINTENANCE_GLOBAL_CHECK-IN');
}
}
PK鳊[���DDcheckin.phpnu�[���PK鳊[�o���checkin.xmlnu�[���PK鳊[C�5HH
|config.xmlnu�[���PK鳊[�I
RR�controller.phpnu�[���PK鳊[?����models/checkin.phpnu�[���PK鳊[%k�Kx%models/forms/filter_checkin.xmlnu�[���PK鳊[j�b���)views/checkin/tmpl/default.phpnu�[���PK鳊[�pTp��3views/checkin/tmpl/default.xmlnu�[���PK鳊[�XwI~~.4views/checkin/view.html.phpnu�[���PK ��<