You've already forked joomla_test
first commit
This commit is contained in:
@ -0,0 +1,195 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'trash') {
|
||||
var answer = confirm('".JText::_('K2_WARNING_YOU_ARE_ABOUT_TO_TRASH_THE_SELECTED_CATEGORIES_THEIR_CHILDREN_CATEGORIES_AND_ALL_THEIR_INCLUDED_ITEMS', true)."')
|
||||
if (answer){
|
||||
submitform( pressbutton );
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_TITLE'); ?>"/>
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['categories']; ?>
|
||||
<?php echo $this->lists['trash']; ?> <?php echo $this->lists['state']; ?>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<?php echo $this->lists['language']; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped" id="k2CategoriesList">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<th width="1%" class="center hidden-phone">
|
||||
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'c.ordering', @$this->lists['order_Dir'], @$this->lists['order'], null, 'asc', 'K2_ORDER'); ?>
|
||||
</th>
|
||||
<?php else: ?>
|
||||
<th>
|
||||
#
|
||||
</th>
|
||||
<?php endif; ?>
|
||||
<th>
|
||||
<input id="jToggler" type="checkbox" name="toggle" value="" />
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_TITLE', 'c.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<?php if(K2_JVERSION != '30'): ?>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ORDER', 'c.ordering', @$this->lists['order_Dir'], @$this->lists['order'] ); ?> <?php echo $this->ordering ?JHTML::_('grid.order', $this->rows ,'filesave.png' ):''; ?>
|
||||
</th>
|
||||
<?php endif ;?>
|
||||
<th class="center hidden-phone">
|
||||
<?php echo JText::_('K2_PARAMETER_INHERITANCE'); ?>
|
||||
</th>
|
||||
<th class="center hidden-phone">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ASSOCIATED_EXTRA_FIELD_GROUPS', 'extra_fields_group', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="center hidden-phone">
|
||||
<?php echo JText::_('K2_TEMPLATE'); ?>
|
||||
</th>
|
||||
<th class="hidden-phone center">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ACCESS_LEVEL', 'c.access', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="center">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_PUBLISHED', 'c.published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="center hidden-phone">
|
||||
<?php echo JText::_('K2_IMAGE'); ?>
|
||||
</th>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_LANGUAGE', 'c.language', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<?php endif; ?>
|
||||
<th class="hidden-phone center">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ID', 'c.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row) : ?>
|
||||
<tr class="row<?php echo ($key%2); ?>" sortable-group-id="<?php echo $row->parent; ?>">
|
||||
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<td class="order center hidden-phone">
|
||||
<?php if($row->canChange): ?>
|
||||
<span class="sortable-handler <?php echo ($this->ordering) ? '' : 'inactive tip-top' ;?>" title="<?php echo ($this->ordering) ? '' :JText::_('JORDERINGDISABLED');?>" rel="tooltip"><i class="icon-menu"></i></span>
|
||||
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $row->ordering;?>" class="width-20 text-area-order " />
|
||||
<?php else: ?>
|
||||
<span class="sortable-handler inactive" ><i class="icon-menu"></i></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td><?php echo $key+1; ?></td>
|
||||
<?php endif; ?>
|
||||
<td class="k2Center center">
|
||||
<?php if(!$this->filter_trash || $row->trash) { $row->checked_out = 0; echo @JHTML::_('grid.checkedout', $row, $key );}?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($this->filter_trash): ?>
|
||||
<?php if ($row->trash): ?>
|
||||
<strong><?php echo $row->treename; ?> (<?php echo $row->numOfTrashedItems; ?>)</strong>
|
||||
<?php else: ?>
|
||||
<?php echo $row->treename; ?> (<?php echo $row->numOfItems.' '.JText::_('K2_ACTIVE'); ?> / <?php echo $row->numOfTrashedItems.' '.JText::_('K2_TRASHED'); ?>)
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<a href="<?php echo JRoute::_('index.php?option=com_k2&view=category&cid='.$row->id); ?>"><?php echo $row->treename; ?>
|
||||
<?php if($this->params->get('showItemsCounterAdmin')): ?>
|
||||
<span class="small">
|
||||
(<?php echo $row->numOfItems.' '.JText::_('K2_ACTIVE'); ?> / <?php echo $row->numOfTrashedItems.' '.JText::_('K2_TRASHED'); ?>)
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if(K2_JVERSION != '30'): ?>
|
||||
<td class="order k2Order">
|
||||
<span><?php echo $this->page->orderUpIcon( $key, $row->parent == 0 || $row->parent == @$this->rows[$key-1]->parent, 'orderup', 'K2_MOVE_UP', $this->ordering); ?></span> <span><?php echo $this->page->orderDownIcon( $key, count($this->rows), $row->parent == 0 || $row->parent == @$this->rows[$key+1]->parent, 'orderdown', 'K2_MOVE_DOWN', $this->ordering ); ?></span>
|
||||
<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo ($this->ordering)?'':'disabled="disabled"'; ?> class="text_area k2OrderBox" />
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php echo $row->inheritFrom; ?>
|
||||
</td>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php echo $row->extra_fields_group; ?>
|
||||
</td>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php echo $row->template; ?>
|
||||
</td>
|
||||
<td class="k2Center hidden-phone center">
|
||||
<?php echo ($this->filter_trash || K2_JVERSION != '15')? $row->groupname:JHTML::_('grid.access', $row, $key ); ?>
|
||||
</td>
|
||||
<td class="k2Center center">
|
||||
<?php echo $row->status; ?>
|
||||
</td>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php if($row->image): ?>
|
||||
<a href="<?php echo JURI::root().'media/k2/categories/'.$row->image; ?>" class="modal">
|
||||
<?php if (K2_JVERSION == '30') : ?>
|
||||
<?php echo JText::_('K2_PREVIEW_IMAGE'); ?>
|
||||
<?php else: ?>
|
||||
<img src="templates/<?php echo $this->template; ?>/images/menu/icon-16-media.png" alt="<?php echo JText::_('K2_PREVIEW_IMAGE'); ?>" />
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<td class="center hidden-phone"><?php echo $row->language; ?></td>
|
||||
<?php endif; ?>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php echo $row->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: element.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<h1><?php echo JText::_('K2_SELECT_CATEGORIES'); ?></h1>
|
||||
<table class="k2AdminTableFilters">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_TITLE'); ?>"/>
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['state']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th> <?php echo JHTML::_('grid.sort', 'K2_TITLE', 'c.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_ASSOCIATED_EXTRA_FIELD_GROUPS', 'extra_fields_group', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_ACCESS_LEVEL', 'c.access', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_PUBLISHED', 'c.published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_ID', 'c.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td><?php echo $key+1; ?></td>
|
||||
<td><a class="k2ListItemDisabled" title="<?php echo JText::_('K2_CLICK_TO_ADD_THIS_ITEM'); ?>" onclick="window.parent.jSelectCategory('<?php echo $row->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$row->name); ?>', 'id');"><?php echo $row->treename; ?></a></td>
|
||||
<td class="k2Center"><?php echo $row->extra_fields_group; ?></td>
|
||||
<td class="k2Center"><?php echo $row->groupname; ?></td>
|
||||
<td class="k2Center"><?php echo $row->status; ?></td>
|
||||
<td><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="element" />
|
||||
<input type="hidden" name="tmpl" value="component" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: move.php 1877 2013-02-07 14:37:58Z joomlaworks $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = & JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#category').val()) == '') {
|
||||
alert( '".JText::_('K2_YOU_MUST_SELECT_A_PARENT_CATEGORY', true)."' );
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<fieldset>
|
||||
<legend><?php echo JText::_('K2_PARENT_CATEGORY'); ?></legend>
|
||||
<?php echo $this->lists['categories']; ?>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>(<?php echo count($this->rows); ?>) <?php echo JText::_('K2_CATEGORIES_BEING_MOVED'); ?></legend>
|
||||
<ol>
|
||||
<?php foreach ($this->rows as $row): ?>
|
||||
<li><?php echo $row->name; ?><input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" /></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
</form>
|
||||
238
administrator/components/com_k2/views/categories/view.html.php
Normal file
238
administrator/components/com_k2/views/categories/view.html.php
Normal file
@ -0,0 +1,238 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1962 2013-04-29 12:29:34Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewCategories extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', 'c.ordering', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', '', 'word');
|
||||
$filter_trash = $mainframe->getUserStateFromRequest($option.$view.'filter_trash', 'filter_trash', 0, 'int');
|
||||
$filter_category = $mainframe->getUserStateFromRequest($option.$view.'filter_category', 'filter_category', 0, 'int');
|
||||
$filter_state = $mainframe->getUserStateFromRequest($option.$view.'filter_state', 'filter_state', -1, 'int');
|
||||
$language = $mainframe->getUserStateFromRequest($option.$view.'language', 'language', '', 'string');
|
||||
$search = $mainframe->getUserStateFromRequest($option.$view.'search', 'search', '', 'string');
|
||||
$search = JString::strtolower($search);
|
||||
$model = $this->getModel();
|
||||
$total = $model->getTotal();
|
||||
$task = JRequest::getCmd('task');
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
|
||||
$categories = $model->getData();
|
||||
$categoryModel = K2Model::getInstance('Category', 'K2Model');
|
||||
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$this->assignRef('params', $params);
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$langs = JLanguageHelper::getLanguages();
|
||||
$langsMapping = array();
|
||||
$langsMapping['*'] = JText::_('K2_ALL');
|
||||
foreach ($langs as $lang)
|
||||
{
|
||||
$langsMapping[$lang->lang_code] = $lang->title;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for ($i = 0; $i < sizeof($categories); $i++)
|
||||
{
|
||||
$categories[$i]->status = K2_JVERSION == '15' ? JHTML::_('grid.published', $categories[$i], $i) : JHtml::_('jgrid.published', $categories[$i]->published, $i, '', $filter_trash == 0 && $task != 'element');
|
||||
if ($params->get('showItemsCounterAdmin'))
|
||||
{
|
||||
$categories[$i]->numOfItems = $categoryModel->countCategoryItems($categories[$i]->id);
|
||||
$categories[$i]->numOfTrashedItems = $categoryModel->countCategoryItems($categories[$i]->id, 1);
|
||||
}
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
$categories[$i]->canChange = $user->authorise('core.edit.state', 'com_k2.category.'.$categories[$i]->id);
|
||||
}
|
||||
// Detect the category template
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$categoryParams = json_decode($categories[$i]->params);
|
||||
$categories[$i]->template = $categoryParams->theme;
|
||||
$categories[$i]->language = $categories[$i]->language ? $categories[$i]->language : '*';
|
||||
if (isset($langsMapping))
|
||||
{
|
||||
$categories[$i]->language = $langsMapping[$categories[$i]->language];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (function_exists('parse_ini_string'))
|
||||
{
|
||||
$categoryParams = parse_ini_string($categories[$i]->params);
|
||||
$categories[$i]->template = $categoryParams['theme'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$categoryParams = new JParameter($categories[$i]->params);
|
||||
$categories[$i]->template = $categoryParams->get('theme');
|
||||
}
|
||||
}
|
||||
if (!$categories[$i]->template)
|
||||
{
|
||||
$categories[$i]->template = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
$this->assignRef('rows', $categories);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
$lists = array();
|
||||
$lists['search'] = $search;
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
|
||||
$filter_trash_options[] = JHTML::_('select.option', 0, JText::_('K2_CURRENT'));
|
||||
$filter_trash_options[] = JHTML::_('select.option', 1, JText::_('K2_TRASHED'));
|
||||
$lists['trash'] = JHTML::_('select.genericlist', $filter_trash_options, 'filter_trash', '', 'value', 'text', $filter_trash);
|
||||
|
||||
$filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
|
||||
$lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
|
||||
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/categories.php';
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$categories_option[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_CATEGORY'));
|
||||
$categoriesFilter = $categoriesModel->categoriesTree(NULL, true, false);
|
||||
$categories_options = @array_merge($categories_option, $categoriesFilter);
|
||||
$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'filter_category', '', 'value', 'text', $filter_category);
|
||||
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
$languages = JHTML::_('contentlanguage.existing', true, true);
|
||||
array_unshift($languages, JHTML::_('select.option', '', JText::_('K2_SELECT_LANGUAGE')));
|
||||
$lists['language'] = JHTML::_('select.genericlist', $languages, 'language', '', 'value', 'text', $language);
|
||||
}
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_CATEGORIES'), 'k2.png');
|
||||
|
||||
if ($filter_trash == 1)
|
||||
{
|
||||
JToolBarHelper::custom('restore', 'publish.png', 'publish_f2.png', 'K2_RESTORE', true);
|
||||
JToolBarHelper::deleteList('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_CATEGORIES', 'remove', 'K2_DELETE');
|
||||
}
|
||||
else
|
||||
{
|
||||
JToolBarHelper::publishList();
|
||||
JToolBarHelper::unpublishList();
|
||||
JToolBarHelper::custom('move', 'move.png', 'move_f2.png', 'K2_MOVE', true);
|
||||
JToolBarHelper::custom('copy', 'copy.png', 'copy_f2.png', 'K2_COPY', true);
|
||||
JToolBarHelper::editList();
|
||||
JToolBarHelper::addNew();
|
||||
JToolBarHelper::trash('trash');
|
||||
}
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
$this->assignRef('filter_trash', $filter_trash);
|
||||
$template = $mainframe->getTemplate();
|
||||
$this->assignRef('template', $template);
|
||||
$ordering = (($this->lists['order'] == 'c.ordering' || $this->lists['order'] == 'c.parent, c.ordering') && (!$this->filter_trash));
|
||||
$this->assignRef('ordering', $ordering);
|
||||
|
||||
// Joomla! 3.0 drag-n-drop sorting variables
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
if ($ordering)
|
||||
{
|
||||
JHtml::_('sortablelist.sortable', 'k2CategoriesList', 'adminForm', strtolower($this->lists['order_Dir']), 'index.php?option=com_k2&view=categories&task=saveorder&format=raw');
|
||||
}
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration('
|
||||
Joomla.orderTable = function() {
|
||||
table = document.getElementById("sortTable");
|
||||
direction = document.getElementById("directionTable");
|
||||
order = table.options[table.selectedIndex].value;
|
||||
if (order != \''.$this->lists['order'].'\') {
|
||||
dirn = \'asc\';
|
||||
} else {
|
||||
dirn = direction.options[direction.selectedIndex].value;
|
||||
}
|
||||
Joomla.tableOrdering(order, dirn, "");
|
||||
}');
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
function move()
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
|
||||
$cid = JRequest::getVar('cid');
|
||||
|
||||
foreach ($cid as $id)
|
||||
{
|
||||
$row = &JTable::getInstance('K2Category', 'Table');
|
||||
$row->load($id);
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$categories_option[] = JHTML::_('select.option', 0, JText::_('K2_NONE_ONSELECTLISTS'));
|
||||
$categories = $categoriesModel->categoriesTree(NULL, true, false);
|
||||
$categories_options = @array_merge($categories_option, $categories);
|
||||
foreach ($categories_options as $option)
|
||||
{
|
||||
if (in_array($option->value, $cid))
|
||||
$option->disable = true;
|
||||
}
|
||||
$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'category', 'class="inputbox" size="8"', 'value', 'text');
|
||||
|
||||
$this->assignRef('rows', $rows);
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_MOVE_CATEGORIES'), 'k2.png');
|
||||
|
||||
JToolBarHelper::custom('saveMove', 'save.png', 'save_f2.png', 'K2_SAVE', false);
|
||||
JToolBarHelper::cancel();
|
||||
|
||||
parent::display();
|
||||
}
|
||||
|
||||
}
|
||||
330
administrator/components/com_k2/views/category/tmpl/default.php
Normal file
330
administrator/components/com_k2/views/category/tmpl/default.php
Normal file
@ -0,0 +1,330 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1822 2013-01-18 16:47:59Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton){
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#name').val()) == '') {
|
||||
alert( '".JText::_('K2_A_CATEGORY_MUST_AT_LEAST_HAVE_A_TITLE', true)."' );
|
||||
} else {
|
||||
".$this->onSave."
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" enctype="multipart/form-data" method="post" name="adminForm" id="adminForm">
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="adminFormK2Container adminK2Category table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="adminFormK2 table">
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="name"><?php echo JText::_('K2_TITLE'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<input class="text_area k2TitleBox" type="text" name="name" id="name" value="<?php echo $this->row->name; ?>" maxlength="250" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="alias"><?php echo JText::_('K2_TITLE_ALIAS'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<input class="text_area k2TitleAliasBox" type="text" name="alias" value="<?php echo $this->row->alias; ?>" maxlength="250" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="parent"><?php echo JText::_('K2_PARENT_CATEGORY'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['parent']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="paramsinheritFrom"><?php echo JText::_('K2_INHERIT_PARAMETER_OPTIONS_FROM_CATEGORY'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['inheritFrom']; ?> <span class="hasTip k2Notice" title="<?php echo JText::_('K2_INHERIT_PARAMETER_OPTIONS_FROM_CATEGORY'); ?>::<?php echo JText::_('K2_SETTING_THIS_OPTION_WILL_MAKE_THIS_CATEGORY_INHERIT_ALL_PARAMETERS_FROM_ANOTHER_CATEGORY_THUS_YOU_DONT_HAVE_TO_RESET_ALL_OPTIONS_IN_THIS_ONE_IF_THEY_ARE_THE_SAME_WITH_ANOTHER_CATEGORYS_THIS_SETTING_IS_VERY_USEFUL_WHEN_YOU_ARE_CREATING_CHILD_CATEGORIES_WHICH_SHARE_THE_SAME_PARAMETERS_WITH_THEIR_PARENT_CATEGORY_EG_IN_THE_CASE_OF_A_CATALOG_OR_A_NEWS_PORTALMAGAZINE'); ?>"><?php echo JText::_('K2_LEARN_WHAT_THIS_MEANS'); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="extraFieldsGroup"><?php echo JText::_('K2_ASSOCIATED_EXTRA_FIELDS_GROUP'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['extraFieldsGroup']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label><?php echo JText::_('K2_PUBLISHED'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol k2RadioButtonContainer">
|
||||
<?php echo $this->lists['published']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="access"><?php echo JText::_('K2_ACCESS_LEVEL'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['access']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label><?php echo JText::_('K2_LANGUAGE'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['language']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<!-- Tabs start here -->
|
||||
<div class="simpleTabs" id="k2Tabs">
|
||||
<ul class="simpleTabsNavigation">
|
||||
<li id="tabContent"><a href="#k2Tab1"><?php echo JText::_('K2_DESCRIPTION'); ?></a></li>
|
||||
<li id="tabImage"><a href="#k2Tab2"><?php echo JText::_('K2_IMAGE'); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab content -->
|
||||
<div class="simpleTabsContent" id="k2Tab1">
|
||||
<div class="k2ItemFormEditor"> <span class="k2ItemFormEditorTitle"> <?php echo JText::_('K2_CATEGORY_DESCRIPTION'); ?> </span> <?php echo $this->editor; ?>
|
||||
<div class="dummyHeight"></div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<!-- Tab image -->
|
||||
<div class="simpleTabsContent" id="k2Tab2">
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_CATEGORY_IMAGE'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="file" name="image" class="fileUpload" />
|
||||
<i>(<?php echo JText::_('K2_MAX_UPLOAD_SIZE'); ?>: <?php echo ini_get('upload_max_filesize'); ?>)</i>
|
||||
<br />
|
||||
<br />
|
||||
<input type="text" name="existingImage" id="existingImageValue" class="text_area" readonly />
|
||||
<input type="button" value="<?php echo JText::_('K2_BROWSE_SERVER'); ?>" id="k2ImageBrowseServer" />
|
||||
<br />
|
||||
<br />
|
||||
<?php if (!empty($this->row->image)): ?>
|
||||
<img src="<?php echo JURI::root(true); ?>/media/k2/categories/<?php echo $this->row->image; ?>" alt="<?php echo $this->row->name; ?>" class="k2AdminImage" />
|
||||
<input type="checkbox" name="del_image" id="del_image" />
|
||||
<label for="del_image"><?php echo JText::_('K2_CHECK_THIS_BOX_TO_DELETE_CURRENT_IMAGE_OR_JUST_UPLOAD_A_NEW_IMAGE_TO_REPLACE_THE_EXISTING_ONE'); ?></label>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tabs end here -->
|
||||
|
||||
<!-- K2 Category Plugins -->
|
||||
<?php if (count($this->K2Plugins)): ?>
|
||||
<div class="itemPlugins">
|
||||
<?php foreach ($this->K2Plugins as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="clr"></div>
|
||||
</td>
|
||||
<td id="adminFormK2Sidebar" class="xmlParamsFields">
|
||||
<div id="k2Accordion">
|
||||
<h3><a href="#"><?php echo JText::_('K2_CATEGORY_ITEM_LAYOUT'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(K2_JVERSION != '15'): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach ($this->form->getFieldset('category-item-layout') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'category-item-layout'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h3><a href="#"><?php echo JText::_('K2_CATEGORY_VIEW_OPTIONS'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(K2_JVERSION != '15'): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach ($this->form->getFieldset('category-view-options') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'category-view-options'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h3><a href="#"><?php echo JText::_('K2_ITEM_IMAGE_OPTIONS'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(K2_JVERSION != '15'): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach ($this->form->getFieldset('item-image-options') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'item-image-options'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h3><a href="#"><?php echo JText::_('K2_ITEM_VIEW_OPTIONS_IN_CATEGORY_LISTINGS'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(K2_JVERSION != '15'): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach ($this->form->getFieldset('item-view-options-listings') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'item-view-options-listings'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h3><a href="#"><?php echo JText::_('K2_ITEM_VIEW_OPTIONS'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(K2_JVERSION != '15'): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach ($this->form->getFieldset('item-view-options') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'item-view-options'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h3><a href="#"><?php echo JText::_('K2_METADATA_INFORMATION'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(K2_JVERSION != '15'): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach ($this->form->getFieldset('category-metadata-information') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'category-metadata-information'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if($this->aceAclFlag): ?>
|
||||
<h3><a href="#"><?php echo JText::_('AceACL') . ' ' . JText::_('COM_ACEACL_COMMON_PERMISSIONS'); ?></a></h3>
|
||||
<div><?php AceaclApi::getWidget('com_k2.category.'.$this->row->id, true); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="category" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</form>
|
||||
129
administrator/components/com_k2/views/category/view.html.php
Normal file
129
administrator/components/com_k2/views/category/view.html.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1962 2013-04-29 12:29:34Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewCategory extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
$model = $this->getModel();
|
||||
$category = $model->getData();
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
JFilterOutput::objectHTMLSafe($category);
|
||||
}
|
||||
else
|
||||
{
|
||||
JFilterOutput::objectHTMLSafe($category, ENT_QUOTES, array('params', 'plugins'));
|
||||
}
|
||||
if (!$category->id)
|
||||
$category->published = 1;
|
||||
$this->assignRef('row', $category);
|
||||
$wysiwyg = JFactory::getEditor();
|
||||
$editor = $wysiwyg->display('description', $category->description, '100%', '250px', '', '', array('pagebreak', 'readmore'));
|
||||
$this->assignRef('editor', $editor);
|
||||
$onSave = '';
|
||||
if(K2_JVERSION == '30')
|
||||
{
|
||||
$onSave = $wysiwyg->save('description');
|
||||
}
|
||||
$this->assignRef('onSave', $onSave);
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
/*
|
||||
$js = "
|
||||
var K2SitePath = '".JURI::root(true)."/';
|
||||
var K2BasePath = '".JURI::base(true)."/';
|
||||
";
|
||||
*/
|
||||
$document->addScriptDeclaration("var K2BasePath = '".JURI::base(true)."/';");
|
||||
|
||||
$lists = array();
|
||||
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $category->published);
|
||||
$lists['access'] = version_compare(JVERSION, '3.0', 'ge') ? JHTML::_('access.level', 'access', $category->access) : JHTML::_('list.accesslevel', $category);
|
||||
$query = 'SELECT ordering AS value, name AS text FROM #__k2_categories ORDER BY ordering';
|
||||
$lists['ordering'] = version_compare(JVERSION, '3.0', 'ge') ? NUll : JHTML::_('list.specificordering', $category, $category->id, $query);
|
||||
$categories[] = JHTML::_('select.option', '0', JText::_('K2_NONE_ONSELECTLISTS'));
|
||||
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/categories.php';
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$tree = $categoriesModel->categoriesTree($category, true, false);
|
||||
$categories = array_merge($categories, $tree);
|
||||
$lists['parent'] = JHTML::_('select.genericlist', $categories, 'parent', 'class="inputbox"', 'value', 'text', $category->parent);
|
||||
|
||||
$extraFieldsModel = K2Model::getInstance('ExtraFields', 'K2Model');
|
||||
$groups = $extraFieldsModel->getGroups();
|
||||
$group[] = JHTML::_('select.option', '0', JText::_('K2_NONE_ONSELECTLISTS'), 'id', 'name');
|
||||
$group = array_merge($group, $groups);
|
||||
$lists['extraFieldsGroup'] = JHTML::_('select.genericlist', $group, 'extraFieldsGroup', 'class="inputbox" size="1" ', 'id', 'name', $category->extraFieldsGroup);
|
||||
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
$languages = JHTML::_('contentlanguage.existing', true, true);
|
||||
$lists['language'] = JHTML::_('select.genericlist', $languages, 'language', '', 'value', 'text', $category->language);
|
||||
}
|
||||
|
||||
JPluginHelper::importPlugin('k2');
|
||||
$dispatcher = JDispatcher::getInstance();
|
||||
$K2Plugins = $dispatcher->trigger('onRenderAdminForm', array(&$category, 'category'));
|
||||
$this->assignRef('K2Plugins', $K2Plugins);
|
||||
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$this->assignRef('params', $params);
|
||||
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
jimport('joomla.form.form');
|
||||
$form = JForm::getInstance('categoryForm', JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'category.xml');
|
||||
$values = array('params' => json_decode($category->params));
|
||||
$form->bind($values);
|
||||
$inheritFrom = (isset($values['params']->inheritFrom)) ? $values['params']->inheritFrom : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$form = new JParameter('', JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'category.xml');
|
||||
$form->loadINI($category->params);
|
||||
$inheritFrom = $form->get('inheritFrom');
|
||||
}
|
||||
$this->assignRef('form', $form);
|
||||
|
||||
$categories[0] = JHTML::_('select.option', '0', JText::_('K2_NONE_ONSELECTLISTS'));
|
||||
$lists['inheritFrom'] = JHTML::_('select.genericlist', $categories, 'params[inheritFrom]', 'class="inputbox"', 'value', 'text', $inheritFrom);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
(JRequest::getInt('cid')) ? $title = JText::_('K2_EDIT_CATEGORY') : $title = JText::_('K2_ADD_CATEGORY');
|
||||
JToolBarHelper::title($title, 'k2.png');
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::custom('saveAndNew', 'save.png', 'save_f2.png', 'K2_SAVE_AND_NEW', false);
|
||||
JToolBarHelper::apply();
|
||||
JToolBarHelper::cancel();
|
||||
|
||||
// ACE ACL integration
|
||||
$definedConstants = get_defined_constants();
|
||||
if (!empty($definedConstants['ACEACL']) && AceaclApi::authorize('permissions', 'com_aceacl'))
|
||||
{
|
||||
$aceAclFlag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aceAclFlag = false;
|
||||
}
|
||||
$this->assignRef('aceAclFlag', $aceAclFlag);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
225
administrator/components/com_k2/views/comments/tmpl/default.php
Normal file
225
administrator/components/com_k2/views/comments/tmpl/default.php
Normal file
@ -0,0 +1,225 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'remove') {
|
||||
if (document.adminForm.boxchecked.value==0){
|
||||
alert('<?php echo JText::_('K2_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST_TO_DELETE', true); ?>');
|
||||
return false;
|
||||
}
|
||||
if (confirm('<?php echo JText::_('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_COMMENTS', true); ?>')){
|
||||
submitform( pressbutton );
|
||||
}
|
||||
} else if (pressbutton == 'deleteUnpublished') {
|
||||
if (confirm('<?php echo JText::_('K2_THIS_WILL_PERMANENTLY_DELETE_ALL_UNPUBLISHED_COMMENTS_ARE_YOU_SURE', true); ?>')){
|
||||
submitform( pressbutton );
|
||||
}
|
||||
} else if (pressbutton == 'publish') {
|
||||
if (document.adminForm.boxchecked.value==0){
|
||||
alert('<?php echo JText::_('K2_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST_TO_PUBLISH', true); ?>');
|
||||
return false;
|
||||
}
|
||||
submitform( pressbutton );
|
||||
} else if (pressbutton == 'unpublish') {
|
||||
if (document.adminForm.boxchecked.value==0){
|
||||
alert('<?php echo JText::_('K2_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST_TO_UNPUBLISH', true); ?>');
|
||||
return false;
|
||||
}
|
||||
submitform( pressbutton );
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<form action="<?php echo JRoute::_('index.php'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<?php if($this->mainframe->isSite()): ?>
|
||||
<div id="k2FrontendContainer">
|
||||
<div id="k2Frontend">
|
||||
<table class="k2FrontendToolbar" cellpadding="2" cellspacing="4">
|
||||
<tr>
|
||||
<td id="toolbar-publish" class="button">
|
||||
<a class="toolbar" onclick="Joomla.submitbutton('publish'); return false;" href="#"><?php echo JText::_('K2_PUBLISH'); ?></a>
|
||||
</td>
|
||||
<td id="toolbar-unpublish" class="button">
|
||||
<a class="toolbar" onclick="Joomla.submitbutton('unpublish'); return false;" href="#"><?php echo JText::_('K2_UNPUBLISH'); ?></a>
|
||||
</td>
|
||||
<td id="toolbar-delete" class="button">
|
||||
<a class="toolbar" onclick="Joomla.submitbutton('remove'); return false;" href="#"><?php echo JText::_('K2_DELETE'); ?></a>
|
||||
</td>
|
||||
<td id="toolbar-Link" class="button">
|
||||
<a onclick="Joomla.submitbutton('deleteUnpublished'); return false;" href="#"><?php echo JText::_('K2_DELETE_ALL_UNPUBLISHED'); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="k2FrontendEditToolbar">
|
||||
<h2 class="header icon-48-k2"><?php echo JText::_('K2_MODERATE_COMMENTS_TO_MY_ITEMS'); ?></h2>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
<hr class="sep" />
|
||||
<?php endif; ?>
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_COMMENT'); ?>"/>
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['categories']; ?>
|
||||
<?php if($this->mainframe->isAdmin()): ?>
|
||||
<?php echo $this->lists['authors']; ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->lists['state']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="center hidden-phone">
|
||||
#
|
||||
</th>
|
||||
<th class="center">
|
||||
<input id="jToggler" type="checkbox" name="toggle" value="" />
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_COMMENT', 'c.commentText', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="center">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_PUBLISHED', 'c.published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="hidden-phone">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_NAME', 'c.userName', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_EMAIL', 'c.commentEmail', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="hidden-phone">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_URL', 'c.commentURL', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="center hidden-phone">
|
||||
<?php echo JText::_('K2_LAST_RECORDED_IP'); ?>
|
||||
</th>
|
||||
<th class="center">
|
||||
<?php echo JText::_('K2_FLAG_AS_SPAMMER'); ?>
|
||||
</th>
|
||||
<th class="hidden-phone">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ITEM', 'i.title', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="hidden-phone">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_CATEGORY', 'cat.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="hidden-phone">
|
||||
<?php echo JText::_('K2_AUTHOR'); ?>
|
||||
</th>
|
||||
<th class="hidden-phone">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_DATE', 'c.commentDate', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th class="hidden-phone">
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ID', 'c.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="15">
|
||||
<div class="k2CommentsPagination">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key=>$row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td class="center hidden-phone">
|
||||
<?php echo $key+1; ?>
|
||||
</td>
|
||||
<td class="center">
|
||||
<?php $row->checked_out = 0; echo @JHTML::_('grid.checkedout', $row, $key ); ?>
|
||||
</td>
|
||||
<td id="k2Comment<?php echo $row->id; ?>">
|
||||
<div class="commentText"><?php echo $row->commentText; ?></div>
|
||||
<div class="commentToolbar"><span class="k2CommentsLog"></span> <a href="#" rel="<?php echo $row->id; ?>" class="editComment"><?php echo JText::_('K2_EDIT'); ?></a> <a href="#" rel="<?php echo $row->id; ?>" class="saveComment"><?php echo JText::_('K2_SAVE'); ?></a> <a href="#" rel="<?php echo $row->id; ?>" class="closeComment"><?php echo JText::_('K2_CANCEL'); ?></a>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<input type="hidden" name="currentValue[]" value="<?php echo $row->commentText; ?>" />
|
||||
</td>
|
||||
<td class="k2Center center">
|
||||
<?php echo $row->status; ?>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<?php if($this->mainframe->isAdmin() && $row->userID): ?>
|
||||
<a href="<?php echo $this->userEditLink.$row->userID;?>"><?php echo $row->userName; ?></a>
|
||||
<?php else :?>
|
||||
<?php echo $row->userName; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="k2ForceWrap">
|
||||
<?php echo $row->commentEmail; ?>
|
||||
</td>
|
||||
<td class="k2ForceWrap hidden-phone">
|
||||
<a target="_blank" href="<?php echo JFilterOutput::cleanText($row->commentURL); ?>"><?php echo str_replace(array('http://www.','https://www.','http://','https://'),array('','','',''),$row->commentURL); ?></a>
|
||||
</td>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php if($row->commenterLastVisitIP): ?>
|
||||
<a target="_blank" href="http://www.ipchecking.com/?ip=<?php echo $row->commenterLastVisitIP; ?>&check=Lookup">
|
||||
<?php echo $row->commenterLastVisitIP; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="k2Center center">
|
||||
<?php if($row->reportUserLink): ?>
|
||||
<a class="k2ReportUserButton k2IsIcon" href="<?php echo $row->reportUserLink; ?>">×</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<a class="modal" rel="{handler: 'iframe', size: {x: 1000, y: 600}}" href="<?php echo JURI::root().K2HelperRoute::getItemRoute($row->itemID.':'.urlencode($row->itemAlias),$row->catid.':'.urlencode($row->catAlias)); ?>"><?php echo $row->title; ?></a>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<?php echo $row->catName; ?>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<?php $user = JFactory::getUser($row->created_by); echo $user->name; ?>
|
||||
</td>
|
||||
<td class="k2Date hidden-phone">
|
||||
<?php echo JHTML::_('date', $row->commentDate , $this->dateFormat); ?>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<?php echo $row->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="isSite" value="<?php echo (int)$this->mainframe->isSite(); ?>" />
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getCmd('view'); ?>" />
|
||||
<input type="hidden" id="task" name="task" value="" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<input type="hidden" id="commentID" name="commentID" value="" />
|
||||
<input type="hidden" id="commentText" name="commentText" value="" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
<?php if($this->mainframe->isSite()): ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
207
administrator/components/com_k2/views/comments/view.html.php
Normal file
207
administrator/components/com_k2/views/comments/view.html.php
Normal file
@ -0,0 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1988 2013-06-27 11:58:48Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewComments extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', 'c.id', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
|
||||
$filter_state = $mainframe->getUserStateFromRequest($option.$view.'filter_state', 'filter_state', -1, 'int');
|
||||
$filter_category = $mainframe->getUserStateFromRequest($option.$view.'filter_category', 'filter_category', 0, 'int');
|
||||
$filter_author = $mainframe->getUserStateFromRequest($option.$view.'filter_author', 'filter_author', 0, 'int');
|
||||
$search = $mainframe->getUserStateFromRequest($option.$view.'search', 'search', '', 'string');
|
||||
$search = JString::strtolower($search);
|
||||
if ($mainframe->isSite())
|
||||
{
|
||||
$filter_author = $user->id;
|
||||
JRequest::setVar('filter_author', $user->id);
|
||||
}
|
||||
$this->loadHelper('html');
|
||||
K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models');
|
||||
$model = K2Model::getInstance('Comments', 'K2Model');
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$total = $model->getTotal();
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
$comments = $model->getData();
|
||||
|
||||
$reportLink = $mainframe->isAdmin() ? 'index.php?option=com_k2&view=user&task=report&id=' : 'index.php?option=com_k2&view=comments&task=reportSpammer&id=';
|
||||
foreach ($comments as $key => $comment)
|
||||
{
|
||||
$comment->reportUserLink = false;
|
||||
$comment->commenterLastVisitIP = NULL;
|
||||
if ($comment->userID)
|
||||
{
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
$db->setQuery("SELECT ip FROM #__k2_users WHERE userID = ".$comment->userID);
|
||||
$comment->commenterLastVisitIP = $db->loadResult();
|
||||
|
||||
$commenter = JFactory::getUser($comment->userID);
|
||||
if ($commenter->name)
|
||||
{
|
||||
$comment->userName = $commenter->name;
|
||||
}
|
||||
if ($mainframe->isSite())
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
if ($user->authorise('core.admin', 'com_k2'))
|
||||
{
|
||||
$comment->reportUserLink = JRoute::_($reportLink.$comment->userID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($user->gid > 24)
|
||||
{
|
||||
$comment->reportUserLink = JRoute::_($reportLink.$comment->userID);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$comment->reportUserLink = JRoute::_($reportLink.$comment->userID);
|
||||
}
|
||||
}
|
||||
|
||||
if ($mainframe->isSite())
|
||||
{
|
||||
$comment->status = K2HelperHTML::stateToggler($comment, $key);
|
||||
}
|
||||
else
|
||||
{
|
||||
$comment->status = K2_JVERSION == '15' ? JHTML::_('grid.published', $comment, $key) : JHtml::_('jgrid.published', $comment->published, $key);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->assignRef('rows', $comments);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
$lists = array();
|
||||
$lists['search'] = $search;
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
|
||||
$filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
|
||||
$lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
|
||||
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/categories.php';
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$categories_option[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_CATEGORY'));
|
||||
$categories = $categoriesModel->categoriesTree(null, true, false);
|
||||
$categories_options = @array_merge($categories_option, $categories);
|
||||
$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'filter_category', '', 'value', 'text', $filter_category);
|
||||
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/items.php';
|
||||
$itemsModel = K2Model::getInstance('Items', 'K2Model');
|
||||
$authors = $itemsModel->getItemsAuthors();
|
||||
$options = array();
|
||||
$options[] = JHTML::_('select.option', 0, '- '.JText::_('K2_NO_USER').' -');
|
||||
foreach ($authors as $author)
|
||||
{
|
||||
$name = $author->name;
|
||||
if ($author->block)
|
||||
{
|
||||
$name .= ' ['.JText::_('K2_USER_DISABLED').']';
|
||||
}
|
||||
$options[] = JHTML::_('select.option', $author->id, $name);
|
||||
}
|
||||
$lists['authors'] = JHTML::_('select.genericlist', $options, 'filter_author', '', 'value', 'text', $filter_author);
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('mainframe', $mainframe);
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$dateFormat = JText::_('K2_J16_DATE_FORMAT');
|
||||
}
|
||||
else
|
||||
{
|
||||
$dateFormat = JText::_('K2_DATE_FORMAT');
|
||||
}
|
||||
$this->assignRef('dateFormat', $dateFormat);
|
||||
|
||||
if ($mainframe->isAdmin())
|
||||
{
|
||||
JToolBarHelper::title(JText::_('K2_COMMENTS'), 'k2.png');
|
||||
JToolBarHelper::publishList();
|
||||
JToolBarHelper::unpublishList();
|
||||
JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
|
||||
JToolBarHelper::custom('deleteUnpublished', 'delete', 'delete', 'K2_DELETE_ALL_UNPUBLISHED', false);
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$userEditLink = JURI::base().'index.php?option=com_k2&view=user&cid=';
|
||||
}
|
||||
else
|
||||
{
|
||||
$userEditLink = JURI::base().'index.php?option=com_k2&view=user&cid=';
|
||||
}
|
||||
$this->assignRef('userEditLink', $userEditLink);
|
||||
|
||||
}
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration('var K2Language = ["'.JText::_('K2_YOU_CANNOT_EDIT_TWO_COMMENTS_AT_THE_SAME_TIME', true).'", "'.JText::_('K2_THIS_WILL_PERMANENTLY_DELETE_ALL_UNPUBLISHED_COMMENTS_ARE_YOU_SURE', true).'", "'.JText::_('K2_REPORT_USER_WARNING', true).'"];');
|
||||
|
||||
if ($mainframe->isSite())
|
||||
{
|
||||
// CSS
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.frontend.css?v=2.6.7');
|
||||
$document->addStyleSheet(JURI::root(true).'/templates/system/css/general.css');
|
||||
$document->addStyleSheet(JURI::root(true).'/templates/system/css/system.css');
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$document->addStyleSheet(JURI::root(true).'/administrator/templates/bluestork/css/template.css');
|
||||
$document->addStyleSheet(JURI::root(true).'/media/system/css/system.css');
|
||||
}
|
||||
else
|
||||
{
|
||||
$document->addStyleSheet(JURI::root(true).'/administrator/templates/khepri/css/general.css');
|
||||
}
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1991 2013-07-04 14:59:52Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#group').val()) == '') {
|
||||
alert( '".JText::_('K2_PLEASE_SELECT_A_GROUP_OR_CREATE_A_NEW_ONE', true)."' );
|
||||
}
|
||||
else if (\$K2.trim(\$K2('#name').val()) == '') {
|
||||
alert( '".JText::_('K2_NAME_CANNOT_BE_EMPTY', true)."' );
|
||||
}
|
||||
else if (\$K2('#type').val() == '0') {
|
||||
alert( '".JText::_('K2_PLEASE_SELECT_THE_TYPE_OF_THE_EXTRA_FIELD', true)."' );
|
||||
}
|
||||
else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" enctype="multipart/form-data" name="adminForm" id="adminForm">
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_NAME'); ?></td>
|
||||
<td><input class="text_area k2TitleBox" type="text" name="name" id="name" value="<?php echo $this->row->name; ?>" size="50" maxlength="250" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_ALIAS'); ?></td>
|
||||
<td><input id="alias" type="text" name="alias" value="<?php echo $this->row->alias; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_PUBLISHED'); ?></td>
|
||||
<td><?php echo $this->lists['published']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_GROUP'); ?></td>
|
||||
<td>
|
||||
<?php echo $this->lists['group']; ?>
|
||||
<div id="groupContainer">
|
||||
<span><?php echo JText::_('K2_NEW_GROUP_NAME'); ?></span>
|
||||
<input id="group" type="text" name="group" value="<?php echo $this->row->group; ?>" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_TYPE'); ?></td>
|
||||
<td><?php echo $this->lists['type']; ?></td>
|
||||
</tr>
|
||||
<tr id="k2ExtraFieldsRequiredFlag" <?php if($this->row->type == 'header') { echo 'style="display: none;"'; } ?>>
|
||||
<td class="key"><?php echo JText::_('K2_REQUIRED'); ?></td>
|
||||
<td>
|
||||
<input id="required-yes" type="radio" name="required" value="1" <?php if($this->row->required) { echo 'checked="checked"';} ?>/><label for="required-yes"><?php echo JText::_('K2_YES'); ?></label>
|
||||
<input id="required-no" type="radio" name="required" value="0"<?php if(!$this->row->required) { echo 'checked="checked"';} ?>/><label for="required-no"><?php echo JText::_('K2_NO'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="k2ExtraFieldsShowNullFlag" <?php if($this->row->type != 'select' && $this->row->type != 'multipleSelect') { echo 'style="display: none;"'; } ?>>
|
||||
<td class="key"><?php echo JText::_('K2_SHOW_NULL'); ?></td>
|
||||
<td>
|
||||
<input id="showNull-yes" type="radio" name="showNull" value="1" <?php if($this->row->showNull) { echo 'checked="checked"';} ?>/><label for="showNull-yes"><?php echo JText::_('K2_YES'); ?></label>
|
||||
<input id="showNull-no" type="radio" name="showNull" value="0"<?php if(!$this->row->showNull) { echo 'checked="checked"';} ?>/><label for="showNull-no"><?php echo JText::_('K2_NO'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="k2ExtraFieldsDisplayInFrontEndFlag" <?php if($this->row->type != 'header') { echo 'style="display: none;"'; } ?>>
|
||||
<td class="key"><?php echo JText::_('K2_DISPLAY_IN_THE_FRONTEND'); ?></td>
|
||||
<td>
|
||||
<input id="displayInFrontEnd-yes" type="radio" name="displayInFrontEnd" value="1" <?php if($this->row->displayInFrontEnd) { echo 'checked="checked"';} ?>/><label for="displayInFrontEnd-yes"><?php echo JText::_('K2_YES'); ?></label>
|
||||
<input id="displayInFrontEnd-no" type="radio" name="displayInFrontEnd" value="0"<?php if(!$this->row->displayInFrontEnd) { echo 'checked="checked"';} ?>/><label for="displayInFrontEnd-no"><?php echo JText::_('K2_NO'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_DEFAULT_VALUES'); ?></td>
|
||||
<td><div id="exFieldsTypesDiv"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
|
||||
<input type="hidden" name="isNew" id="isNew" value="<?php echo ($this->row->group)?'0':'1'; ?>" />
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<input type="hidden" id="value" name="value" value="<?php echo htmlentities($this->row->value); ?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
142
administrator/components/com_k2/views/extrafield/view.html.php
Normal file
142
administrator/components/com_k2/views/extrafield/view.html.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1965 2013-04-29 16:01:44Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewExtraField extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
JHTML::_('behavior.keepalive');
|
||||
$model = $this->getModel();
|
||||
$extraField = $model->getData();
|
||||
if (!$extraField->id)
|
||||
{
|
||||
$extraField->published = 1;
|
||||
$extraField->alias = '';
|
||||
$extraField->required = 1;
|
||||
$extraField->showNull = 0;
|
||||
$extraField->displayInFrontEnd = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once (JPATH_COMPONENT.DS.'lib'.DS.'JSON.php');
|
||||
$json = new Services_JSON;
|
||||
$values = $json->decode($extraField->value);
|
||||
if (isset($values[0]->alias) && !empty($values[0]->alias))
|
||||
{
|
||||
$extraField->alias = $values[0]->alias;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extraField->alias = $extraField->name;
|
||||
}
|
||||
$searches = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'à', 'á', 'â', 'ã', 'ä', 'å', 'Ā', 'ā', 'Ă', 'ă', 'Ą', 'ą', 'Ç', 'ç', 'Ć', 'ć', 'Ĉ', 'ĉ', 'Ċ', 'ċ', 'Č', 'č', 'Ð', 'ð', 'Ď', 'ď', 'Đ', 'đ', 'È', 'É', 'Ê', 'Ë', 'è', 'é', 'ê', 'ë', 'Ē', 'ē', 'Ĕ', 'ĕ', 'Ė', 'ė', 'Ę', 'ę', 'Ě', 'ě', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ģ', 'ģ', 'Ĥ', 'ĥ', 'Ħ', 'ħ', 'Ì', 'Í', 'Î', 'Ï', 'ì', 'í', 'î', 'ï', 'Ĩ', 'ĩ', 'Ī', 'ī', 'Ĭ', 'ĭ', 'Į', 'į', 'İ', 'ı', 'Ĵ', 'ĵ', 'Ķ', 'ķ', 'ĸ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'Ñ', 'ñ', 'Ń', 'ń', 'Ņ', 'ņ', 'Ň', 'ň', 'ʼn', 'Ŋ', 'ŋ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'Ō', 'ō', 'Ŏ', 'ŏ', 'Ő', 'ő', 'Ŕ', 'ŕ', 'Ŗ', 'ŗ', 'Ř', 'ř', 'Ś', 'ś', 'Ŝ', 'ŝ', 'Ş', 'ş', 'Š', 'š', 'ſ', 'Ţ', 'ţ', 'Ť', 'ť', 'Ŧ', 'ŧ', 'Ù', 'Ú', 'Û', 'Ü', 'ù', 'ú', 'û', 'ü', 'Ũ', 'ũ', 'Ū', 'ū', 'Ŭ', 'ŭ', 'Ů', 'ů', 'Ű', 'ű', 'Ų', 'ų', 'Ŵ', 'ŵ', 'Ý', 'ý', 'ÿ', 'Ŷ', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ', 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω', 'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω', 'ά', 'έ', 'ή', 'ί', 'ό', 'ύ', 'ώ', 'Ά', 'Έ', 'Ή', 'Ί', 'Ό', 'Ύ', 'Ώ', 'ϊ', 'ΐ', 'ϋ', 'ς', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'А', 'Ӑ', 'Ӓ', 'Ә', 'Ӛ', 'Ӕ', 'Б', 'В', 'Г', 'Ґ', 'Ѓ', 'Ғ', 'Ӷ', 'y', 'Д', 'Е', 'Ѐ', 'Ё', 'Ӗ', 'Ҽ', 'Ҿ', 'Є', 'Ж', 'Ӂ', 'Җ', 'Ӝ', 'З', 'Ҙ', 'Ӟ', 'Ӡ', 'Ѕ', 'И', 'Ѝ', 'Ӥ', 'Ӣ', 'І', 'Ї', 'Ӏ', 'Й', 'Ҋ', 'Ј', 'К', 'Қ', 'Ҟ', 'Ҡ', 'Ӄ', 'Ҝ', 'Л', 'Ӆ', 'Љ', 'М', 'Ӎ', 'Н', 'Ӊ', 'Ң', 'Ӈ', 'Ҥ', 'Њ', 'О', 'Ӧ', 'Ө', 'Ӫ', 'Ҩ', 'П', 'Ҧ', 'Р', 'Ҏ', 'С', 'Ҫ', 'Т', 'Ҭ', 'Ћ', 'Ќ', 'У', 'Ў', 'Ӳ', 'Ӱ', 'Ӯ', 'Ү', 'Ұ', 'Ф', 'Х', 'Ҳ', 'Һ', 'Ц', 'Ҵ', 'Ч', 'Ӵ', 'Ҷ', 'Ӌ', 'Ҹ', 'Џ', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ӹ', 'Ь', 'Ҍ', 'Э', 'Ӭ', 'Ю', 'Я', 'а', 'ӑ', 'ӓ', 'ә', 'ӛ', 'ӕ', 'б', 'в', 'г', 'ґ', 'ѓ', 'ғ', 'ӷ', 'y', 'д', 'е', 'ѐ', 'ё', 'ӗ', 'ҽ', 'ҿ', 'є', 'ж', 'ӂ', 'җ', 'ӝ', 'з', 'ҙ', 'ӟ', 'ӡ', 'ѕ', 'и', 'ѝ', 'ӥ', 'ӣ', 'і', 'ї', 'Ӏ', 'й', 'ҋ', 'ј', 'к', 'қ', 'ҟ', 'ҡ', 'ӄ', 'ҝ', 'л', 'ӆ', 'љ', 'м', 'ӎ', 'н', 'ӊ', 'ң', 'ӈ', 'ҥ', 'њ', 'о', 'ӧ', 'ө', 'ӫ', 'ҩ', 'п', 'ҧ', 'р', 'ҏ', 'с', 'ҫ', 'т', 'ҭ', 'ћ', 'ќ', 'у', 'ў', 'ӳ', 'ӱ', 'ӯ', 'ү', 'ұ', 'ф', 'х', 'ҳ', 'һ', 'ц', 'ҵ', 'ч', 'ӵ', 'ҷ', 'ӌ', 'ҹ', 'џ', 'ш', 'щ', 'ъ', 'ы', 'ӹ', 'ь', 'ҍ', 'э', 'ӭ', 'ю', 'я');
|
||||
$replacements = array('A', 'A', 'A', 'A', 'A', 'A', 'a', 'a', 'a', 'a', 'a', 'a', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D', 'd', 'D', 'd', 'E', 'E', 'E', 'E', 'e', 'e', 'e', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'I', 'I', 'I', 'i', 'i', 'i', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'J', 'j', 'K', 'k', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'N', 'n', 'O', 'O', 'O', 'O', 'O', 'O', 'o', 'o', 'o', 'o', 'o', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'U', 'U', 'U', 'u', 'u', 'u', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'y', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 'a', 'b', 'g', 'd', 'e', 'z', 'h', 'th', 'i', 'k', 'l', 'm', 'n', 'x', 'o', 'p', 'r', 's', 't', 'y', 'f', 'ch', 'ps', 'w', 'A', 'B', 'G', 'D', 'E', 'Z', 'H', 'Th', 'I', 'K', 'L', 'M', 'X', 'O', 'P', 'R', 'S', 'T', 'Y', 'F', 'Ch', 'Ps', 'W', 'a', 'e', 'h', 'i', 'o', 'y', 'w', 'A', 'E', 'H', 'I', 'O', 'Y', 'W', 'i', 'i', 'y', 's', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Zero', 'A', 'A', 'A', 'E', 'E', 'E', 'B', 'V', 'G', 'G', 'G', 'G', 'G', 'Y', 'D', 'E', 'E', 'YO', 'E', 'E', 'E', 'YE', 'ZH', 'DZH', 'ZH', 'DZH', 'Z', 'Z', 'DZ', 'DZ', 'DZ', 'I', 'I', 'I', 'I', 'I', 'JI', 'I', 'Y', 'Y', 'J', 'K', 'Q', 'Q', 'K', 'Q', 'K', 'L', 'L', 'L', 'M', 'M', 'N', 'N', 'N', 'N', 'N', 'N', 'O', 'O', 'O', 'O', 'O', 'P', 'PF', 'P', 'P', 'S', 'S', 'T', 'TH', 'T', 'K', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'F', 'H', 'H', 'H', 'TS', 'TS', 'CH', 'CH', 'CH', 'CH', 'CH', 'DZ', 'SH', 'SHT', 'A', 'Y', 'Y', 'Y', 'Y', 'E', 'E', 'YU', 'YA', 'a', 'a', 'a', 'e', 'e', 'e', 'b', 'v', 'g', 'g', 'g', 'g', 'g', 'y', 'd', 'e', 'e', 'yo', 'e', 'e', 'e', 'ye', 'zh', 'dzh', 'zh', 'dzh', 'z', 'z', 'dz', 'dz', 'dz', 'i', 'i', 'i', 'i', 'i', 'ji', 'i', 'y', 'y', 'j', 'k', 'q', 'q', 'k', 'q', 'k', 'l', 'l', 'l', 'm', 'm', 'n', 'n', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'o', 'p', 'pf', 'p', 'p', 's', 's', 't', 'th', 't', 'k', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'f', 'h', 'h', 'h', 'ts', 'ts', 'ch', 'ch', 'ch', 'ch', 'ch', 'dz', 'sh', 'sht', 'a', 'y', 'y', 'y', 'y', 'e', 'e', 'yu', 'ya');
|
||||
$extraField->alias = str_replace($searches, $replacements, $extraField->alias);
|
||||
$filter = JFilterInput::getInstance();
|
||||
$extraField->alias = $filter->clean($extraField->alias, 'WORD');
|
||||
|
||||
if (isset($values[0]->required))
|
||||
{
|
||||
$extraField->required = $values[0]->required;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extraField->required = 0;
|
||||
}
|
||||
if (isset($values[0]->showNull))
|
||||
{
|
||||
$extraField->showNull = $values[0]->showNull;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extraField->showNull = 0;
|
||||
}
|
||||
if (isset($values[0]->displayInFrontEnd))
|
||||
{
|
||||
$extraField->displayInFrontEnd = $values[0]->displayInFrontEnd;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extraField->displayInFrontEnd = 0;
|
||||
}
|
||||
}
|
||||
$extraField->name = htmlspecialchars($extraField->name, ENT_QUOTES, 'UTF-8');
|
||||
$this->assignRef('row', $extraField);
|
||||
|
||||
$lists = array();
|
||||
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $extraField->published);
|
||||
|
||||
$groups[] = JHTML::_('select.option', 0, JText::_('K2_CREATE_NEW_GROUP'));
|
||||
|
||||
$extraFieldModel = K2Model::getInstance('ExtraFields', 'K2Model');
|
||||
$uniqueGroups = $extraFieldModel->getGroups(true);
|
||||
foreach ($uniqueGroups as $group)
|
||||
{
|
||||
$groups[] = JHTML::_('select.option', $group->id, $group->name);
|
||||
}
|
||||
|
||||
$lists['group'] = JHTML::_('select.genericlist', $groups, 'groups', '', 'value', 'text', $extraField->group);
|
||||
|
||||
$typeOptions[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_TYPE'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'textfield', JText::_('K2_TEXT_FIELD'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'textarea', JText::_('K2_TEXTAREA'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'select', JText::_('K2_DROPDOWN_SELECTION'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'multipleSelect', JText::_('K2_MULTISELECT_LIST'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'radio', JText::_('K2_RADIO_BUTTONS'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'link', JText::_('K2_LINK'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'csv', JText::_('K2_CSV_DATA'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'labels', JText::_('K2_SEARCHABLE_LABELS'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'date', JText::_('K2_DATE'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'image', JText::_('K2_IMAGE'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'header', JText::_('K2_HEADER'));
|
||||
$lists['type'] = JHTML::_('select.genericlist', $typeOptions, 'type', '', 'value', 'text', $extraField->type);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
(JRequest::getInt('cid')) ? $title = JText::_('K2_EDIT_EXTRA_FIELD') : $title = JText::_('K2_ADD_EXTRA_FIELD');
|
||||
JToolBarHelper::title($title, 'k2.png');
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::apply();
|
||||
JToolBarHelper::cancel();
|
||||
JHTML::_('behavior.calendar');
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration('
|
||||
var K2BasePath = "'.JURI::base(true).'/";
|
||||
var K2Language = [
|
||||
"'.JText::_('K2_REMOVE', true).'",
|
||||
"'.JText::_('K2_OPTIONAL', true).'",
|
||||
"'.JText::_('K2_COMMA_SEPARATED_VALUES', true).'",
|
||||
"'.JText::_('K2_USE_EDITOR', true).'",
|
||||
"'.JText::_('K2_ALL_SETTINGS_ABOVE_ARE_OPTIONAL', true).'",
|
||||
"'.JText::_('K2_ADD_AN_OPTION', true).'",
|
||||
"'.JText::_('K2_LINK_TEXT', true).'",
|
||||
"'.JText::_('K2_URL', true).'",
|
||||
"'.JText::_('K2_OPEN_IN', true).'",
|
||||
"'.JText::_('K2_SAME_WINDOW', true).'",
|
||||
"'.JText::_('K2_NEW_WINDOW', true).'",
|
||||
"'.JText::_('K2_CLASSIC_JAVASCRIPT_POPUP', true).'",
|
||||
"'.JText::_('K2_LIGHTBOX_POPUP', true).'",
|
||||
"'.JText::_('K2_RESET_VALUE', true).'",
|
||||
"'.JText::_('K2_CALENDAR', true).'",
|
||||
"'.JText::_('K2_PLEASE_SELECT_A_FIELD_TYPE_FROM_THE_LIST_ABOVE', true).'",
|
||||
"'.JText::_('K2_COLUMNS', true).'",
|
||||
"'.JText::_('K2_ROWS', true).'",
|
||||
];');
|
||||
JHTML::_('behavior.modal');
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_TITLE'); ?>"/>
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['type']; ?>
|
||||
<?php echo $this->lists['group']; ?>
|
||||
<?php echo $this->lists['state']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped" id="k2ExtraFieldsList">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<th width="1%" class="center hidden-phone">
|
||||
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', @$this->lists['order_Dir'], @$this->lists['order'], null, 'asc', 'K2_ORDER'); ?>
|
||||
</th>
|
||||
<?php else: ?>
|
||||
<th>#</th>
|
||||
<?php endif; ?>
|
||||
<th class="k2Center center"><input id="jToggler" type="checkbox" name="toggle" value="" /></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_NAME', 'name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="k2Center center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_GROUP', 'groupname', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<?php if(K2_JVERSION != '30'): ?>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_ORDER', 'ordering', @$this->lists['order_Dir'], @$this->lists['order']); ?> <?php if ($this->ordering) echo JHTML::_('grid.order', $this->rows ); ?></th>
|
||||
<?php endif; ?>
|
||||
<th class="k2Center center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_TYPE', 'type', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="k2Center center"><?php echo JHTML::_('grid.sort', 'K2_PUBLISHED', 'published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="k2Center center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_ID', 'exf.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key=>$row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>" sortable-group-id="<?php echo $row->group; ?>">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<td class="order hidden-phone">
|
||||
<span class="sortable-handler <?php echo ($this->ordering) ? '' : 'inactive tip-top' ;?>" title="<?php echo ($this->ordering) ? '' :JText::_('JORDERINGDISABLED');?>" rel="tooltip"><i class="icon-menu"></i></span>
|
||||
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $row->ordering;?>" class="width-20 text-area-order " />
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td><?php echo $key+1; ?></td>
|
||||
<?php endif; ?>
|
||||
<td class="k2Center center"><?php $row->checked_out = 0; echo @JHTML::_('grid.checkedout', $row, $key ); ?></td>
|
||||
<td><a href="<?php echo JRoute::_('index.php?option=com_k2&view=extrafield&cid='.$row->id); ?>"><?php echo $row->name; ?></a><br /><?php echo JText::_('K2_ALIAS'); ?>: <?php echo $row->alias; ?></td>
|
||||
<td class="k2Center center hidden-phone"><?php echo $row->groupname; ?></td>
|
||||
<?php if(K2_JVERSION != '30'): ?>
|
||||
<td class="order">
|
||||
<span><?php echo $this->page->orderUpIcon($key, ($row->group == @$this->rows[$key-1]->group), 'orderup', 'Move Up', $this->ordering); ?></span>
|
||||
<span><?php echo $this->page->orderDownIcon($key, count($this->rows), ($row->group == @$this->rows[$key+1]->group), 'orderdown', 'Move Down', $this->ordering); ?></span>
|
||||
<?php $disabled = $this->ordering ? '' : 'disabled="disabled"'; ?>
|
||||
<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="k2Center center hidden-phone"><?php echo JText::_('K2_EXTRA_FIELD_'.JString::strtoupper($row->type)); ?></td>
|
||||
<td class="k2Center center"><?php echo $row->status; ?></td>
|
||||
<td class="k2Center center hidden-phone"><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
148
administrator/components/com_k2/views/extrafields/view.html.php
Normal file
148
administrator/components/com_k2/views/extrafields/view.html.php
Normal file
@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewExtraFields extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', 'groupname', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', 'ASC', 'word');
|
||||
$filter_state = $mainframe->getUserStateFromRequest($option.$view.'filter_state', 'filter_state', -1, 'int');
|
||||
$search = $mainframe->getUserStateFromRequest($option.$view.'search', 'search', '', 'string');
|
||||
$search = JString::strtolower($search);
|
||||
$filter_type = $mainframe->getUserStateFromRequest($option.$view.'filter_type', 'filter_type', '', 'string');
|
||||
$filter_group = $mainframe->getUserStateFromRequest($option.$view.'filter_group', 'filter_group', '', 'string');
|
||||
|
||||
$model = $this->getModel();
|
||||
$total = $model->getTotal();
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
$extraFields = $model->getData();
|
||||
require_once (JPATH_COMPONENT.DS.'lib'.DS.'JSON.php');
|
||||
$json = new Services_JSON;
|
||||
foreach ($extraFields as $key => $extraField)
|
||||
{
|
||||
$extraField->status = K2_JVERSION == '15' ? JHTML::_('grid.published', $extraField, $key) : JHtml::_('jgrid.published', $extraField->published, $key);
|
||||
$values = $json->decode($extraField->value);
|
||||
if (isset($values[0]->alias) && !empty($values[0]->alias))
|
||||
{
|
||||
$extraField->alias = $values[0]->alias;
|
||||
}
|
||||
else
|
||||
{
|
||||
$filter = JFilterInput::getInstance();
|
||||
$extraField->alias = $filter->clean($extraField->name, 'WORD');
|
||||
}
|
||||
}
|
||||
$this->assignRef('rows', $extraFields);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
$lists = array();
|
||||
$lists['search'] = $search;
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
$filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
|
||||
$lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
|
||||
|
||||
$extraFieldGroups = $model->getGroups(true);
|
||||
$groups[] = JHTML::_('select.option', '0', JText::_('K2_SELECT_GROUP'));
|
||||
|
||||
foreach ($extraFieldGroups as $extraFieldGroup)
|
||||
{
|
||||
$groups[] = JHTML::_('select.option', $extraFieldGroup->id, $extraFieldGroup->name);
|
||||
}
|
||||
$lists['group'] = JHTML::_('select.genericlist', $groups, 'filter_group', '', 'value', 'text', $filter_group);
|
||||
|
||||
$typeOptions[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_TYPE'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'textfield', JText::_('K2_TEXT_FIELD'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'textarea', JText::_('K2_TEXTAREA'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'select', JText::_('K2_DROPDOWN_SELECTION'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'multipleSelect', JText::_('K2_MULTISELECT_LIST'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'radio', JText::_('K2_RADIO_BUTTONS'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'link', JText::_('K2_LINK'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'csv', JText::_('K2_CSV_DATA'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'labels', JText::_('K2_SEARCHABLE_LABELS'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'date', JText::_('K2_DATE'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'image', JText::_('K2_IMAGE'));
|
||||
$typeOptions[] = JHTML::_('select.option', 'header', JText::_('K2_HEADER'));
|
||||
$lists['type'] = JHTML::_('select.genericlist', $typeOptions, 'filter_type', '', 'value', 'text', $filter_type);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_EXTRA_FIELDS'), 'k2.png');
|
||||
|
||||
JToolBarHelper::publishList();
|
||||
JToolBarHelper::unpublishList();
|
||||
JToolBarHelper::deleteList('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_EXTRA_FIELDS', 'remove', 'K2_DELETE');
|
||||
JToolBarHelper::editList();
|
||||
JToolBarHelper::addNew();
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
$ordering = ($this->lists['order'] == 'ordering');
|
||||
$this->assignRef('ordering', $ordering);
|
||||
|
||||
// Joomla! 3.0 drag-n-drop sorting variables
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
if ($ordering)
|
||||
{
|
||||
JHtml::_('sortablelist.sortable', 'k2ExtraFieldsList', 'adminForm', strtolower($this->lists['order_Dir']), 'index.php?option=com_k2&view=extrafields&task=saveorder&format=raw');
|
||||
}
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration('
|
||||
Joomla.orderTable = function() {
|
||||
table = document.getElementById("sortTable");
|
||||
direction = document.getElementById("directionTable");
|
||||
order = table.options[table.selectedIndex].value;
|
||||
if (order != \''.$this->lists['order'].'\') {
|
||||
dirn = \'asc\';
|
||||
} else {
|
||||
dirn = direction.options[direction.selectedIndex].value;
|
||||
}
|
||||
Joomla.tableOrdering(order, dirn, "");
|
||||
}');
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton){
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#name').val()) == '') {
|
||||
alert( '".JText::_('K2_GROUP_NAME_CANNOT_BE_EMPTY', true)."' );
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" enctype="multipart/form-data" method="post" name="adminForm" id="adminForm">
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_GROUP_NAME'); ?></td>
|
||||
<td><input class="text_area k2TitleBox" type="text" name="name" id="name" value="<?php echo $this->row->name; ?>" size="50" maxlength="250" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="extrafieldsgroup" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</form>
|
||||
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewExtraFieldsGroup extends K2View
|
||||
{
|
||||
function display($tpl = null)
|
||||
{
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
$model = $this->getModel();
|
||||
$extraFieldsGroup = $model->getExtraFieldsGroup();
|
||||
JFilterOutput::objectHTMLSafe($extraFieldsGroup);
|
||||
$this->assignRef('row', $extraFieldsGroup);
|
||||
(JRequest::getInt('cid')) ? $title = JText::_('K2_EDIT_EXTRA_FIELD_GROUP') : $title = JText::_('K2_ADD_EXTRA_FIELD_GROUP');
|
||||
JToolBarHelper::title($title, 'k2.png');
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::apply();
|
||||
JToolBarHelper::cancel();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'remove') {
|
||||
if (confirm('".JText::_('K2_WARNING_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_EXTRA_FIELDS_GROUPS_DELETING_THE_GROUPS_WILL_ALSO_DELETE_THE_ASSIGNED_EXTRA_FIELDS', true)."')){
|
||||
submitform( pressbutton );
|
||||
}
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="center hidden-phone">#</th>
|
||||
<th class="center"><input id="jToggler" type="checkbox" name="toggle" value="" /></th>
|
||||
<th><?php echo JText::_('K2_GROUP_NAME'); ?></th>
|
||||
<th class="hidden-phone"><?php echo JText::_('K2_ASSIGNED_CATEGORIES'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key=>$row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td class="k2Center center hidden-phone"><?php echo $key+1; ?></td>
|
||||
<td class="k2Center center"><?php $row->checked_out = 0; echo @JHTML::_('grid.checkedout', $row, $key ); ?></td>
|
||||
<td><a href="<?php echo JRoute::_('index.php?option=com_k2&view=extrafieldsgroup&cid='.$row->id); ?>"><?php echo $row->name; ?></a></td>
|
||||
<td class="hidden-phone"><?php echo $row->categories; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewExtraFieldsGroups extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', '', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', '', 'word');
|
||||
|
||||
$model = $this->getModel();
|
||||
$total = $model->getTotalGroups();
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
$extraFieldGroups = $model->getGroups();
|
||||
|
||||
$this->assignRef('rows', $extraFieldGroups);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_EXTRA_FIELD_GROUPS'), 'k2.png');
|
||||
|
||||
JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
|
||||
JToolBarHelper::editList();
|
||||
JToolBarHelper::addNew();
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
318
administrator/components/com_k2/views/info/tmpl/default.php
Normal file
318
administrator/components/com_k2/views/info/tmpl/default.php
Normal file
@ -0,0 +1,318 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1859 2013-02-06 19:13:48Z joomlaworks $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm">
|
||||
<table cellpadding="0" cellspacing="0" border="0" style="width:100%" id="k2InfoPage" class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('K2_ABOUT'); ?></legend>
|
||||
<div class="k2TextBox"><?php echo JText::_('K2_ABOUT_TEXT'); ?></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('K2_CREDITS'); ?></legend>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_PROVIDER'); ?></th>
|
||||
<th><?php echo JText::_('K2_VERSION'); ?></th>
|
||||
<th><?php echo JText::_('K2_TYPE'); ?></th>
|
||||
<th><?php echo JText::_('K2_LICENSE'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="4"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://nuovext.pwsp.net/">NuoveXT</a></td>
|
||||
<td>2.2</td>
|
||||
<td><?php echo JText::_('K2_ICONS'); ?></td>
|
||||
<td><?php echo JText::_('K2_GNUGPL'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://p.yusukekamiyamane.com/">Fugue Icons<br />(by Yusuke Kamiyamane)</a></td>
|
||||
<td>3.5.3</td>
|
||||
<td><?php echo JText::_('K2_ICONS'); ?></td>
|
||||
<td><?php echo JText::_('K2_CREATIVE_COMMONS_ATTRIBUTION_30_LICENSE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://www.iconarchive.com/artist/tpdkdesign.net.html">"Choose Your Sport" Icon Pack<br />(by TpdkDesign.net)</a></td>
|
||||
<td><?php echo JText::_('K2_NA'); ?></td>
|
||||
<td><?php echo JText::_('K2_ICONS'); ?></td>
|
||||
<td><?php echo JText::_('K2_INFO_FREE_LICENSE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://pear.php.net/package/Services_JSON/">Services_JSON</a></td>
|
||||
<td>1.0.1</td>
|
||||
<td><?php echo JText::_('K2_PHP_CLASS'); ?></td>
|
||||
<td><?php echo JText::_('K2_BSD'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://www.verot.net/php_class_upload.htm">class.upload.php</a></td>
|
||||
<td>0.32</td>
|
||||
<td><?php echo JText::_('K2_PHP_CLASS'); ?></td>
|
||||
<td><?php echo JText::_('K2_GNUGPL'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://jquery.com">jQuery</a></td>
|
||||
<td>1.5.x - 1.9.x</td>
|
||||
<td><?php echo JText::_('K2_JS_LIB'); ?></td>
|
||||
<td><?php echo JText::_('K2_MIT'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://jqueryui.com/">jQuery UI</a></td>
|
||||
<td>1.8.24</td>
|
||||
<td><?php echo JText::_('K2_JS_LIB'); ?></td>
|
||||
<td><?php echo JText::_('K2_MIT'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a target="_blank" href="http://elfinder.org/">elFinder</a></td>
|
||||
<td>2.0 (rc1)</td>
|
||||
<td><?php echo JText::_('K2_INFO_FILE_MANAGER'); ?></td>
|
||||
<td><?php echo JText::_('K2_BSD'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td>
|
||||
<td>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('K2_SYSTEM_INFORMATION'); ?></legend>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_CHECK'); ?></th>
|
||||
<th><?php echo JText::_('K2_RESULT'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_WEB_SERVER'); ?></strong></td>
|
||||
<td><?php echo $this->server; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_PHP_VERSION'); ?></strong></td>
|
||||
<td><?php echo $this->php_version; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_MYSQL_VERSION'); ?></strong></td>
|
||||
<td><?php echo $this->db_version; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_GD_IMAGE_LIBRARY'); ?></strong></td>
|
||||
<td><?php if ($this->gd_check) {$gdinfo=gd_info(); echo $gdinfo["GD Version"];} else echo JText::_('K2_DISABLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_MULTIBYTE_STRING_SUPPORT'); ?></strong></td>
|
||||
<td><?php if ($this->mb_check) echo JText::_('K2_ENABLED'); else echo JText::_('K2_DISABLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_UPLOAD_LIMIT'); ?></strong></td>
|
||||
<td><?php echo ini_get('upload_max_filesize'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_MEMORY_LIMIT'); ?></strong></td>
|
||||
<td><?php echo ini_get('memory_limit'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_OPEN_REMOTE_FILES_ALLOW_URL_FOPEN'); ?></strong></td>
|
||||
<td><?php echo (ini_get('allow_url_fopen'))? JText::_('K2_YES'):JText::_('K2_NO'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('K2_DIRECTORY_PERMISSIONS'); ?></legend>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_CHECK'); ?></th>
|
||||
<th><?php echo JText::_('K2_RESULT'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>media/k2</strong></td>
|
||||
<td><?php if ($this->media_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>media/k2/attachments</strong></td>
|
||||
<td><?php if ($this->attachments_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>media/k2/categories</strong></td>
|
||||
<td><?php if ($this->categories_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>media/k2/galleries</strong></td>
|
||||
<td><?php if ($this->galleries_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>media/k2/items</strong></td>
|
||||
<td><?php if ($this->items_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>media/k2/users</strong></td>
|
||||
<td><?php if ($this->users_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>media/k2/videos</strong></td>
|
||||
<td><?php if ($this->videos_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>cache</strong></td>
|
||||
<td><?php if ($this->cache_folder_check) echo JText::_('K2_WRITABLE'); else echo JText::_('K2_NOT_WRITABLE'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('K2_MODULES'); ?></legend>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_CHECK'); ?></th>
|
||||
<th><?php echo JText::_('K2_RESULT'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>mod_k2_comments</strong></td>
|
||||
<td><?php echo (is_null(JModuleHelper::getModule('mod_k2_comments')))?JText::_('K2_NOT_INSTALLED'):JText::_('K2_INSTALLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>mod_k2_content</strong></td>
|
||||
<td><?php echo (is_null(JModuleHelper::getModule('mod_k2_content')))?JText::_('K2_NOT_INSTALLED'):JText::_('K2_INSTALLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>mod_k2_tools</strong></td>
|
||||
<td><?php echo (is_null(JModuleHelper::getModule('mod_k2_tools')))?JText::_('K2_NOT_INSTALLED'):JText::_('K2_INSTALLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>mod_k2_user</strong></td>
|
||||
<td><?php echo (is_null(JModuleHelper::getModule('mod_k2_user')))?JText::_('K2_NOT_INSTALLED'):JText::_('K2_INSTALLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>mod_k2_users</strong></td>
|
||||
<td><?php echo (is_null(JModuleHelper::getModule('mod_k2_users')))?JText::_('K2_NOT_INSTALLED'):JText::_('K2_INSTALLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>mod_k2_quickicons</strong> (administrator)</td>
|
||||
<td><?php echo (is_null(JModuleHelper::getModule('mod_k2_quickicons')))?JText::_('K2_NOT_INSTALLED'):JText::_('K2_INSTALLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>mod_k2_stats</strong> (administrator)</td>
|
||||
<td><?php echo (is_null(JModuleHelper::getModule('mod_k2_stats')))?JText::_('K2_NOT_INSTALLED'):JText::_('K2_INSTALLED'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('K2_PLUGINS'); ?></legend>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_CHECK'); ?></th>
|
||||
<th><?php echo JText::_('K2_RESULT'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php if(version_compare(JVERSION,'2.5.0','ge')): ?>
|
||||
<tr>
|
||||
<td><strong>Finder - K2</strong></td>
|
||||
<td><?php echo (JFile::exists(JPATH_PLUGINS.DS.'finder'.DS.'k2.php') || JFile::exists(JPATH_PLUGINS.DS.'finder'.DS.'k2'.DS.'k2.php'))?JText::_('K2_INSTALLED'):JText::_('K2_NOT_INSTALLED'); ?> - <?php echo (JPluginHelper::isEnabled('finder', 'k2'))?JText::_('K2_ENABLED'):JText::_('K2_DISABLED'); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td><strong>Search - K2</strong></td>
|
||||
<td><?php echo (JFile::exists(JPATH_PLUGINS.DS.'search'.DS.'k2.php') || JFile::exists(JPATH_PLUGINS.DS.'search'.DS.'k2'.DS.'k2.php'))?JText::_('K2_INSTALLED'):JText::_('K2_NOT_INSTALLED'); ?> - <?php echo (JPluginHelper::isEnabled('search', 'k2'))?JText::_('K2_ENABLED'):JText::_('K2_DISABLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>System - K2</strong></td>
|
||||
<td><?php echo (JFile::exists(JPATH_PLUGINS.DS.'system'.DS.'k2.php') || JFile::exists(JPATH_PLUGINS.DS.'system'.DS.'k2'.DS.'k2.php'))?JText::_('K2_INSTALLED'):JText::_('K2_NOT_INSTALLED'); ?> - <?php echo (JPluginHelper::isEnabled('system', 'k2'))?JText::_('K2_ENABLED'):JText::_('K2_DISABLED'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>User - K2</strong></td>
|
||||
<td><?php echo (JFile::exists(JPATH_PLUGINS.DS.'user'.DS.'k2.php') || JFile::exists(JPATH_PLUGINS.DS.'user'.DS.'k2'.DS.'k2.php'))?JText::_('K2_INSTALLED'):JText::_('K2_NOT_INSTALLED'); ?> - <?php echo (JPluginHelper::isEnabled('user', 'k2'))?JText::_('K2_ENABLED'):JText::_('K2_DISABLED'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo JText::_('K2_THIRDPARTY_PLUGIN_INFORMATION'); ?></legend>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_CHECK'); ?></th>
|
||||
<th><?php echo JText::_('K2_RESULT'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"> </th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_ALLVIDEOS_PLUGIN'); ?></strong></td>
|
||||
<td><?php
|
||||
if (JFile::exists(JPATH_PLUGINS.DS.'content'.DS.'jw_allvideos.php') || JFile::exists(JPATH_PLUGINS.DS.'content'.DS.'jw_allvideos'.DS.'jw_allvideos.php'))
|
||||
echo JText::_('K2_INSTALLED');
|
||||
else
|
||||
echo JText::_('K2_NOT_INSTALLED');
|
||||
?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php echo JText::_('K2_SIMPLE_IMAGE_GALLERY_PRO_PLUGIN'); ?></strong></td>
|
||||
<td><?php
|
||||
if (JFile::exists(JPATH_PLUGINS.DS.'content'.DS.'jw_sigpro.php') || JFile::exists(JPATH_PLUGINS.DS.'content'.DS.'jw_sigpro'.DS.'jw_sigpro.php'))
|
||||
echo JText::_('K2_INSTALLED');
|
||||
else
|
||||
echo JText::_('K2_NOT_INSTALLED');
|
||||
?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
87
administrator/components/com_k2/views/info/view.html.php
Normal file
87
administrator/components/com_k2/views/info/view.html.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewInfo extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
jimport('joomla.filesystem.file');
|
||||
$user = JFactory::getUser();
|
||||
$db = JFactory::getDBO();
|
||||
$db_version = $db->getVersion();
|
||||
$php_version = phpversion();
|
||||
$server = $this->get_server_software();
|
||||
$gd_check = extension_loaded('gd');
|
||||
$mb_check = extension_loaded('mbstring');
|
||||
|
||||
$media_folder_check = is_writable(JPATH_ROOT.DS.'media'.DS.'k2');
|
||||
$attachments_folder_check = is_writable(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'attachments');
|
||||
$categories_folder_check = is_writable(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'categories');
|
||||
$galleries_folder_check = is_writable(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'galleries');
|
||||
$items_folder_check = is_writable(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items');
|
||||
$users_folder_check = is_writable(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'users');
|
||||
$videos_folder_check = is_writable(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'videos');
|
||||
$cache_folder_check = is_writable(JPATH_ROOT.DS.'cache');
|
||||
|
||||
$this->assignRef('server', $server);
|
||||
$this->assignRef('php_version', $php_version);
|
||||
$this->assignRef('db_version', $db_version);
|
||||
$this->assignRef('gd_check', $gd_check);
|
||||
$this->assignRef('mb_check', $mb_check);
|
||||
|
||||
$this->assignRef('media_folder_check', $media_folder_check);
|
||||
$this->assignRef('attachments_folder_check', $attachments_folder_check);
|
||||
$this->assignRef('categories_folder_check', $categories_folder_check);
|
||||
$this->assignRef('galleries_folder_check', $galleries_folder_check);
|
||||
$this->assignRef('items_folder_check', $items_folder_check);
|
||||
$this->assignRef('users_folder_check', $users_folder_check);
|
||||
$this->assignRef('videos_folder_check', $videos_folder_check);
|
||||
$this->assignRef('cache_folder_check', $cache_folder_check);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_INFORMATION'), 'k2.png');
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function get_server_software()
|
||||
{
|
||||
if (isset($_SERVER['SERVER_SOFTWARE']))
|
||||
{
|
||||
return $_SERVER['SERVER_SOFTWARE'];
|
||||
}
|
||||
else if (($sf = getenv('SERVER_SOFTWARE')))
|
||||
{
|
||||
return $sf;
|
||||
}
|
||||
else
|
||||
{
|
||||
return JText::_('K2_NA');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
960
administrator/components/com_k2/views/item/tmpl/default.php
Normal file
960
administrator/components/com_k2/views/item/tmpl/default.php
Normal file
@ -0,0 +1,960 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1944 2013-03-08 19:14:17Z joomlaworks $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton){
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#title').val()) == '') {
|
||||
alert( '".JText::_('K2_ITEM_MUST_HAVE_A_TITLE', true)."' );
|
||||
}
|
||||
else if (\$K2.trim(\$K2('#catid').val()) == '0') {
|
||||
alert( '".JText::_('K2_PLEASE_SELECT_A_CATEGORY', true)."' );
|
||||
}
|
||||
else {
|
||||
syncExtraFieldsEditor();
|
||||
var validation = validateExtraFields();
|
||||
if(validation === true) {
|
||||
\$K2('#selectedTags option').attr('selected', 'selected');
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" enctype="multipart/form-data" method="post" name="adminForm" id="adminForm">
|
||||
<?php if($this->mainframe->isSite()): ?>
|
||||
<div id="k2FrontendContainer">
|
||||
<div id="k2Frontend">
|
||||
<table class="k2FrontendToolbar" cellpadding="2" cellspacing="4">
|
||||
<tr>
|
||||
<td id="toolbar-save" class="button">
|
||||
<a class="toolbar" href="#" onclick="Joomla.submitbutton('save'); return false;"> <span title="<?php echo JText::_('K2_SAVE'); ?>" class="icon-32-save icon-save"></span> <?php echo JText::_('K2_SAVE'); ?> </a>
|
||||
</td>
|
||||
<td id="toolbar-cancel" class="button">
|
||||
<a class="toolbar" href="#"> <span title="<?php echo JText::_('K2_CANCEL'); ?>" class="icon-32-cancel icon-cancel"></span> <?php echo JText::_('K2_CLOSE'); ?> </a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="k2FrontendEditToolbar">
|
||||
<h2 class="header icon-48-k2">
|
||||
<?php echo (JRequest::getInt('cid')) ? JText::_('K2_EDIT_ITEM') : JText::_('K2_ADD_ITEM'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
<hr class="sep" />
|
||||
<?php if(!$this->permissions->get('publish')): ?>
|
||||
<div id="k2FrontendPermissionsNotice">
|
||||
<p><?php echo JText::_('K2_FRONTEND_PERMISSIONS_NOTICE'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<div id="k2ToggleSidebarContainer"> <a href="#" id="k2ToggleSidebar"><?php echo JText::_('K2_TOGGLE_SIDEBAR'); ?></a> </div>
|
||||
<table cellspacing="0" cellpadding="0" border="0" class="adminFormK2Container table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="adminFormK2 table">
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="title"><?php echo JText::_('K2_TITLE'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<input class="text_area k2TitleBox" type="text" name="title" id="title" maxlength="250" value="<?php echo $this->row->title; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="alias"><?php echo JText::_('K2_TITLE_ALIAS'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<input class="text_area k2TitleAliasBox" type="text" name="alias" id="alias" maxlength="250" value="<?php echo $this->row->alias; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label><?php echo JText::_('K2_CATEGORY'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['categories']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label><?php echo JText::_('K2_TAGS'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php if($this->params->get('taggingSystem')): ?>
|
||||
<!-- Free tagging -->
|
||||
<ul class="tags">
|
||||
<?php if(isset($this->row->tags) && count($this->row->tags)): ?>
|
||||
<?php foreach($this->row->tags as $tag): ?>
|
||||
<li class="tagAdded">
|
||||
<?php echo $tag->name; ?>
|
||||
<span title="<?php echo JText::_('K2_CLICK_TO_REMOVE_TAG'); ?>" class="tagRemove">x</span>
|
||||
<input type="hidden" name="tags[]" value="<?php echo $tag->name; ?>" />
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<li class="tagAdd">
|
||||
<input type="text" id="search-field" />
|
||||
</li>
|
||||
<li class="clr"></li>
|
||||
</ul>
|
||||
<span class="k2Note"> <?php echo JText::_('K2_WRITE_A_TAG_AND_PRESS_RETURN_OR_COMMA_TO_ADD_IT'); ?> </span>
|
||||
<?php else: ?>
|
||||
<!-- Selection based tagging -->
|
||||
<?php if( !$this->params->get('lockTags') || $this->user->gid>23): ?>
|
||||
<div style="float:left;">
|
||||
<input type="text" name="tag" id="tag" />
|
||||
<input type="button" id="newTagButton" value="<?php echo JText::_('K2_ADD'); ?>" />
|
||||
</div>
|
||||
<div id="tagsLog"></div>
|
||||
<div class="clr"></div>
|
||||
<span class="k2Note"> <?php echo JText::_('K2_WRITE_A_TAG_AND_PRESS_ADD_TO_INSERT_IT_TO_THE_AVAILABLE_TAGS_LISTNEW_TAGS_ARE_APPENDED_AT_THE_BOTTOM_OF_THE_AVAILABLE_TAGS_LIST_LEFT'); ?> </span>
|
||||
<?php endif; ?>
|
||||
<table cellspacing="0" cellpadding="0" border="0" id="tagLists">
|
||||
<tr>
|
||||
<td id="tagListsLeft">
|
||||
<span><?php echo JText::_('K2_AVAILABLE_TAGS'); ?></span> <?php echo $this->lists['tags']; ?>
|
||||
</td>
|
||||
<td id="tagListsButtons">
|
||||
<input type="button" id="addTagButton" value="<?php echo JText::_('K2_ADD'); ?> »" />
|
||||
<br />
|
||||
<br />
|
||||
<input type="button" id="removeTagButton" value="« <?php echo JText::_('K2_REMOVE'); ?>" />
|
||||
</td>
|
||||
<td id="tagListsRight">
|
||||
<span><?php echo JText::_('K2_SELECTED_TAGS'); ?></span> <?php echo $this->lists['selectedTags']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($this->mainframe->isAdmin() || ($this->mainframe->isSite() && $this->permissions->get('publish'))): ?>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label for="featured"><?php echo JText::_('K2_IS_IT_FEATURED'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['featured']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="adminK2LeftCol">
|
||||
<label><?php echo JText::_('K2_PUBLISHED'); ?></label>
|
||||
</td>
|
||||
<td class="adminK2RightCol">
|
||||
<?php echo $this->lists['published']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<!-- Required extra field warning -->
|
||||
<div id="k2ExtraFieldsValidationResults">
|
||||
<h3><?php echo JText::_('K2_THE_FOLLOWING_FIELDS_ARE_REQUIRED'); ?></h3>
|
||||
<ul id="k2ExtraFieldsMissing">
|
||||
<li><?php echo JText::_('K2_LOADING'); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Tabs start here -->
|
||||
<div class="simpleTabs" id="k2Tabs">
|
||||
<ul class="simpleTabsNavigation">
|
||||
<li id="tabContent"><a href="#k2Tab1"><?php echo JText::_('K2_CONTENT'); ?></a></li>
|
||||
<?php if ($this->params->get('showImageTab')): ?>
|
||||
<li id="tabImage"><a href="#k2Tab2"><?php echo JText::_('K2_IMAGE'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showImageGalleryTab')): ?>
|
||||
<li id="tabImageGallery"><a href="#k2Tab3"><?php echo JText::_('K2_IMAGE_GALLERY'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showVideoTab')): ?>
|
||||
<li id="tabVideo"><a href="#k2Tab4"><?php echo JText::_('K2_MEDIA'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showExtraFieldsTab')): ?>
|
||||
<li id="tabExtraFields"><a href="#k2Tab5"><?php echo JText::_('K2_EXTRA_FIELDS'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showAttachmentsTab')): ?>
|
||||
<li id="tabAttachments"><a href="#k2Tab6"><?php echo JText::_('K2_ATTACHMENTS'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if(count(array_filter($this->K2PluginsItemOther)) && $this->params->get('showK2Plugins')): ?>
|
||||
<li id="tabPlugins"><a href="#k2Tab7"><?php echo JText::_('K2_PLUGINS'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<!-- Tab content -->
|
||||
<div class="simpleTabsContent" id="k2Tab1">
|
||||
<?php if($this->params->get('mergeEditors')): ?>
|
||||
<div class="k2ItemFormEditor"> <?php echo $this->text; ?>
|
||||
<div class="dummyHeight"></div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="k2ItemFormEditor"> <span class="k2ItemFormEditorTitle"> <?php echo JText::_('K2_INTROTEXT_TEASER_CONTENTEXCERPT'); ?> </span> <?php echo $this->introtext; ?>
|
||||
<div class="dummyHeight"></div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<div class="k2ItemFormEditor"> <span class="k2ItemFormEditorTitle"> <?php echo JText::_('K2_FULLTEXT_MAIN_CONTENT'); ?> </span> <?php echo $this->fulltext; ?>
|
||||
<div class="dummyHeight"></div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (count($this->K2PluginsItemContent)): ?>
|
||||
<div class="itemPlugins">
|
||||
<?php foreach($this->K2PluginsItemContent as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset>
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
<?php if ($this->params->get('showImageTab')): ?>
|
||||
<!-- Tab image -->
|
||||
<div class="simpleTabsContent" id="k2Tab2">
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_ITEM_IMAGE'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="file" name="image" class="fileUpload" />
|
||||
<i>(<?php echo JText::_('K2_MAX_UPLOAD_SIZE'); ?>: <?php echo ini_get('upload_max_filesize'); ?>)</i>
|
||||
<br />
|
||||
<br />
|
||||
<?php echo JText::_('K2_OR'); ?>
|
||||
<br />
|
||||
<br />
|
||||
<input type="text" name="existingImage" id="existingImageValue" class="text_area" readonly />
|
||||
<input type="button" value="<?php echo JText::_('K2_BROWSE_SERVER'); ?>" id="k2ImageBrowseServer" />
|
||||
<br />
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_ITEM_IMAGE_CAPTION'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="image_caption" size="30" class="text_area" value="<?php echo $this->row->image_caption; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_ITEM_IMAGE_CREDITS'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="image_credits" size="30" class="text_area" value="<?php echo $this->row->image_credits; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php if (!empty($this->row->image)): ?>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_ITEM_IMAGE_PREVIEW'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<a class="modal" rel="{handler: 'image'}" href="<?php echo $this->row->image; ?>" title="<?php echo JText::_('K2_CLICK_ON_IMAGE_TO_PREVIEW_IN_ORIGINAL_SIZE'); ?>">
|
||||
<img alt="<?php echo $this->row->title; ?>" src="<?php echo $this->row->thumb; ?>" class="k2AdminImage" />
|
||||
</a>
|
||||
<input type="checkbox" name="del_image" id="del_image" />
|
||||
<label for="del_image"><?php echo JText::_('K2_CHECK_THIS_BOX_TO_DELETE_CURRENT_IMAGE_OR_JUST_UPLOAD_A_NEW_IMAGE_TO_REPLACE_THE_EXISTING_ONE'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<?php if (count($this->K2PluginsItemImage)): ?>
|
||||
<div class="itemPlugins">
|
||||
<?php foreach($this->K2PluginsItemImage as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset>
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showImageGalleryTab')): ?>
|
||||
<!-- Tab image gallery -->
|
||||
<div class="simpleTabsContent" id="k2Tab3">
|
||||
<?php if ($this->lists['checkSIG']): ?>
|
||||
<table class="admintable table" id="item_gallery_content">
|
||||
<tr>
|
||||
<td align="right" valign="top" class="key">
|
||||
<?php echo JText::_('K2_COM_BE_ITEM_ITEM_IMAGE_GALLERY'); ?>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<?php if($this->sigPro): ?>
|
||||
<a class="modal" rel="{handler: 'iframe', size: {x: 940, y: 560}}" href="index.php?option=com_sigpro&view=galleries&task=create&newFolder=<?php echo $this->sigProFolder; ?>&type=k2&tmpl=component"><?php echo JText::_('K2_COM_BE_ITEM_SIGPRO_UPLOAD'); ?></a> <i>(<?php echo JText::_('K2_COM_BE_ITEM_SIGPRO_UPLOAD_NOTE'); ?>)</i>
|
||||
<input name="sigProFolder" type="hidden" value="<?php echo $this->sigProFolder; ?>" />
|
||||
<br />
|
||||
<br />
|
||||
<?php echo JText::_('K2_OR'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo JText::_('K2_UPLOAD_A_ZIP_FILE_WITH_IMAGES'); ?> <input type="file" name="gallery" class="fileUpload" /> <span class="hasTip k2GalleryNotice" title="<?php echo JText::_('K2_UPLOAD_A_ZIP_FILE_HELP_HEADER'); ?>::<?php echo JText::_('K2_UPLOAD_A_ZIP_FILE_HELP_TEXT'); ?>"><?php echo JText::_('K2_UPLOAD_A_ZIP_FILE_HELP'); ?></span> <i>(<?php echo JText::_('K2_MAX_UPLOAD_SIZE'); ?>: <?php echo ini_get('upload_max_filesize'); ?>)</i>
|
||||
<br />
|
||||
<br />
|
||||
<?php echo JText::_('K2_OR_ENTER_A_FLICKR_SET_URL'); ?><?php echo JText::_('K2_OR_ENTER_A_FLICKR_SET_URL'); ?>
|
||||
<input type="text" name="flickrGallery" size="50" value="<?php echo ($this->row->galleryType == 'flickr') ? $this->row->galleryValue : ''; ?>" /> <span class="hasTip k2GalleryNotice" title="<?php echo JText::_('K2_VALID_FLICK_API_KEY_HELP_HEADER'); ?>::<?php echo JText::_('K2_VALID_FLICK_API_KEY_HELP_TEXT'); ?>"><?php echo JText::_('K2_UPLOAD_A_ZIP_FILE_HELP'); ?></span>
|
||||
|
||||
<?php if (!empty($this->row->gallery)): ?>
|
||||
<!-- Preview -->
|
||||
<div id="itemGallery">
|
||||
<?php echo $this->row->gallery; ?>
|
||||
<br />
|
||||
<input type="checkbox" name="del_gallery" id="del_gallery" />
|
||||
<label for="del_gallery"><?php echo JText::_('K2_CHECK_THIS_BOX_TO_DELETE_CURRENT_IMAGE_GALLERY_OR_JUST_UPLOAD_A_NEW_IMAGE_GALLERY_TO_REPLACE_THE_EXISTING_ONE'); ?></label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<?php if (K2_JVERSION == '15'): ?>
|
||||
<dl id="system-message">
|
||||
<dt class="notice"><?php echo JText::_('K2_NOTICE'); ?></dt>
|
||||
<dd class="notice message fade">
|
||||
<ul>
|
||||
<li><?php echo JText::_('K2_NOTICE_PLEASE_INSTALL_JOOMLAWORKS_SIMPLE_IMAGE_GALLERY_PRO_PLUGIN_IF_YOU_WANT_TO_USE_THE_IMAGE_GALLERY_FEATURES_OF_K2'); ?></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php elseif(K2_JVERSION == '25'): ?>
|
||||
<div id="system-message-container">
|
||||
<dl id="system-message">
|
||||
<dt class="notice"><?php echo JText::_('K2_NOTICE'); ?></dt>
|
||||
<dd class="notice message">
|
||||
<ul>
|
||||
<li><?php echo JText::_('K2_NOTICE_PLEASE_INSTALL_JOOMLAWORKS_SIMPLE_IMAGE_GALLERY_PRO_PLUGIN_IF_YOU_WANT_TO_USE_THE_IMAGE_GALLERY_FEATURES_OF_K2'); ?></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert">
|
||||
<h4 class="alert-heading"><?php echo JText::_('K2_NOTICE'); ?></h4>
|
||||
<div><p><?php echo JText::_('K2_NOTICE_PLEASE_INSTALL_JOOMLAWORKS_SIMPLE_IMAGE_GALLERY_PRO_PLUGIN_IF_YOU_WANT_TO_USE_THE_IMAGE_GALLERY_FEATURES_OF_K2'); ?></p></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($this->K2PluginsItemGallery)): ?>
|
||||
<div class="itemPlugins">
|
||||
<?php foreach($this->K2PluginsItemGallery as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset>
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showVideoTab')): ?>
|
||||
<!-- Tab video -->
|
||||
<div class="simpleTabsContent" id="k2Tab4">
|
||||
<?php if ($this->lists['checkAllVideos']): ?>
|
||||
<table class="admintable table" id="item_video_content">
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_SOURCE'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<div id="k2VideoTabs" class="simpleTabs">
|
||||
<ul class="simpleTabsNavigation">
|
||||
<li><a href="#k2VideoTab1"><?php echo JText::_('K2_UPLOAD'); ?></a></li>
|
||||
<li><a href="#k2VideoTab2"><?php echo JText::_('K2_BROWSE_SERVERUSE_REMOTE_MEDIA'); ?></a></li>
|
||||
<li><a href="#k2VideoTab3"><?php echo JText::_('K2_MEDIA_USE_ONLINE_VIDEO_SERVICE'); ?></a></li>
|
||||
<li><a href="#k2VideoTab4"><?php echo JText::_('K2_EMBED'); ?></a></li>
|
||||
</ul>
|
||||
<div id="k2VideoTab1" class="simpleTabsContent">
|
||||
<div class="panel" id="Upload_video">
|
||||
<input type="file" name="video" class="fileUpload" />
|
||||
<i>(<?php echo JText::_('K2_MAX_UPLOAD_SIZE'); ?>: <?php echo ini_get('upload_max_filesize'); ?>)</i> </div>
|
||||
</div>
|
||||
<div id="k2VideoTab2" class="simpleTabsContent">
|
||||
<div class="panel" id="Remote_video"> <a id="k2MediaBrowseServer" href="index.php?option=com_k2&view=media&type=video&tmpl=component&fieldID=remoteVideo"><?php echo JText::_('K2_BROWSE_VIDEOS_ON_SERVER')?></a> <?php echo JText::_('K2_OR'); ?> <?php echo JText::_('K2_PASTE_REMOTE_VIDEO_URL'); ?>
|
||||
<br />
|
||||
<br />
|
||||
<input type="text" size="50" name="remoteVideo" id="remoteVideo" value="<?php echo $this->lists['remoteVideo'] ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="k2VideoTab3" class="simpleTabsContent">
|
||||
<div class="panel" id="Video_from_provider"> <?php echo JText::_('K2_SELECT_VIDEO_PROVIDER'); ?> <?php echo $this->lists['providers']; ?> <br/><br/> <?php echo JText::_('K2_AND_ENTER_VIDEO_ID'); ?>
|
||||
<input type="text" size="50" name="videoID" value="<?php echo $this->lists['providerVideo'] ?>" />
|
||||
<br />
|
||||
<br />
|
||||
<a class="modal" rel="{handler: 'iframe', size: {x: 990, y: 600}}" href="http://www.joomlaworks.net/allvideos-documentation"><?php echo JText::_('K2_READ_THE_ALLVIDEOS_DOCUMENTATION_FOR_MORE'); ?></a> </div>
|
||||
</div>
|
||||
<div id="k2VideoTab4" class="simpleTabsContent">
|
||||
<div class="panel" id="embedVideo">
|
||||
<?php echo JText::_('K2_PASTE_HTML_EMBED_CODE_BELOW'); ?>
|
||||
<br />
|
||||
<textarea name="embedVideo" rows="5" cols="50" class="textarea"><?php echo $this->lists['embedVideo']; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_CAPTION'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="video_caption" size="50" class="text_area" value="<?php echo $this->row->video_caption; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_CREDITS'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="video_credits" size="50" class="text_area" value="<?php echo $this->row->video_credits; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($this->row->video): ?>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_PREVIEW'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->row->video; ?>
|
||||
<br />
|
||||
<input type="checkbox" name="del_video" id="del_video" />
|
||||
<label for="del_video"><?php echo JText::_('K2_CHECK_THIS_BOX_TO_DELETE_CURRENT_VIDEO_OR_USE_THE_FORM_ABOVE_TO_REPLACE_THE_EXISTING_ONE'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<?php if (K2_JVERSION == '15'): ?>
|
||||
<dl id="system-message">
|
||||
<dt class="notice"><?php echo JText::_('K2_NOTICE'); ?></dt>
|
||||
<dd class="notice message fade">
|
||||
<ul>
|
||||
<li><?php echo JText::_('K2_NOTICE_PLEASE_INSTALL_JOOMLAWORKS_ALLVIDEOS_PLUGIN_IF_YOU_WANT_TO_USE_THE_FULL_VIDEO_FEATURES_OF_K2'); ?></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php elseif(K2_JVERSION == '25'): ?>
|
||||
<div id="system-message-container">
|
||||
<dl id="system-message">
|
||||
<dt class="notice"><?php echo JText::_('K2_NOTICE'); ?></dt>
|
||||
<dd class="notice message">
|
||||
<ul>
|
||||
<li><?php echo JText::_('K2_NOTICE_PLEASE_INSTALL_JOOMLAWORKS_ALLVIDEOS_PLUGIN_IF_YOU_WANT_TO_USE_THE_FULL_VIDEO_FEATURES_OF_K2'); ?></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert">
|
||||
<h4 class="alert-heading"><?php echo JText::_('K2_NOTICE'); ?></h4>
|
||||
<div><p><?php echo JText::_('K2_NOTICE_PLEASE_INSTALL_JOOMLAWORKS_ALLVIDEOS_PLUGIN_IF_YOU_WANT_TO_USE_THE_FULL_VIDEO_FEATURES_OF_K2'); ?></p></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<table class="admintable table" id="item_video_content">
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_SOURCE'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<div id="k2VideoTabs" class="simpleTabs">
|
||||
<ul class="simpleTabsNavigation">
|
||||
<li><a href="#k2VideoTab4"><?php echo JText::_('K2_EMBED'); ?></a></li>
|
||||
</ul>
|
||||
<div class="simpleTabsContent" id="k2VideoTab4">
|
||||
<div class="panel" id="embedVideo">
|
||||
<?php echo JText::_('K2_PASTE_HTML_EMBED_CODE_BELOW'); ?>
|
||||
<br />
|
||||
<textarea name="embedVideo" rows="5" cols="50" class="textarea"><?php echo $this->lists['embedVideo']; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_CAPTION'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="video_caption" size="50" class="text_area" value="<?php echo $this->row->video_caption; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_CREDITS'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="video_credits" size="50" class="text_area" value="<?php echo $this->row->video_credits; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($this->row->video): ?>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_MEDIA_PREVIEW'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->row->video; ?>
|
||||
<br />
|
||||
<input type="checkbox" name="del_video" id="del_video" />
|
||||
<label for="del_video"><?php echo JText::_('K2_USE_THE_FORM_ABOVE_TO_REPLACE_THE_EXISTING_VIDEO_OR_CHECK_THIS_BOX_TO_DELETE_CURRENT_VIDEO'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
<?php if (count($this->K2PluginsItemVideo)): ?>
|
||||
<div class="itemPlugins">
|
||||
<?php foreach($this->K2PluginsItemVideo as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset>
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showExtraFieldsTab')): ?>
|
||||
<!-- Tab extra fields -->
|
||||
<div class="simpleTabsContent" id="k2Tab5">
|
||||
<div id="extraFieldsContainer">
|
||||
<?php if (count($this->extraFields)): ?>
|
||||
<table class="admintable table" id="extraFields">
|
||||
<?php foreach($this->extraFields as $extraField): ?>
|
||||
<tr>
|
||||
<?php if($extraField->type == 'header'): ?>
|
||||
<td colspan="2" ><h4 class="k2ExtraFieldHeader"><?php echo $extraField->name; ?></h4></td>
|
||||
<?php else: ?>
|
||||
<td align="right" class="key">
|
||||
<label for="K2ExtraField_<?php echo $extraField->id; ?>"><?php echo $extraField->name; ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $extraField->element; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<?php if (K2_JVERSION == '15'): ?>
|
||||
<dl id="system-message">
|
||||
<dt class="notice"><?php echo JText::_('K2_NOTICE'); ?></dt>
|
||||
<dd class="notice message fade">
|
||||
<ul>
|
||||
<li><?php echo JText::_('K2_PLEASE_SELECT_A_CATEGORY_FIRST_TO_RETRIEVE_ITS_RELATED_EXTRA_FIELDS'); ?></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php elseif (K2_JVERSION == '25'): ?>
|
||||
<div id="system-message-container">
|
||||
<dl id="system-message">
|
||||
<dt class="notice"><?php echo JText::_('K2_NOTICE'); ?></dt>
|
||||
<dd class="notice message">
|
||||
<ul>
|
||||
<li><?php echo JText::_('K2_PLEASE_SELECT_A_CATEGORY_FIRST_TO_RETRIEVE_ITS_RELATED_EXTRA_FIELDS'); ?></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert">
|
||||
<h4 class="alert-heading"><?php echo JText::_('K2_NOTICE'); ?></h4>
|
||||
<div>
|
||||
<p><?php echo JText::_('K2_PLEASE_SELECT_A_CATEGORY_FIRST_TO_RETRIEVE_ITS_RELATED_EXTRA_FIELDS'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (count($this->K2PluginsItemExtraFields)): ?>
|
||||
<div class="itemPlugins">
|
||||
<?php foreach($this->K2PluginsItemExtraFields as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset>
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('showAttachmentsTab')): ?>
|
||||
<!-- Tab attachements -->
|
||||
<div class="simpleTabsContent" id="k2Tab6">
|
||||
<div class="itemAttachments">
|
||||
<?php if (count($this->row->attachments)): ?>
|
||||
<table class="adminlist table">
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo JText::_('K2_FILENAME'); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JText::_('K2_TITLE'); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JText::_('K2_TITLE_ATTRIBUTE'); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JText::_('K2_DOWNLOADS'); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JText::_('K2_OPERATIONS'); ?>
|
||||
</th>
|
||||
</tr>
|
||||
<?php foreach($this->row->attachments as $attachment): ?>
|
||||
<tr>
|
||||
<td class="attachment_entry">
|
||||
<?php echo $attachment->filename; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $attachment->title; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $attachment->titleAttribute; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $attachment->hits; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo $attachment->link; ?>"><?php echo JText::_('K2_DOWNLOAD'); ?></a> <a class="deleteAttachmentButton" href="<?php echo JURI::base(true); ?>/index.php?option=com_k2&view=item&task=deleteAttachment&id=<?php echo $attachment->id?>&cid=<?php echo $this->row->id; ?>"><?php echo JText::_('K2_DELETE'); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="addAttachment">
|
||||
<input type="button" id="addAttachmentButton" value="<?php echo JText::_('K2_ADD_ATTACHMENT_FIELD'); ?>" />
|
||||
<i>(<?php echo JText::_('K2_MAX_UPLOAD_SIZE'); ?>: <?php echo ini_get('upload_max_filesize'); ?>)</i> </div>
|
||||
<div id="itemAttachments"></div>
|
||||
<?php if (count($this->K2PluginsItemAttachments)): ?>
|
||||
<div class="itemPlugins">
|
||||
<?php foreach($this->K2PluginsItemAttachments as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset>
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if(count(array_filter($this->K2PluginsItemOther)) && $this->params->get('showK2Plugins')): ?>
|
||||
<!-- Tab other plugins -->
|
||||
<div class="simpleTabsContent" id="k2Tab7">
|
||||
<div class="itemPlugins">
|
||||
<?php foreach($this->K2PluginsItemOther as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset>
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<!-- Tabs end here -->
|
||||
|
||||
<input type="hidden" name="isSite" value="<?php echo (int)$this->mainframe->isSite(); ?>" />
|
||||
<?php if($this->mainframe->isSite()): ?>
|
||||
<input type="hidden" name="lang" value="<?php echo JRequest::getCmd('lang'); ?>" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="item" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<input type="hidden" name="Itemid" value="<?php echo JRequest::getInt('Itemid'); ?>" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</td>
|
||||
<td id="adminFormK2Sidebar"<?php if($this->mainframe->isSite() && !$this->params->get('sideBarDisplayFrontend')): ?> style="display:none;"<?php endif; ?> class="xmlParamsFields">
|
||||
<?php if($this->row->id): ?>
|
||||
<table class="sidebarDetails table">
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_ITEM_ID'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->row->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_PUBLISHED'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo ($this->row->published > 0) ? JText::_('K2_YES') : JText::_('K2_NO'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_FEATURED'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo ($this->row->featured > 0) ? JText::_('K2_YES'): JText::_('K2_NO'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_CREATED_DATE'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['created']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_CREATED_BY'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->row->author; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_MODIFIED_DATE'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['modified']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_MODIFIED_BY'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->row->moderator; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_HITS'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->row->hits; ?>
|
||||
<?php if($this->row->hits): ?>
|
||||
<input id="resetHitsButton" type="button" value="<?php echo JText::_('K2_RESET'); ?>" class="button" name="resetHits" />
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if($this->row->id): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php echo JText::_('K2_RATING'); ?></strong>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->row->ratingCount; ?> <?php echo JText::_('K2_VOTES'); ?>
|
||||
<?php if($this->row->ratingCount): ?>
|
||||
<br />
|
||||
(<?php echo JText::_('K2_AVERAGE_RATING'); ?>: <?php echo number_format(($this->row->ratingSum/$this->row->ratingCount),2); ?>/5.00)
|
||||
<?php endif; ?>
|
||||
<input id="resetRatingButton" type="button" value="<?php echo JText::_('K2_RESET'); ?>" class="button" name="resetRating" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
<div id="k2Accordion">
|
||||
<h3><a href="#"><?php echo JText::_('K2_AUTHOR_PUBLISHING_STATUS'); ?></a></h3>
|
||||
<div>
|
||||
<table class="admintable table">
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_LANGUAGE'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['language']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_AUTHOR'); ?>
|
||||
</td>
|
||||
<td id="k2AuthorOptions">
|
||||
<span id="k2Author"><?php echo $this->row->author; ?></span>
|
||||
<?php if($this->mainframe->isAdmin() || ($this->mainframe->isSite() && $this->permissions->get('editAll'))): ?>
|
||||
<a class="modal" rel="{handler:'iframe', size: {x: 800, y: 460}}" href="index.php?option=com_k2&view=users&task=element&tmpl=component"><?php echo JText::_('K2_CHANGE'); ?></a>
|
||||
<input type="hidden" name="created_by" value="<?php echo $this->row->created_by; ?>" />
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_AUTHOR_ALIAS'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input class="text_area" type="text" name="created_by_alias" maxlength="250" value="<?php echo $this->row->created_by_alias; ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_ACCESS_LEVEL'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->lists['access']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_CREATION_DATE'); ?>
|
||||
</td>
|
||||
<td class="k2ItemFormDateField">
|
||||
<?php echo $this->lists['createdCalendar']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_START_PUBLISHING'); ?>
|
||||
</td>
|
||||
<td class="k2ItemFormDateField">
|
||||
<?php echo $this->lists['publish_up']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_FINISH_PUBLISHING'); ?>
|
||||
</td>
|
||||
<td class="k2ItemFormDateField">
|
||||
<?php echo $this->lists['publish_down']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<h3><a href="#"><?php echo JText::_('K2_METADATA_INFORMATION'); ?></a></h3>
|
||||
<div>
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_DESCRIPTION'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="metadesc" rows="5" cols="20"><?php echo $this->row->metadesc; ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_KEYWORDS'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="metakey" rows="5" cols="20"><?php echo $this->row->metakey; ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_ROBOTS'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="meta[robots]" value="<?php echo $this->lists['metadata']->get('robots'); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" class="key">
|
||||
<?php echo JText::_('K2_AUTHOR'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="meta[author]" value="<?php echo $this->lists['metadata']->get('author'); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php if($this->mainframe->isAdmin()): ?>
|
||||
<h3><a href="#"><?php echo JText::_('K2_ITEM_VIEW_OPTIONS_IN_CATEGORY_LISTINGS'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(version_compare( JVERSION, '1.6.0', 'ge' )): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach($this->form->getFieldset('item-view-options-listings') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'item-view-options-listings'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<h3><a href="#"><?php echo JText::_('K2_ITEM_VIEW_OPTIONS'); ?></a></h3>
|
||||
<div>
|
||||
<?php if(version_compare( JVERSION, '1.6.0', 'ge' )): ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach($this->form->getFieldset('item-view-options') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php else: ?>
|
||||
<?php echo $this->form->render('params', 'item-view-options'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if($this->aceAclFlag): ?>
|
||||
<h3><a href="#"><?php echo JText::_('AceACL') . ' ' . JText::_('COM_ACEACL_COMMON_PERMISSIONS'); ?></a></h3>
|
||||
<div><?php AceaclApi::getWidget('com_k2.item.'.$this->row->id, true); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="clr"></div>
|
||||
<?php if($this->mainframe->isSite()): ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
520
administrator/components/com_k2/views/item/view.html.php
Normal file
520
administrator/components/com_k2/views/item/view.html.php
Normal file
@ -0,0 +1,520 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1983 2013-05-31 13:36:41Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewItem extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
$view = JRequest::getCmd('view');
|
||||
jimport('joomla.filesystem.file');
|
||||
jimport('joomla.html.pane');
|
||||
JHTML::_('behavior.keepalive');
|
||||
JHTML::_('behavior.modal');
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScript(JURI::root(true).'/media/k2/assets/js/nicEdit.js?v=2.6.7');
|
||||
//var K2SitePath = '".JURI::root(true)."/';
|
||||
$js = "
|
||||
var K2BasePath = '".JURI::base(true)."/';
|
||||
var K2Language = [
|
||||
'".JText::_('K2_REMOVE', true)."',
|
||||
'".JText::_('K2_LINK_TITLE_OPTIONAL', true)."',
|
||||
'".JText::_('K2_LINK_TITLE_ATTRIBUTE_OPTIONAL', true)."',
|
||||
'".JText::_('K2_ARE_YOU_SURE', true)."',
|
||||
'".JText::_('K2_YOU_ARE_NOT_ALLOWED_TO_POST_TO_THIS_CATEGORY', true)."',
|
||||
'".JText::_('K2_OR_SELECT_A_FILE_ON_THE_SERVER', true)."'
|
||||
]
|
||||
";
|
||||
$document->addScriptDeclaration($js);
|
||||
K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models');
|
||||
$model = K2Model::getInstance('Item', 'K2Model', array('table_path' => JPATH_COMPONENT_ADMINISTRATOR.DS.'tables'));
|
||||
$item = $model->getData();
|
||||
JFilterOutput::objectHTMLSafe($item, ENT_QUOTES, array('video', 'params', 'plugins'));
|
||||
$user = JFactory::getUser();
|
||||
|
||||
// Permissions check on frontend
|
||||
if ($mainframe->isSite())
|
||||
{
|
||||
JLoader::register('K2HelperPermissions', JPATH_COMPONENT.DS.'helpers'.DS.'permissions.php');
|
||||
$task = JRequest::getCmd('task');
|
||||
if ($task == 'edit' && !K2HelperPermissions::canEditItem($item->created_by, $item->catid))
|
||||
{
|
||||
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
|
||||
}
|
||||
if ($task == 'add' && !K2HelperPermissions::canAddItem())
|
||||
{
|
||||
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
|
||||
}
|
||||
// Get permissions
|
||||
$K2Permissions = K2Permissions::getInstance();
|
||||
$this->assignRef('permissions', $K2Permissions->permissions);
|
||||
}
|
||||
|
||||
if ($item->isCheckedOut($user->get('id'), $item->checked_out))
|
||||
{
|
||||
$message = JText::_('K2_THE_ITEM').': '.$item->title.' '.JText::_('K2_IS_CURRENTLY_BEING_EDITED_BY_ANOTHER_ADMINISTRATOR');
|
||||
$url = ($mainframe->isSite()) ? 'index.php?option=com_k2&view=item&id='.$item->id.'&tmpl=component' : 'index.php?option=com_k2';
|
||||
$mainframe->redirect($url, $message);
|
||||
}
|
||||
|
||||
if ($item->id)
|
||||
{
|
||||
$item->checkout($user->get('id'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->published = 1;
|
||||
$item->publish_down = $db->getNullDate();
|
||||
$item->modified = $db->getNullDate();
|
||||
$date = JFactory::getDate();
|
||||
$now = K2_JVERSION == '15' ? $date->toMySQL() : $date->toSql();
|
||||
$item->created = $now;
|
||||
$item->publish_up = $item->created;
|
||||
}
|
||||
|
||||
$lists = array();
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
$dateFormat = JText::_('K2_J16_DATE_FORMAT_CALENDAR');
|
||||
}
|
||||
else
|
||||
{
|
||||
$dateFormat = JText::_('K2_DATE_FORMAT_CALENDAR');
|
||||
}
|
||||
$item->publish_up = JHTML::_('date', $item->publish_up, $dateFormat);
|
||||
if ($item->publish_down == $db->getNullDate())
|
||||
{
|
||||
$item->publish_down = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->publish_down = JHTML::_('date', $item->publish_down, $dateFormat);
|
||||
}
|
||||
|
||||
// Set up calendars
|
||||
$created = JHTML::_('date', $item->created, $dateFormat);
|
||||
$lists['createdCalendar'] = JHTML::_('calendar', $created, 'created', 'created');
|
||||
$lists['publish_up'] = JHTML::_('calendar', $item->publish_up, 'publish_up', 'publish_up');
|
||||
$lists['publish_down'] = JHTML::_('calendar', $item->publish_down, 'publish_down', 'publish_down');
|
||||
|
||||
if ($item->id)
|
||||
{
|
||||
$lists['created'] = JHTML::_('date', $item->created, JText::_('DATE_FORMAT_LC2'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$lists['created'] = JText::_('K2_NEW_DOCUMENT');
|
||||
}
|
||||
|
||||
if ($item->modified == $db->getNullDate() || !$item->id)
|
||||
{
|
||||
$lists['modified'] = JText::_('K2_NEVER');
|
||||
}
|
||||
else
|
||||
{
|
||||
$lists['modified'] = JHTML::_('date', $item->modified, JText::_('DATE_FORMAT_LC2'));
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$wysiwyg = JFactory::getEditor();
|
||||
$onSave = '';
|
||||
if ($params->get("mergeEditors"))
|
||||
{
|
||||
|
||||
if (JString::strlen($item->fulltext) > 1)
|
||||
{
|
||||
$textValue = $item->introtext."<hr id=\"system-readmore\" />".$item->fulltext;
|
||||
}
|
||||
else
|
||||
{
|
||||
$textValue = $item->introtext;
|
||||
}
|
||||
$text = $wysiwyg->display('text', $textValue, '100%', '400px', '', '');
|
||||
$this->assignRef('text', $text);
|
||||
if(K2_JVERSION == '30')
|
||||
{
|
||||
$onSave = $wysiwyg->save('text');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$introtext = $wysiwyg->display('introtext', $item->introtext, '100%', '400px', '', '', array('readmore'));
|
||||
$this->assignRef('introtext', $introtext);
|
||||
$fulltext = $wysiwyg->display('fulltext', $item->fulltext, '100%', '400px', '', '', array('readmore'));
|
||||
$this->assignRef('fulltext', $fulltext);
|
||||
if(K2_JVERSION == '30')
|
||||
{
|
||||
$onSave = $wysiwyg->save('introtext');
|
||||
$onSave .= $wysiwyg->save('fulltext');
|
||||
}
|
||||
}
|
||||
|
||||
$document->addScriptDeclaration("function onK2EditorSave(){ ".$onSave." }");
|
||||
|
||||
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $item->published);
|
||||
$lists['featured'] = JHTML::_('select.booleanlist', 'featured', 'class="inputbox"', $item->featured);
|
||||
$lists['access'] = version_compare(JVERSION, '3.0', 'ge') ? JHTML::_('access.level', 'access', $item->access) : JHTML::_('list.accesslevel', $item);
|
||||
|
||||
$query = "SELECT ordering AS value, title AS text FROM #__k2_items WHERE catid={$item->catid}";
|
||||
$lists['ordering'] = version_compare(JVERSION, '3.0', 'ge') ? NUll : JHTML::_('list.specificordering', $item, $item->id, $query);
|
||||
|
||||
if (!$item->id)
|
||||
$item->catid = $mainframe->getUserStateFromRequest('com_k2itemsfilter_category', 'catid', 0, 'int');
|
||||
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/categories.php';
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$categories = $categoriesModel->categoriesTree();
|
||||
$lists['catid'] = JHTML::_('select.genericlist', $categories, 'catid', 'class="inputbox"', 'value', 'text', $item->catid);
|
||||
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
$languages = JHTML::_('contentlanguage.existing', true, true);
|
||||
$lists['language'] = JHTML::_('select.genericlist', $languages, 'language', '', 'value', 'text', $item->language);
|
||||
}
|
||||
|
||||
$lists['checkSIG'] = $model->checkSIG();
|
||||
$lists['checkAllVideos'] = $model->checkAllVideos();
|
||||
|
||||
$remoteVideo = false;
|
||||
$providerVideo = false;
|
||||
$embedVideo = false;
|
||||
|
||||
if (stristr($item->video, 'remote}') !== false)
|
||||
{
|
||||
$remoteVideo = true;
|
||||
$options['startOffset'] = 1;
|
||||
}
|
||||
|
||||
$providers = $model->getVideoProviders();
|
||||
|
||||
if (count($providers))
|
||||
{
|
||||
|
||||
foreach ($providers as $provider)
|
||||
{
|
||||
$providersOptions[] = JHTML::_('select.option', $provider, ucfirst($provider));
|
||||
if (stristr($item->video, "{{$provider}}") !== false)
|
||||
{
|
||||
$providerVideo = true;
|
||||
$options['startOffset'] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (JString::substr($item->video, 0, 1) !== '{')
|
||||
{
|
||||
$embedVideo = true;
|
||||
$options['startOffset'] = 3;
|
||||
}
|
||||
|
||||
$lists['uploadedVideo'] = (!$remoteVideo && !$providerVideo && !$embedVideo) ? true : false;
|
||||
|
||||
if ($lists['uploadedVideo'] || $item->video == '')
|
||||
{
|
||||
$options['startOffset'] = 0;
|
||||
}
|
||||
|
||||
$document->addScriptDeclaration("var K2ActiveVideoTab = ".$options['startOffset']);
|
||||
|
||||
$lists['remoteVideo'] = ($remoteVideo) ? preg_replace('%\{[a-z0-9-_]*\}(.*)\{/[a-z0-9-_]*\}%i', '\1', $item->video) : '';
|
||||
$lists['remoteVideoType'] = ($remoteVideo) ? preg_replace('%\{([a-z0-9-_]*)\}.*\{/[a-z0-9-_]*\}%i', '\1', $item->video) : '';
|
||||
$lists['providerVideo'] = ($providerVideo) ? preg_replace('%\{[a-z0-9-_]*\}(.*)\{/[a-z0-9-_]*\}%i', '\1', $item->video) : '';
|
||||
$lists['providerVideoType'] = ($providerVideo) ? preg_replace('%\{([a-z0-9-_]*)\}.*\{/[a-z0-9-_]*\}%i', '\1', $item->video) : '';
|
||||
$lists['embedVideo'] = ($embedVideo) ? $item->video : '';
|
||||
|
||||
if (isset($providersOptions))
|
||||
{
|
||||
$lists['providers'] = JHTML::_('select.genericlist', $providersOptions, 'videoProvider', '', 'value', 'text', $lists['providerVideoType']);
|
||||
}
|
||||
|
||||
JPluginHelper::importPlugin('content', 'jw_sigpro');
|
||||
JPluginHelper::importPlugin('content', 'jw_allvideos');
|
||||
|
||||
$dispatcher = JDispatcher::getInstance();
|
||||
|
||||
// Detect gallery type
|
||||
if (JString::strpos($item->gallery, 'http://'))
|
||||
{
|
||||
$item->galleryType = 'flickr';
|
||||
$item->galleryValue = JString::substr($item->gallery, 9);
|
||||
$item->galleryValue = JString::substr($item->galleryValue, 0, -10);
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->galleryType = 'server';
|
||||
$item->galleryValue = '';
|
||||
}
|
||||
|
||||
$params->set('galleries_rootfolder', 'media/k2/galleries');
|
||||
$params->set('thb_width', '150');
|
||||
$params->set('thb_height', '120');
|
||||
$params->set('enabledownload', '0');
|
||||
$item->text = $item->gallery;
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
$dispatcher->trigger('onPrepareContent', array(&$item, &$params, null));
|
||||
}
|
||||
else
|
||||
{
|
||||
$dispatcher->trigger('onContentPrepare', array('com_k2.'.$view, &$item, &$params, null));
|
||||
}
|
||||
$item->gallery = $item->text;
|
||||
|
||||
if (!$embedVideo)
|
||||
{
|
||||
$params->set('vfolder', 'media/k2/videos');
|
||||
$params->set('afolder', 'media/k2/audio');
|
||||
if (JString::strpos($item->video, 'remote}'))
|
||||
{
|
||||
preg_match("#}(.*?){/#s", $item->video, $matches);
|
||||
if (JString::substr($matches[1], 0, 7) != 'http://')
|
||||
$item->video = str_replace($matches[1], JURI::root().$matches[1], $item->video);
|
||||
}
|
||||
$item->text = $item->video;
|
||||
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
$dispatcher->trigger('onPrepareContent', array(&$item, &$params, null));
|
||||
}
|
||||
else
|
||||
{
|
||||
$dispatcher->trigger('onContentPrepare', array('com_k2.'.$view, &$item, &$params, null));
|
||||
}
|
||||
|
||||
$item->video = $item->text;
|
||||
}
|
||||
else
|
||||
{
|
||||
// no nothing
|
||||
}
|
||||
|
||||
if (isset($item->created_by))
|
||||
{
|
||||
$author = JUser::getInstance($item->created_by);
|
||||
$item->author = $author->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->author = $user->name;
|
||||
}
|
||||
if (isset($item->modified_by))
|
||||
{
|
||||
$moderator = JUser::getInstance($item->modified_by);
|
||||
$item->moderator = $moderator->name;
|
||||
}
|
||||
|
||||
if ($item->id)
|
||||
{
|
||||
$active = $item->created_by;
|
||||
}
|
||||
else
|
||||
{
|
||||
$active = $user->id;
|
||||
}
|
||||
$lists['authors'] = JHTML::_('list.users', 'created_by', $active, false);
|
||||
|
||||
$categories_option[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_CATEGORY'));
|
||||
$categories = $categoriesModel->categoriesTree(NUll, true, false);
|
||||
if ($mainframe->isSite())
|
||||
{
|
||||
JLoader::register('K2HelperPermissions', JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'permissions.php');
|
||||
if (($task == 'add' || $task == 'edit') && !K2HelperPermissions::canAddToAll())
|
||||
{
|
||||
for ($i = 0; $i < sizeof($categories); $i++)
|
||||
{
|
||||
if (!K2HelperPermissions::canAddItem($categories[$i]->value) && $task == 'add')
|
||||
{
|
||||
$categories[$i]->disable = true;
|
||||
}
|
||||
if (!K2HelperPermissions::canEditItem($item->created_by, $categories[$i]->value) && $task == 'edit')
|
||||
{
|
||||
$categories[$i]->disable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$categories_options = @array_merge($categories_option, $categories);
|
||||
$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'catid', '', 'value', 'text', $item->catid);
|
||||
|
||||
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
|
||||
$category = JTable::getInstance('K2Category', 'Table');
|
||||
$category->load($item->catid);
|
||||
|
||||
$extraFieldModel = K2Model::getInstance('ExtraField', 'K2Model');
|
||||
if ($category->id)
|
||||
{
|
||||
$extraFields = $extraFieldModel->getExtraFieldsByGroup($category->extraFieldsGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
$extraFields = NULL;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < sizeof($extraFields); $i++)
|
||||
{
|
||||
$extraFields[$i]->element = $extraFieldModel->renderExtraField($extraFields[$i], $item->id);
|
||||
}
|
||||
|
||||
if ($item->id)
|
||||
{
|
||||
$item->attachments = $model->getAttachments($item->id);
|
||||
$rating = $model->getRating();
|
||||
if (is_null($rating))
|
||||
{
|
||||
$item->ratingSum = 0;
|
||||
$item->ratingCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->ratingSum = (int)$rating->rating_sum;
|
||||
$item->ratingCount = (int)$rating->rating_count;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->attachments = NULL;
|
||||
$item->ratingSum = 0;
|
||||
$item->ratingCount = 0;
|
||||
}
|
||||
|
||||
if ($user->gid < 24 && $params->get('lockTags'))
|
||||
{
|
||||
$params->set('taggingSystem', 0);
|
||||
}
|
||||
|
||||
$tags = $model->getAvailableTags($item->id);
|
||||
$lists['tags'] = JHTML::_('select.genericlist', $tags, 'tags', 'multiple="multiple" size="10" ', 'id', 'name');
|
||||
|
||||
if (isset($item->id))
|
||||
{
|
||||
$item->tags = $model->getCurrentTags($item->id);
|
||||
$lists['selectedTags'] = JHTML::_('select.genericlist', $item->tags, 'selectedTags[]', 'multiple="multiple" size="10" ', 'id', 'name');
|
||||
}
|
||||
else
|
||||
{
|
||||
$lists['selectedTags'] = '<select size="10" multiple="multiple" id="selectedTags" name="selectedTags[]"></select>';
|
||||
}
|
||||
|
||||
$lists['metadata'] = class_exists('JParameter') ? new JParameter($item->metadata) : new JRegistry($item->metadata);
|
||||
|
||||
$date = JFactory::getDate($item->modified);
|
||||
$timestamp = '?t='.$date->toUnix();
|
||||
|
||||
if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_L.jpg'))
|
||||
{
|
||||
$item->image = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg'.$timestamp;
|
||||
}
|
||||
|
||||
if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_S.jpg'))
|
||||
{
|
||||
$item->thumb = JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_S.jpg'.$timestamp;
|
||||
}
|
||||
|
||||
JPluginHelper::importPlugin('k2');
|
||||
$dispatcher = JDispatcher::getInstance();
|
||||
|
||||
$K2PluginsItemContent = $dispatcher->trigger('onRenderAdminForm', array(&$item, 'item', 'content'));
|
||||
$this->assignRef('K2PluginsItemContent', $K2PluginsItemContent);
|
||||
|
||||
$K2PluginsItemImage = $dispatcher->trigger('onRenderAdminForm', array(&$item, 'item', 'image'));
|
||||
$this->assignRef('K2PluginsItemImage', $K2PluginsItemImage);
|
||||
|
||||
$K2PluginsItemGallery = $dispatcher->trigger('onRenderAdminForm', array(&$item, 'item', 'gallery'));
|
||||
$this->assignRef('K2PluginsItemGallery', $K2PluginsItemGallery);
|
||||
|
||||
$K2PluginsItemVideo = $dispatcher->trigger('onRenderAdminForm', array(&$item, 'item', 'video'));
|
||||
$this->assignRef('K2PluginsItemVideo', $K2PluginsItemVideo);
|
||||
|
||||
$K2PluginsItemExtraFields = $dispatcher->trigger('onRenderAdminForm', array(&$item, 'item', 'extra-fields'));
|
||||
$this->assignRef('K2PluginsItemExtraFields', $K2PluginsItemExtraFields);
|
||||
|
||||
$K2PluginsItemAttachments = $dispatcher->trigger('onRenderAdminForm', array(&$item, 'item', 'attachments'));
|
||||
$this->assignRef('K2PluginsItemAttachments', $K2PluginsItemAttachments);
|
||||
|
||||
$K2PluginsItemOther = $dispatcher->trigger('onRenderAdminForm', array(&$item, 'item', 'other'));
|
||||
$this->assignRef('K2PluginsItemOther', $K2PluginsItemOther);
|
||||
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
jimport('joomla.form.form');
|
||||
$form = JForm::getInstance('itemForm', JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'item.xml');
|
||||
$values = array('params' => json_decode($item->params));
|
||||
$form->bind($values);
|
||||
}
|
||||
else
|
||||
{
|
||||
$form = new JParameter('', JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'item.xml');
|
||||
$form->loadINI($item->params);
|
||||
}
|
||||
$this->assignRef('form', $form);
|
||||
|
||||
$nullDate = $db->getNullDate();
|
||||
$this->assignRef('nullDate', $nullDate);
|
||||
|
||||
$this->assignRef('extraFields', $extraFields);
|
||||
$this->assignRef('options', $options);
|
||||
$this->assignRef('row', $item);
|
||||
$this->assignRef('lists', $lists);
|
||||
$this->assignRef('params', $params);
|
||||
$this->assignRef('user', $user);
|
||||
(JRequest::getInt('cid')) ? $title = JText::_('K2_EDIT_ITEM') : $title = JText::_('K2_ADD_ITEM');
|
||||
$this->assignRef('title', $title);
|
||||
$this->assignRef('mainframe', $mainframe);
|
||||
if ($mainframe->isAdmin())
|
||||
{
|
||||
$this->params->set('showImageTab', true);
|
||||
$this->params->set('showImageGalleryTab', true);
|
||||
$this->params->set('showVideoTab', true);
|
||||
$this->params->set('showExtraFieldsTab', true);
|
||||
$this->params->set('showAttachmentsTab', true);
|
||||
$this->params->set('showK2Plugins', true);
|
||||
JToolBarHelper::title($title, 'k2.png');
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::custom('saveAndNew', 'save.png', 'save_f2.png', 'K2_SAVE_AND_NEW', false);
|
||||
JToolBarHelper::apply();
|
||||
JToolBarHelper::cancel();
|
||||
}
|
||||
// ACE ACL integration
|
||||
$definedConstants = get_defined_constants();
|
||||
if (!empty($definedConstants['ACEACL']) && AceaclApi::authorize('permissions', 'com_aceacl'))
|
||||
{
|
||||
$aceAclFlag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aceAclFlag = false;
|
||||
}
|
||||
$this->assignRef('aceAclFlag', $aceAclFlag);
|
||||
|
||||
// SIG PRO v3 integration
|
||||
if (JPluginHelper::isEnabled('k2', 'jw_sigpro'))
|
||||
{
|
||||
$sigPro = true;
|
||||
$sigProFolder = ($this->row->id) ? $this->row->id : uniqid();
|
||||
$this->assignRef('sigProFolder', $sigProFolder);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sigPro = false;
|
||||
}
|
||||
$this->assignRef('sigPro', $sigPro);
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
204
administrator/components/com_k2/views/items/tmpl/default.php
Normal file
204
administrator/components/com_k2/views/items/tmpl/default.php
Normal file
@ -0,0 +1,204 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
\$K2(document).ready(function(){
|
||||
\$K2('#K2ImportContentButton').click(function(event){
|
||||
var answer = confirm('".JText::_('K2_WARNING_YOU_ARE_ABOUT_TO_IMPORT_ALL_SECTIONS_CATEGORIES_AND_ARTICLES_FROM_JOOMLAS_CORE_CONTENT_COMPONENT_COM_CONTENT_INTO_K2_IF_THIS_IS_THE_FIRST_TIME_YOU_IMPORT_CONTENT_TO_K2_AND_YOUR_SITE_HAS_MORE_THAN_A_FEW_THOUSAND_ARTICLES_THE_PROCESS_MAY_TAKE_A_FEW_MINUTES_IF_YOU_HAVE_EXECUTED_THIS_OPERATION_BEFORE_DUPLICATE_CONTENT_MAY_BE_PRODUCED', true)."');
|
||||
if(!answer){
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch"><?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_TITLE'); ?>" />
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['trash']; ?>
|
||||
<?php echo $this->lists['featured']; ?>
|
||||
<?php echo $this->lists['categories']; ?>
|
||||
<?php if(isset($this->lists['tag'])): ?>
|
||||
<?php echo $this->lists['tag']; ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->lists['authors']; ?> <?php echo $this->lists['state']; ?>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<?php echo $this->lists['language']; ?>
|
||||
<?php endif; ?>
|
||||
<?php foreach($this->filters as $filter):?>
|
||||
<?php echo $filter; ?>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="adminlist table table-striped" id="k2ItemsList">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<th width="1%" class="center hidden-phone">
|
||||
<?php if($this->filter_featured=='1'): ?>
|
||||
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'i.featured_ordering', @$this->lists['order_Dir'], @$this->lists['order'], null, 'asc', 'K2_FEATURED_ORDER'); ?>
|
||||
<?php else: ?>
|
||||
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'i.ordering', @$this->lists['order_Dir'], @$this->lists['order'], null, 'asc', 'K2_ORDER'); ?>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<?php else: ?>
|
||||
<th>#</th>
|
||||
<?php endif; ?>
|
||||
<th class="center">
|
||||
<input id="jToggler" type="checkbox" name="toggle" value="" />
|
||||
</th>
|
||||
<th class="title"> <?php echo JHTML::_('grid.sort', 'K2_TITLE', 'i.title', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="center"> <?php echo JHTML::_('grid.sort', 'K2_FEATURED', 'i.featured', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="center"> <?php echo JHTML::_('grid.sort', 'K2_PUBLISHED', 'i.published', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<?php if(K2_JVERSION != '30'): ?>
|
||||
<th>
|
||||
<?php if($this->filter_featured=='1'): ?>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_FEATURED_ORDER', 'i.featured_ordering', @$this->lists['order_Dir'], @$this->lists['order']); ?>
|
||||
<?php if($this->ordering) {echo JHTML::_('grid.order', $this->rows, 'filesave.png','savefeaturedorder');} ?>
|
||||
<?php else: ?>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ORDER', 'i.ordering', @$this->lists['order_Dir'], @$this->lists['order']); ?>
|
||||
<?php if($this->ordering) {echo JHTML::_('grid.order', $this->rows);} ?>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<?php endif; ?>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_CATEGORY', 'category', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_AUTHOR', 'author', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_LAST_MODIFIED_BY', 'moderator', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="hidden-phone center"> <?php echo JHTML::_('grid.sort', 'K2_ACCESS_LEVEL', 'i.access', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_CREATED', 'i.created', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_MODIFIED', 'i.modified', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="center hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_HITS', 'i.hits', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<th class="hidden-phone center"> <?php echo JText::_('K2_IMAGE'); ?> </th>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_LANGUAGE', 'i.language', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<?php endif; ?>
|
||||
<th class="hidden-phone"> <?php echo JHTML::_('grid.sort', 'K2_ID', 'i.id', @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<?php foreach($this->columns as $column):?>
|
||||
<th> <?php echo JHTML::_('grid.sort', $column->label, $column->property, @$this->lists['order_Dir'], @$this->lists['order']); ?> </th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="<?php echo 16+sizeof($this->columns); ?>">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>"<?php if($this->filter_featured!='1') echo ' sortable-group-id="'.$row->catid.'"'; ?>>
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<td class="order center hidden-phone">
|
||||
<?php if($row->canChange): ?>
|
||||
<span class="sortable-handler<?php echo ($this->ordering) ? '' : ' inactive tip-top' ; ?>" title="<?php echo ($this->ordering) ? '' : JText::_('JORDERINGDISABLED'); ?>" rel="tooltip"><i class="icon-menu"></i></span>
|
||||
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="width-20 text-area-order " />
|
||||
<?php else: ?>
|
||||
<span class="sortable-handler inactive" ><i class="icon-menu"></i></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td><?php echo $key+1; ?></td>
|
||||
<?php endif; ?>
|
||||
<td class="center"><?php echo @JHTML::_('grid.checkedout', $row, $key); ?></td>
|
||||
<td>
|
||||
<?php if($this->table->isCheckedOut($this->user->get('id'), $row->checked_out)): ?>
|
||||
<?php echo $row->title; ?>
|
||||
<?php else: ?>
|
||||
<?php if(!$this->filter_trash): ?>
|
||||
<a href="<?php echo JRoute::_('index.php?option=com_k2&view=item&cid='.$row->id); ?>"><?php echo $row->title; ?></a>
|
||||
<?php else: ?>
|
||||
<?php echo $row->title; ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="k2Center center"><?php echo $row->featuredStatus; ?></td>
|
||||
<td class="k2Center center"><?php echo $row->status; ?></td>
|
||||
<?php if(K2_JVERSION != '30'): ?>
|
||||
<td class="order k2Order">
|
||||
<?php if($this->filter_featured=='1'): ?>
|
||||
<span><?php echo $this->page->orderUpIcon($key, true, 'featuredorderup', 'K2_MOVE_UP', $this->ordering); ?></span> <span><?php echo $this->page->orderDownIcon($key, count($this->rows), true, 'featuredorderdown', 'K2_MOVE_DOWN', $this->ordering); ?></span>
|
||||
<input type="text" name="order[]" size="5" value="<?php echo $row->featured_ordering; ?>" <?php echo ($this->ordering) ? '' : 'disabled="disabled"' ?> class="text_area k2OrderBox" />
|
||||
<?php else: ?>
|
||||
<span><?php echo $this->page->orderUpIcon($key, ($row->catid == @$this->rows[$key-1]->catid), 'orderup', 'K2_MOVE_UP', $this->ordering); ?></span> <span><?php echo $this->page->orderDownIcon($key, count($this->rows), ($row->catid == @$this->rows[$key+1]->catid), 'orderdown', 'K2_MOVE_DOWN', $this->ordering); ?></span>
|
||||
<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo ($this->ordering)? '' : 'disabled="disabled"' ?> class="text_area k2OrderBox" />
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="hidden-phone"><a href="<?php echo JRoute::_('index.php?option=com_k2&view=category&cid='.$row->catid); ?>"><?php echo $row->category; ?></a></td>
|
||||
<td class="hidden-phone">
|
||||
<?php if($this->user->gid>23): ?>
|
||||
<a href="<?php echo JRoute::_('index.php?option=com_k2&view=user&cid='.$row->created_by); ?>"><?php echo $row->author; ?></a>
|
||||
<?php else: ?>
|
||||
<?php echo $row->author; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
<?php if($this->user->gid>23): ?>
|
||||
<a href="<?php echo JRoute::_('index.php?option=com_k2&view=user&cid='.$row->modified_by); ?>"><?php echo $row->moderator; ?></a>
|
||||
<?php else: ?>
|
||||
<?php echo $row->moderator; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="k2Center hidden-phone center"><?php echo ($this->filter_trash || K2_JVERSION != '15')? $row->groupname:JHTML::_('grid.access', $row, $key); ?></td>
|
||||
<td class="k2Date hidden-phone"><?php echo JHTML::_('date', $row->created , $this->dateFormat); ?></td>
|
||||
<td class="k2Date hidden-phone"><?php echo ($row->modified == $this->nullDate) ? JText::_('K2_NEVER') : JHTML::_('date', $row->modified , $this->dateFormat); ?></td>
|
||||
<td class="center hidden-phone"><?php echo $row->hits ?></td>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php if(JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$row->id).'_XL.jpg')): ?>
|
||||
<a href="<?php echo JURI::root(true).'/media/k2/items/cache/'.md5("Image".$row->id).'_XL.jpg'; ?>" title="<?php echo JText::_('K2_PREVIEW_IMAGE'); ?>" class="modal">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<i class="icon-picture" title="<?php echo JText::_('K2_PREVIEW_IMAGE'); ?>"></i>
|
||||
<?php else: ?>
|
||||
<img src="templates/<?php echo $this->template; ?>/images/menu/icon-16-media.png" alt="<?php echo JText::_('K2_PREVIEW_IMAGE'); ?>" />
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<td class="center hidden-phone"><?php echo $row->language; ?></td>
|
||||
<?php endif; ?>
|
||||
<td class="center hidden-phone"><?php echo $row->id; ?></td>
|
||||
<?php foreach($this->columns as $column):?>
|
||||
<td <?php if($column->class){ echo 'class="'.$column->class.'"';}?>>
|
||||
<?php $property = $column->property; echo $row->$property; ?>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</form>
|
||||
82
administrator/components/com_k2/views/items/tmpl/element.php
Normal file
82
administrator/components/com_k2/views/items/tmpl/element.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: element.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<h1><?php echo JText::_('K2_SELECT_ITEMS'); ?></h1>
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_TITLE'); ?>"/>
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['trash']; ?>
|
||||
<?php echo $this->lists['featured']; ?> |
|
||||
<?php echo $this->lists['categories']; ?>
|
||||
<?php if(isset($this->lists['tag'])): ?>
|
||||
<?php echo $this->lists['tag']; ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->lists['authors']; ?>
|
||||
<?php echo $this->lists['state']; ?>
|
||||
<?php if(isset($this->lists['language'])): ?>
|
||||
<?php echo $this->lists['language']; ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_NUM'); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_TITLE', 'i.title', @$this->lists['order_Dir'], @$this->lists['order']); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_CATEGORY', 'category', @$this->lists['order_Dir'], @$this->lists['order']); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_AUTHOR', 'author', @$this->lists['order_Dir'], @$this->lists['order']); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_ACCESS_LEVEL', 'i.access', @$this->lists['order_Dir'], @$this->lists['order']); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_CREATED', 'i.created', @$this->lists['order_Dir'], @$this->lists['order']); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_ID', 'i.id', @$this->lists['order_Dir'], @$this->lists['order']); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td><?php echo $key+1; ?></td>
|
||||
<td><a class="k2ListItemDisabled" title="<?php echo JText::_('K2_CLICK_TO_ADD_THIS_ITEM'); ?>" onclick="window.parent.jSelectItem('<?php echo $row->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$row->title); ?>', '<?php echo JRequest::getCmd('object', 'id'); ?>');"><?php echo $row->title; ?></a></td>
|
||||
<td><?php echo $row->category; ?></td>
|
||||
<td><?php echo $row->author; ?></td>
|
||||
<td class="k2Center"><?php echo $row->groupname; ?></td>
|
||||
<td class="k2Date"><?php echo $row->created; ?></td>
|
||||
<td><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="items" />
|
||||
<input type="hidden" name="task" value="element" />
|
||||
<input type="hidden" name="tmpl" value="component" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
</form>
|
||||
46
administrator/components/com_k2/views/items/tmpl/move.php
Normal file
46
administrator/components/com_k2/views/items/tmpl/move.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: move.php 1877 2013-02-07 14:37:58Z joomlaworks $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = & JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#category').val()) == '') {
|
||||
alert( '".JText::_('K2_YOU_MUST_SELECT_A_TARGET_CATEGORY', true)."' );
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" id="adminForm" name="adminForm">
|
||||
<fieldset>
|
||||
<legend><?php echo JText::_('K2_TARGET_CATEGORY'); ?></legend>
|
||||
<?php echo $this->lists['categories']; ?>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>(<?php echo count($this->rows); ?>) <?php echo JText::_('K2_ITEMS_BEING_MOVED'); ?></legend>
|
||||
<ol>
|
||||
<?php foreach ($this->rows as $row): ?>
|
||||
<li><?php echo $row->title; ?><input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" /></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
</form>
|
||||
352
administrator/components/com_k2/views/items/view.html.php
Normal file
352
administrator/components/com_k2/views/items/view.html.php
Normal file
@ -0,0 +1,352 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1953 2013-04-02 16:34:59Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewItems extends K2View
|
||||
{
|
||||
function display($tpl = null)
|
||||
{
|
||||
JHTML::_('behavior.modal');
|
||||
jimport('joomla.filesystem.file');
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', 'i.id', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
|
||||
$filter_trash = $mainframe->getUserStateFromRequest($option.$view.'filter_trash', 'filter_trash', 0, 'int');
|
||||
$filter_featured = $mainframe->getUserStateFromRequest($option.$view.'filter_featured', 'filter_featured', -1, 'int');
|
||||
$filter_category = $mainframe->getUserStateFromRequest($option.$view.'filter_category', 'filter_category', 0, 'int');
|
||||
$filter_author = $mainframe->getUserStateFromRequest($option.$view.'filter_author', 'filter_author', 0, 'int');
|
||||
$filter_state = $mainframe->getUserStateFromRequest($option.$view.'filter_state', 'filter_state', -1, 'int');
|
||||
$search = $mainframe->getUserStateFromRequest($option.$view.'search', 'search', '', 'string');
|
||||
$search = JString::strtolower($search);
|
||||
$tag = $mainframe->getUserStateFromRequest($option.$view.'tag', 'tag', 0, 'int');
|
||||
$language = $mainframe->getUserStateFromRequest($option.$view.'language', 'language', '', 'string');
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
$nullDate = $db->getNullDate();
|
||||
$this->assignRef('nullDate', $nullDate);
|
||||
|
||||
$model = $this->getModel();
|
||||
$total = $model->getTotal();
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
$items = $model->getData();
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$langs = JLanguageHelper::getLanguages();
|
||||
$langsMapping = array();
|
||||
$langsMapping['*'] = JText::_('K2_ALL');
|
||||
foreach ($langs as $lang)
|
||||
{
|
||||
$langsMapping[$lang->lang_code] = $lang->title;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($items as $key => $item)
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$item->status = JHtml::_('jgrid.published', $item->published, $key, '', ($filter_trash == 0), 'cb', $item->publish_up, $item->publish_down);
|
||||
$states = array(
|
||||
1 => array(
|
||||
'featured',
|
||||
'K2_FEATURED',
|
||||
'K2_REMOVE_FEATURED_FLAG',
|
||||
'K2_FEATURED',
|
||||
false,
|
||||
'publish',
|
||||
'publish'
|
||||
),
|
||||
0 => array(
|
||||
'featured',
|
||||
'K2_NOT_FEATURED',
|
||||
'K2_FLAG_AS_FEATURED',
|
||||
'K2_NOT_FEATURED',
|
||||
false,
|
||||
'unpublish',
|
||||
'unpublish'
|
||||
),
|
||||
);
|
||||
$item->featuredStatus = JHtml::_('jgrid.state', $states, $item->featured, $key, '', $filter_trash == 0);
|
||||
$item->canChange = $user->authorise('core.edit.state', 'com_k2.item.'.$item->id);
|
||||
$item->language = $item->language ? $item->language : '*';
|
||||
if (isset($langsMapping))
|
||||
{
|
||||
$item->language = $langsMapping[$item->language];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$now = JFactory::getDate();
|
||||
$config = JFactory::getConfig();
|
||||
$publish_up = JFactory::getDate($item->publish_up);
|
||||
$publish_down = JFactory::getDate($item->publish_down);
|
||||
$publish_up->setOffset($config->getValue('config.offset'));
|
||||
$publish_down->setOffset($config->getValue('config.offset'));
|
||||
$img = 'tick.png';
|
||||
if ($now->toUnix() <= $publish_up->toUnix() && $item->published == 1)
|
||||
{
|
||||
$img = 'publish_y.png';
|
||||
}
|
||||
else if (($now->toUnix() <= $publish_down->toUnix() || $item->publish_down == $nullDate) && $item->published == 1)
|
||||
{
|
||||
$img = 'tick.png';
|
||||
}
|
||||
else if ($now->toUnix() > $publish_down->toUnix() && $item->published == 1)
|
||||
{
|
||||
$img = 'publish_r.png';
|
||||
}
|
||||
$item->status = JHTML::_('grid.published', $item, $key, $img);
|
||||
if ($filter_trash)
|
||||
{
|
||||
$item->status = strip_tags($item->status, '<img>');
|
||||
}
|
||||
|
||||
$item->featuredStatus = '';
|
||||
if (!$filter_trash)
|
||||
{
|
||||
$tmpTitle = $item->featured ? JText::_('K2_REMOVE_FEATURED_FLAG') : JText::_('K2_FLAG_AS_FEATURED');
|
||||
$item->featuredStatus .= '<a href="javascript:void(0);" onclick="return listItemTask(\'cb'.$key.'\',\'featured\')" title="'.$tmpTitle.'">';
|
||||
|
||||
}
|
||||
$item->state = $item->published;
|
||||
$item->published = $item->featured;
|
||||
$item->featuredStatus .= strip_tags(JHTML::_('grid.published', $item, $key), '<img>');
|
||||
$item->published = $item->state;
|
||||
if (!$filter_trash)
|
||||
{
|
||||
$item->featuredStatus .= '</a>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$this->assignRef('rows', $items);
|
||||
|
||||
$lists = array();
|
||||
$lists['search'] = $search;
|
||||
|
||||
if (!$filter_order)
|
||||
{
|
||||
$filter_order = 'category';
|
||||
}
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
|
||||
$filter_trash_options[] = JHTML::_('select.option', 0, JText::_('K2_CURRENT'));
|
||||
$filter_trash_options[] = JHTML::_('select.option', 1, JText::_('K2_TRASHED'));
|
||||
$lists['trash'] = JHTML::_('select.genericlist', $filter_trash_options, 'filter_trash', '', 'value', 'text', $filter_trash);
|
||||
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/categories.php';
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$categories_option[] = JHTML::_('select.option', 0, JText::_('K2_SELECT_CATEGORY'));
|
||||
$categories = $categoriesModel->categoriesTree(NULL, true, false);
|
||||
$categories_options = @array_merge($categories_option, $categories);
|
||||
$lists['categories'] = JHTML::_('select.genericlist', $categories_options, 'filter_category', '', 'value', 'text', $filter_category);
|
||||
|
||||
$authors = $model->getItemsAuthors();
|
||||
$options = array();
|
||||
$options[] = JHTML::_('select.option', 0, '- '.JText::_('K2_NO_USER').' -');
|
||||
foreach ($authors as $author)
|
||||
{
|
||||
$name = $author->name;
|
||||
if ($author->block)
|
||||
{
|
||||
$name .= ' ['.JText::_('K2_USER_DISABLED').']';
|
||||
}
|
||||
$options[] = JHTML::_('select.option', $author->id, $name);
|
||||
}
|
||||
$lists['authors'] = JHTML::_('select.genericlist', $options, 'filter_author', '', 'value', 'text', $filter_author);
|
||||
|
||||
$filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_PUBLISHING_STATE'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
|
||||
$lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
|
||||
|
||||
$filter_featured_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_FEATURED_STATE'));
|
||||
$filter_featured_options[] = JHTML::_('select.option', 1, JText::_('K2_FEATURED'));
|
||||
$filter_featured_options[] = JHTML::_('select.option', 0, JText::_('K2_NOT_FEATURED'));
|
||||
$lists['featured'] = JHTML::_('select.genericlist', $filter_featured_options, 'filter_featured', '', 'value', 'text', $filter_featured);
|
||||
|
||||
if ($params->get('showTagFilter'))
|
||||
{
|
||||
$tagsModel = K2Model::getInstance('Tags', 'K2Model');
|
||||
$options = $tagsModel->getFilter();
|
||||
$option = new JObject();
|
||||
$option->id = 0;
|
||||
$option->name = JText::_('K2_SELECT_TAG');
|
||||
array_unshift($options, $option);
|
||||
$lists['tag'] = JHTML::_('select.genericlist', $options, 'tag', '', 'id', 'name', $tag);
|
||||
}
|
||||
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
$languages = JHTML::_('contentlanguage.existing', true, true);
|
||||
array_unshift($languages, JHTML::_('select.option', '', JText::_('K2_SELECT_LANGUAGE')));
|
||||
$lists['language'] = JHTML::_('select.genericlist', $languages, 'language', '', 'value', 'text', $language);
|
||||
}
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
$filters = array();
|
||||
$columns = array();
|
||||
$dispatcher = JDispatcher::getInstance();
|
||||
JPluginHelper::importPlugin('k2');
|
||||
$dispatcher->trigger('onK2BeforeAssignFilters', array(&$filters));
|
||||
$this->assignRef('filters', $filters);
|
||||
$dispatcher->trigger('onK2BeforeAssignColumns', array(&$columns));
|
||||
$this->assignRef('columns', $columns);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_ITEMS'), 'k2.png');
|
||||
if ($filter_trash == 1)
|
||||
{
|
||||
JToolBarHelper::custom('restore', 'publish.png', 'publish_f2.png', 'K2_RESTORE', true);
|
||||
JToolBarHelper::deleteList('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_ITEMS', 'remove', 'K2_DELETE');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
|
||||
K2_JVERSION == '30' ? JToolBarHelper::custom('featured', 'featured.png', 'featured_f2.png', 'K2_TOGGLE_FEATURED_STATE', true) : JToolBarHelper::custom('featured', 'default.png', 'default_f2.png', 'K2_TOGGLE_FEATURED_STATE', true);
|
||||
JToolBarHelper::publishList();
|
||||
JToolBarHelper::unpublishList();
|
||||
JToolBarHelper::custom('move', 'move.png', 'move_f2.png', 'K2_MOVE', true);
|
||||
JToolBarHelper::custom('copy', 'copy.png', 'copy_f2.png', 'K2_COPY', true);
|
||||
JToolBarHelper::editList();
|
||||
JToolBarHelper::addNew();
|
||||
JToolBarHelper::trash('trash');
|
||||
|
||||
}
|
||||
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar->appendButton('Popup', 'config', 'K2_PARAMETERS', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
// Import Joomla! content button
|
||||
if ($user->gid > 23 && !$params->get('hideImportButton'))
|
||||
{
|
||||
$buttonUrl = JURI::base().'index.php?option=com_k2&view=items&task=import';
|
||||
$buttonText = JText::_('K2_IMPORT_JOOMLA_CONTENT');
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
$button = '<a id="K2ImportContentButton" class="btn btn-small" href="'.$buttonUrl.'"><i class="icon-archive "></i>'.$buttonText.'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$button = '<a id="K2ImportContentButton" href="'.$buttonUrl.'"><span class="icon-32-archive" title="'.$buttonText.'"></span>'.$buttonText.'</a>';
|
||||
}
|
||||
$toolbar->appendButton('Custom', $button);
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
$template = $mainframe->getTemplate();
|
||||
$this->assignRef('template', $template);
|
||||
$this->assignRef('filter_featured', $filter_featured);
|
||||
$this->assignRef('filter_trash', $filter_trash);
|
||||
$this->assignRef('user', $user);
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$dateFormat = JText::_('K2_J16_DATE_FORMAT');
|
||||
}
|
||||
else
|
||||
{
|
||||
$dateFormat = JText::_('K2_DATE_FORMAT');
|
||||
}
|
||||
$this->assignRef('dateFormat', $dateFormat);
|
||||
|
||||
$ordering = (($this->lists['order'] == 'i.ordering' || $this->lists['order'] == 'category' || ($this->filter_featured > 0 && $this->lists['order'] == 'i.featured_ordering')) && (!$this->filter_trash));
|
||||
$this->assignRef('ordering', $ordering);
|
||||
|
||||
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
|
||||
$table = JTable::getInstance('K2Item', 'Table');
|
||||
$this->assignRef('table', $table);
|
||||
|
||||
// Joomla! 3.0 drag-n-drop sorting variables
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
if ($ordering)
|
||||
{
|
||||
$action = $this->filter_featured == 1 ? 'savefeaturedorder' : 'saveorder';
|
||||
JHtml::_('sortablelist.sortable', 'k2ItemsList', 'adminForm', strtolower($this->lists['order_Dir']), 'index.php?option=com_k2&view=items&task='.$action.'&format=raw');
|
||||
}
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration('
|
||||
Joomla.orderTable = function() {
|
||||
table = document.getElementById("sortTable");
|
||||
direction = document.getElementById("directionTable");
|
||||
order = table.options[table.selectedIndex].value;
|
||||
if (order != \''.$this->lists['order'].'\') {
|
||||
dirn = \'asc\';
|
||||
} else {
|
||||
dirn = direction.options[direction.selectedIndex].value;
|
||||
}
|
||||
Joomla.tableOrdering(order, dirn, "");
|
||||
}');
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function move()
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
|
||||
$cid = JRequest::getVar('cid');
|
||||
|
||||
foreach ($cid as $id)
|
||||
{
|
||||
$row = JTable::getInstance('K2Item', 'Table');
|
||||
$row->load($id);
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$categories = $categoriesModel->categoriesTree(null, true, false);
|
||||
$lists['categories'] = JHTML::_('select.genericlist', $categories, 'category', 'class="inputbox" size="8"', 'value', 'text');
|
||||
|
||||
$this->assignRef('rows', $rows);
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_MOVE_ITEMS'), 'k2.png');
|
||||
|
||||
JToolBarHelper::custom('saveMove', 'save.png', 'save_f2.png', 'K2_SAVE', false);
|
||||
JToolBarHelper::cancel();
|
||||
|
||||
parent::display();
|
||||
}
|
||||
|
||||
}
|
||||
31
administrator/components/com_k2/views/media/tmpl/default.php
Normal file
31
administrator/components/com_k2/views/media/tmpl/default.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die; ?>
|
||||
<script type="text/javascript">
|
||||
$K2(document).ready(function() {
|
||||
var basePath = '<?php echo JURI::root(true); ?>';
|
||||
var elf = $K2('#elfinder').elfinder({
|
||||
url : '<?php echo JURI::base(true); ?>/index.php?option=com_k2&view=media&task=connector',
|
||||
<?php if($this->mimes): ?>
|
||||
onlyMimes: [<?php echo $this->mimes; ?>],
|
||||
<?php endif; ?>
|
||||
<?php if($this->fieldID): ?>
|
||||
getFileCallback : function(path) {
|
||||
value = path.replace(basePath, '');
|
||||
parent.elFinderUpdate('<?php echo $this->fieldID; ?>', value);
|
||||
}
|
||||
<?php else: ?>
|
||||
height: 600
|
||||
<?php endif; ?>
|
||||
}).elfinder('instance');
|
||||
});
|
||||
</script>
|
||||
<div id="elfinder"></div>
|
||||
62
administrator/components/com_k2/views/media/view.html.php
Normal file
62
administrator/components/com_k2/views/media/view.html.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1978 2013-05-15 19:34:16Z joomlaworks $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewMedia extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$document = JFactory::getDocument();
|
||||
$document->addStyleSheet('//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css');
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/theme.css?v=2.6.7');
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/elfinder.min.css?v=2.6.7');
|
||||
$type = JRequest::getCmd('type');
|
||||
$fieldID = JRequest::getCmd('fieldID');
|
||||
if ($type == 'video')
|
||||
{
|
||||
$mimes = "'video','audio'";
|
||||
}
|
||||
elseif ($type == 'image')
|
||||
{
|
||||
$mimes = "'image'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mimes = '';
|
||||
}
|
||||
$this->assignRef('mimes', $mimes);
|
||||
$this->assignRef('type', $type);
|
||||
$this->assignRef('fieldID', $fieldID);
|
||||
if ($mainframe->isAdmin())
|
||||
{
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar->appendButton('Popup', 'config', 'K2_PARAMETERS', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
JToolBarHelper::title(JText::_('K2_MEDIA_MANAGER'), 'k2.png');
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
}
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm">
|
||||
<fieldset>
|
||||
<div style="float:right;">
|
||||
<button onclick="submitbutton('save');window.top.setTimeout('window.parent.document.getElementById(\'sbox-window\').close()', 700);" type="button"><?php echo JText::_('K2_SAVE'); ?></button>
|
||||
<button onclick="window.parent.document.getElementById('sbox-window').close();" type="button"><?php echo JText::_('K2_CANCEL'); ?></button>
|
||||
</div>
|
||||
<div class="configuration">
|
||||
<?php echo JText::_('K2_PARAMETERS')?>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</fieldset>
|
||||
<?php echo $this->pane->startPane('settings'); ?>
|
||||
<?php foreach($this->params->getGroups() as $group=>$value): ?>
|
||||
<?php echo $this->pane->startPanel(JText::_($group), $group.'-tab'); ?>
|
||||
<?php echo $this->params->render('params', $group); ?>
|
||||
<?php echo $this->pane->endPanel(); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php echo $this->pane->endPane(); ?>
|
||||
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="settings" />
|
||||
<input type="hidden" id="task" name="task" value="" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</form>
|
||||
29
administrator/components/com_k2/views/settings/view.html.php
Normal file
29
administrator/components/com_k2/views/settings/view.html.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewSettings extends K2View {
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
jimport('joomla.html.pane');
|
||||
$model = &$this->getModel();
|
||||
$params = &$model->getParams();
|
||||
$this->assignRef('params', $params);
|
||||
$pane = & JPane::getInstance('Tabs');
|
||||
$this->assignRef('pane', $pane);
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
47
administrator/components/com_k2/views/tag/tmpl/default.php
Normal file
47
administrator/components/com_k2/views/tag/tmpl/default.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton){
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#name').val())=='') {
|
||||
alert( '".JText::_('K2_TAG_CANNOT_BE_EMPTY', true)."' );
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" enctype="multipart/form-data" method="post" name="adminForm" id="adminForm">
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_NAME'); ?></td>
|
||||
<td><input class="text_area k2TitleBox" type="text" name="name" id="name" value="<?php echo $this->row->name; ?>" size="50" maxlength="250" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_PUBLISHED'); ?></td>
|
||||
<td><?php echo $this->lists['published']; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="tag" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</form>
|
||||
41
administrator/components/com_k2/views/tag/view.html.php
Normal file
41
administrator/components/com_k2/views/tag/view.html.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewTag extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
$model = $this->getModel();
|
||||
$tag = $model->getData();
|
||||
JFilterOutput::objectHTMLSafe($tag);
|
||||
if (!$tag->id)
|
||||
$tag->published = 1;
|
||||
$this->assignRef('row', $tag);
|
||||
|
||||
$lists = array();
|
||||
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $tag->published);
|
||||
$this->assignRef('lists', $lists);
|
||||
(JRequest::getInt('cid')) ? $title = JText::_('K2_EDIT_TAG') : $title = JText::_('K2_ADD_TAG');
|
||||
JToolBarHelper::title($title, 'k2.png');
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::apply();
|
||||
JToolBarHelper::cancel();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
85
administrator/components/com_k2/views/tags/tmpl/default.php
Normal file
85
administrator/components/com_k2/views/tags/tmpl/default.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'remove') {
|
||||
if (confirm('".JText::_('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_TAGS', true)."')){
|
||||
submitform( pressbutton );
|
||||
}
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_NAME'); ?>"/>
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['state']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="center hidden-phone">#</th>
|
||||
<th class="center"><input id="jToggler" type="checkbox" name="toggle" value="" /></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_NAME', 'name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="center"><?php echo JHTML::_('grid.sort', 'K2_PUBLISHED', 'published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_ITEMS', 'numOfItems', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_ID', 'id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td class="k2Center center hidden-phone"><?php echo $key+1; ?></td>
|
||||
<td class="k2Center center"><?php $row->checked_out = 0; echo @JHTML::_('grid.checkedout', $row, $key ); ?></td>
|
||||
<td><a href="<?php echo JRoute::_('index.php?option=com_k2&view=tag&cid='.$row->id); ?>"><?php echo $row->name; ?></a></td>
|
||||
<td class="k2Center center"><?php echo $row->status; ?></td>
|
||||
<td class="k2Center center hidden-phone"><?php echo $row->numOfItems; ?></td>
|
||||
<td class="k2Center center hidden-phone"><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
66
administrator/components/com_k2/views/tags/tmpl/element.php
Normal file
66
administrator/components/com_k2/views/tags/tmpl/element.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: element.php 1997 2013-07-08 11:04:41Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_NAME'); ?>"/>
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['state']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('K2_NUM'); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_NAME', 'name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?> </th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_PUBLISHED', 'published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?> </th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_ID', 'id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td><?php echo $key+1; ?></td>
|
||||
<td><a style="cursor:pointer" onclick="window.parent.jSelectTag('<?php echo urlencode($row->name); ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$row->name); ?>', 'tag');"><?php echo $row->name; ?></a></td>
|
||||
<td><?php echo $row->status; ?></td>
|
||||
<td class="k2Center"><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="tags" />
|
||||
<input type="hidden" name="task" value="element" />
|
||||
<input type="hidden" name="tmpl" value="component" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
88
administrator/components/com_k2/views/tags/view.html.php
Normal file
88
administrator/components/com_k2/views/tags/view.html.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1928 2013-02-12 12:13:18Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewTags extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', 'id', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
|
||||
$filter_state = $mainframe->getUserStateFromRequest($option.$view.'filter_state', 'filter_state', -1, 'int');
|
||||
$search = $mainframe->getUserStateFromRequest($option.$view.'search', 'search', '', 'string');
|
||||
$search = JString::strtolower($search);
|
||||
$model = $this->getModel();
|
||||
$total = $model->getTotal();
|
||||
$task = JRequest::getCmd('task');
|
||||
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
$tags = $model->getData();
|
||||
foreach ($tags as $key => $tag)
|
||||
{
|
||||
$tag->status = K2_JVERSION == '15' ? JHTML::_('grid.published', $tag, $key) : JHtml::_('jgrid.published', $tag->published, $key, '', $task != 'element');
|
||||
}
|
||||
$this->assignRef('rows', $tags);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
$lists = array();
|
||||
$lists['search'] = $search;
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
|
||||
$filter_state_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 1, JText::_('K2_PUBLISHED'));
|
||||
$filter_state_options[] = JHTML::_('select.option', 0, JText::_('K2_UNPUBLISHED'));
|
||||
$lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', '', 'value', 'text', $filter_state);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_TAGS'), 'k2.png');
|
||||
|
||||
JToolBarHelper::publishList();
|
||||
JToolBarHelper::unpublishList();
|
||||
JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
|
||||
JToolBarHelper::custom('removeOrphans', 'delete', 'delete', 'K2_DELETE_ORPHAN_TAGS', false);
|
||||
JToolBarHelper::editList();
|
||||
JToolBarHelper::addNew();
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
78
administrator/components/com_k2/views/user/tmpl/default.php
Normal file
78
administrator/components/com_k2/views/user/tmpl/default.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" enctype="multipart/form-data" method="post" name="adminForm" id="adminForm">
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_NAME'); ?></td>
|
||||
<td><?php echo $this->row->name; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_GENDER'); ?></td>
|
||||
<td><fieldset class="k2RadioButtonContainer"><?php echo $this->lists['gender']; ?></fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_USER_GROUP'); ?></td>
|
||||
<td><?php echo $this->lists['userGroup']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_DESCRIPTION'); ?></td>
|
||||
<td>
|
||||
<div class="k2ItemFormEditor">
|
||||
<?php echo $this->editor; ?>
|
||||
<div class="dummyHeight"></div>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_USER_IMAGE_AVATAR'); ?></td>
|
||||
<td>
|
||||
<input type="file" name="image" />
|
||||
<?php if($this->row->image): ?>
|
||||
<img class="k2AdminImage" src="<?php echo JURI::root().'media/k2/users/'.$this->row->image; ?>" alt="<?php echo $this->row->name; ?>" />
|
||||
<input type="checkbox" name="del_image" id="del_image" />
|
||||
<label for="del_image"><?php echo JText::_('K2_CHECK_THIS_BOX_TO_DELETE_CURRENT_IMAGE_OR_JUST_UPLOAD_A_NEW_IMAGE_TO_REPLACE_THE_EXISTING_ONE'); ?></label>
|
||||
<?php endif; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_URL'); ?></td>
|
||||
<td><input type="text" size="50" value="<?php echo $this->row->url; ?>" name="url" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_NOTES'); ?></td>
|
||||
<td><textarea name="notes" cols="60" rows="5"><?php echo $this->row->notes; ?></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php if(count(array_filter($this->K2Plugins))): ?>
|
||||
<?php foreach ($this->K2Plugins as $K2Plugin): ?>
|
||||
<?php if(!is_null($K2Plugin)): ?>
|
||||
<fieldset class="adminform">
|
||||
<legend><?php echo $K2Plugin->name; ?></legend>
|
||||
<?php echo $K2Plugin->fields; ?>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="user" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<input type="hidden" name="userID" value="<?php echo $this->row->userID; ?>" />
|
||||
<input type="hidden" name="ip" value="<?php echo $this->row->ip; ?>" />
|
||||
<input type="hidden" name="hostname" value="<?php echo $this->row->hostname; ?>" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</form>
|
||||
80
administrator/components/com_k2/views/user/view.html.php
Normal file
80
administrator/components/com_k2/views/user/view.html.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewUser extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
$model = $this->getModel();
|
||||
$user = $model->getData();
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
JFilterOutput::objectHTMLSafe($user);
|
||||
}
|
||||
else
|
||||
{
|
||||
JFilterOutput::objectHTMLSafe($user, ENT_QUOTES, array('params', 'plugins'));
|
||||
}
|
||||
$joomlaUser = JUser::getInstance(JRequest::getInt('cid'));
|
||||
|
||||
$user->name = $joomlaUser->name;
|
||||
$user->userID = $joomlaUser->id;
|
||||
$this->assignRef('row', $user);
|
||||
|
||||
$wysiwyg = JFactory::getEditor();
|
||||
$editor = $wysiwyg->display('description', $user->description, '480px', '250px', '', '', false);
|
||||
$this->assignRef('editor', $editor);
|
||||
|
||||
$lists = array();
|
||||
$genderOptions[] = JHTML::_('select.option', 'm', JText::_('K2_MALE'));
|
||||
$genderOptions[] = JHTML::_('select.option', 'f', JText::_('K2_FEMALE'));
|
||||
$lists['gender'] = JHTML::_('select.radiolist', $genderOptions, 'gender', '', 'value', 'text', $user->gender);
|
||||
|
||||
$userGroupOptions = $model->getUserGroups();
|
||||
$lists['userGroup'] = JHTML::_('select.genericlist', $userGroupOptions, 'group', 'class="inputbox"', 'id', 'name', $user->group);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$this->assignRef('params', $params);
|
||||
|
||||
JPluginHelper::importPlugin('k2');
|
||||
$dispatcher = JDispatcher::getInstance();
|
||||
$K2Plugins = $dispatcher->trigger('onRenderAdminForm', array(&$user, 'user'));
|
||||
$this->assignRef('K2Plugins', $K2Plugins);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_USER'), 'k2.png');
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::apply();
|
||||
JToolBarHelper::cancel();
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$buttonUrl = JURI::base().'index.php?option=com_users&view=user&task=user.edit&id='.$user->userID;
|
||||
}
|
||||
else
|
||||
{
|
||||
$buttonUrl = JURI::base().'index.php?option=com_users&view=user&task=edit&cid[]='.$user->userID;
|
||||
}
|
||||
$buttonText = JText::_('K2_EDIT_JOOMLA_USER');
|
||||
$button = '<a target="_blank" href="'.$buttonUrl.'"><span class="icon-32-edit" title="'.$buttonText.'"></span>'.$buttonText.'</a>';
|
||||
$toolbar->prependButton('Custom', $button);
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
101
administrator/components/com_k2/views/usergroup/tmpl/default.php
Normal file
101
administrator/components/com_k2/views/usergroup/tmpl/default.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton){
|
||||
if (pressbutton == 'cancel') {
|
||||
submitform( pressbutton );
|
||||
return;
|
||||
}
|
||||
if (\$K2.trim(\$K2('#name').val()) == '') {
|
||||
alert( '".JText::_('K2_GROUP_NAME_CANNOT_BE_EMPTY', true)."' );
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<div class="xmlParamsFields">
|
||||
<table class="admintable table">
|
||||
<tr>
|
||||
<td class="key"><?php echo JText::_('K2_GROUP_NAME'); ?></td>
|
||||
<td><input class="text_area k2TitleBox" type="text" name="name" id="name" value="<?php echo $this->row->name; ?>" size="50" maxlength="250" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="xmlParamsFields">
|
||||
<h2 class="paramHeader"><?php echo JText::_('K2_ASSIGN_PERMISSIONS_FOR_THIS_GROUP'); ?></h2>
|
||||
<?php if(K2_JVERSION == '15'): ?>
|
||||
<?php echo $this->form->render('params'); ?>
|
||||
<?php else: ?>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<?php foreach($this->form->getFieldset('user-permissions') as $field): ?>
|
||||
<li>
|
||||
<?php if($field->type=='header'): ?>
|
||||
<div class="paramValueHeader"><?php echo $field->input; ?></div>
|
||||
<?php elseif($field->type=='Spacer'): ?>
|
||||
<div class="paramValueSpacer"> </div>
|
||||
<div class="clr"></div>
|
||||
<?php else: ?>
|
||||
<div class="paramLabel"><?php echo $field->label; ?></div>
|
||||
<div class="paramValue"><?php echo $field->input; ?></div>
|
||||
<div class="clr"></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="xmlParamsFields">
|
||||
<h2 class="paramHeader"><?php echo JText::_('K2_ASSIGN_GROUP_PERMISSIONS_TO_THESE_CATEGORIES'); ?></h2>
|
||||
<fieldset class="panelform">
|
||||
<ul class="adminformlist">
|
||||
<li>
|
||||
<div class="paramLabel"><?php echo JText::_('K2_FILTER'); ?></div>
|
||||
<div class="paramValue">
|
||||
<input id="categories-all" type="radio" name="categories" value="all"<?php if($this->categories == 'all') echo ' checked="checked"'; ?> />
|
||||
<label for="categories-all"><?php echo JText::_('K2_ALL'); ?></label>
|
||||
<input id="categories-none" type="radio" name="categories" value="none"<?php if($this->categories == 'none') echo ' checked="checked"'; ?> />
|
||||
<label for="categories-none"><?php echo JText::_('K2_NONE'); ?></label>
|
||||
<input id="categories-select" type="radio" name="categories" value="select" <?php if($this->categories != 'all' && $this->categories != 'none') echo ' checked="checked"'; ?> />
|
||||
<label for="categories-select"><?php echo JText::_('K2_SELECT_FROM_LIST'); ?></label>
|
||||
</div>
|
||||
<div class="clr"></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="paramLabel"><span class="editlinktip"><label for="paramscategories" id="paramscategories-lbl"><?php echo JText::_('K2_CATEGORIES'); ?></label></span></div>
|
||||
<div class="paramValue"><?php echo $this->lists['categories']; ?></div>
|
||||
<div class="clr"></div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="paramLabel"><span class="editlinktip"><label for="paramsinheritance" id="paramsinheritanceh-lbl"><?php echo JText::_('K2_AUTOMATICALLY_ASSIGN_GROUP_PERMISSIONS_TO_THE_CHILDREN_OF_SELECTED_CATEGORIES'); ?></label></span></div>
|
||||
<div class="paramValue"><?php echo $this->lists['inheritance']; ?></div>
|
||||
<div class="clr"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="usergroup" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<?php echo JHTML::_('form.token'); ?>
|
||||
</form>
|
||||
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1962 2013-04-29 12:29:34Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewUserGroup extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
JHTML::_('behavior.tooltip');
|
||||
JRequest::setVar('hidemainmenu', 1);
|
||||
$model = $this->getModel();
|
||||
$userGroup = $model->getData();
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
JFilterOutput::objectHTMLSafe($userGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
JFilterOutput::objectHTMLSafe($userGroup, ENT_QUOTES, 'permissions');
|
||||
}
|
||||
$this->assignRef('row', $userGroup);
|
||||
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
$form = new JParameter('', JPATH_COMPONENT.DS.'models'.DS.'usergroup.xml');
|
||||
$form->loadINI($userGroup->permissions);
|
||||
$appliedCategories = $form->get('categories');
|
||||
$inheritance = $form->get('inheritance');
|
||||
}
|
||||
else
|
||||
{
|
||||
jimport('joomla.form.form');
|
||||
$form = JForm::getInstance('permissions', JPATH_COMPONENT_ADMINISTRATOR.DS.'models'.DS.'usergroup.xml');
|
||||
$values = array('params' => json_decode($userGroup->permissions));
|
||||
$form->bind($values);
|
||||
$inheritance = isset($values['params']->inheritance) ? $values['params']->inheritance : 0;
|
||||
$appliedCategories = isset($values['params']->categories) ? $values['params']->categories : '';
|
||||
}
|
||||
$this->assignRef('form', $form);
|
||||
$this->assignRef('categories', $appliedCategories);
|
||||
|
||||
$lists = array();
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_k2/models/categories.php';
|
||||
$categoriesModel = K2Model::getInstance('Categories', 'K2Model');
|
||||
$categories = $categoriesModel->categoriesTree(NULL, true);
|
||||
$categories_options = @array_merge($categories_option, $categories);
|
||||
$lists['categories'] = JHTML::_('select.genericlist', $categories, 'params[categories][]', 'multiple="multiple" size="15"', 'value', 'text', $appliedCategories);
|
||||
$lists['inheritance'] = JHTML::_('select.booleanlist', 'params[inheritance]', NULL, $inheritance);
|
||||
$this->assignRef('lists', $lists);
|
||||
(JRequest::getInt('cid')) ? $title = JText::_('K2_EDIT_USER_GROUP') : $title = JText::_('K2_ADD_USER_GROUP');
|
||||
JToolBarHelper::title($title, 'k2.png');
|
||||
JToolBarHelper::save();
|
||||
JToolBarHelper::apply();
|
||||
JToolBarHelper::cancel();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
Joomla.submitbutton = function(pressbutton) {
|
||||
if (pressbutton == 'remove') {
|
||||
if (confirm('".JText::_('K2_ARE_YOU_SURE_YOU_WANT_TO_DELETE_SELECTED_GROUPS', true)."')){
|
||||
submitform( pressbutton );
|
||||
}
|
||||
} else {
|
||||
submitform( pressbutton );
|
||||
}
|
||||
}
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="hidden-phone center">#</th>
|
||||
<th class="center"><input id="jToggler" type="checkbox" name="toggle" value="" /></th>
|
||||
<th class="title"><?php echo JHTML::_('grid.sort', 'K2_NAME', 'name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_USER_COUNT', 'numOfUsers', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_ID', 'id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td class="k2Center center hidden-phone"><?php echo $key+1; ?></td>
|
||||
<td class="k2Center center"><?php $row->checked_out = 0; echo @JHTML::_('grid.checkedout', $row, $key ); ?></td>
|
||||
<td><a href="<?php echo JRoute::_('index.php?option=com_k2&view=usergroup&cid='.$row->id); ?>"><?php echo $row->name; ?></a></td>
|
||||
<td class="k2Center center hidden-phone"><?php echo $row->numOfUsers; ?></td>
|
||||
<td class="k2Center center hidden-phone"><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewUserGroups extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$user = JFactory::getUser();
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', '', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', '', 'word');
|
||||
|
||||
$model = $this->getModel();
|
||||
$total = $model->getTotal();
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
$userGroups = $model->getData();
|
||||
|
||||
$this->assignRef('rows', $userGroups);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
$lists = array();
|
||||
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_USER_GROUPS'), 'k2.png');
|
||||
|
||||
JToolBarHelper::deleteList('', 'remove', 'K2_DELETE');
|
||||
JToolBarHelper::editList();
|
||||
JToolBarHelper::addNew();
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
$toolbar->appendButton('Popup', 'config', 'Parameters', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
}
|
||||
110
administrator/components/com_k2/views/users/tmpl/default.php
Normal file
110
administrator/components/com_k2/views/users/tmpl/default.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
\$K2(document).ready(function(){
|
||||
\$K2('#K2ImportUsersButton').click(function(event){
|
||||
var answer = confirm('".JText::_('K2_WARNING_YOU_ARE_ABOUT_TO_IMPORT_JOOMLA_USERS_TO_K2_GENERATING_CORRESPONDING_K2_USER_GROUPS_IF_YOU_HAVE_EXECUTED_THIS_OPERATION_BEFORE_DUPLICATE_CONTENT_MAY_BE_PRODUCED', true)."');
|
||||
if (!answer){
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
");
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<table class="k2AdminTableFilters table">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_NAME'); ?>" />
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['filter_group_k2']; ?>
|
||||
<?php echo $this->lists['filter_group']; ?>
|
||||
<?php echo $this->lists['status']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="hidden-phone">#</th>
|
||||
<th><input id="jToggler" type="checkbox" name="toggle" value="" /></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_NAME', 'juser.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_USERNAME', 'juser.username', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="center"><?php echo JText::_('K2_LOGGED_IN'); ?></th>
|
||||
<th class="center"><?php echo JHTML::_('grid.sort', 'K2_ENABLED', 'juser.block', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_JOOMLA_GROUP', 'juser.usertype', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_GROUP', 'groupname', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th><?php echo JHTML::_('grid.sort', 'K2_EMAIL', 'juser.email', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_LAST_VISIT', 'juser.lastvisitDate', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
<th class="center hidden-phone"><?php echo JText::_('K2_LAST_RECORDED_IP'); ?></th>
|
||||
<th class="center"><?php echo JText::_('K2_FLAG_AS_SPAMMER'); ?></th>
|
||||
<th class="center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_ID', 'juser.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="13">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td class="hidden-phone"><?php echo $key+1; ?></td>
|
||||
<td class="k2Center"><?php $row->checked_out = 0; echo JHTML::_('grid.id', $key, $row->id ); ?></td>
|
||||
<td><a href="<?php echo $row->link; ?>"><?php echo $row->name; ?></a></td>
|
||||
<td class="hidden-phone"><?php echo $row->username; ?></td>
|
||||
<td class="k2Center center"><?php echo $row->loggedInStatus; ?></td>
|
||||
<td class="k2Center center"><?php echo $row->blockStatus; ?></td>
|
||||
<td class="hidden-phone"><?php echo $row->usertype; ?></td>
|
||||
<td class="hidden-phone"><?php echo $row->groupname; ?></td>
|
||||
<td><?php echo $row->email; ?></td>
|
||||
<td class="k2Date hidden-phone"><?php echo ($row->lvisit) ? JHTML::_('date', $row->lvisit , $this->dateFormat):JText::_('K2_NEVER'); ?></td>
|
||||
<td class="k2Center center hidden-phone">
|
||||
<?php if($row->ip): ?>
|
||||
<a target="_blank" href="http://www.ipchecking.com/?ip=<?php echo $row->ip; ?>&check=Lookup">
|
||||
<?php echo $row->ip; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="k2Center center">
|
||||
<?php if(!$row->block): ?>
|
||||
<a class="k2ReportUserButton k2IsIcon" href="<?php echo JRoute::_('index.php?option=com_k2&view=user&task=report&id='.$row->id); ?>">×</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="center hidden-phone"><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
107
administrator/components/com_k2/views/users/tmpl/element.php
Normal file
107
administrator/components/com_k2/views/users/tmpl/element.php
Normal file
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: element.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<h1><?php echo JText::_('K2_SELECT_USERS'); ?></h1>
|
||||
<table class="k2AdminTableFilters">
|
||||
<tr>
|
||||
<td class="k2AdminTableFiltersSearch">
|
||||
<?php echo JText::_('K2_FILTER'); ?>
|
||||
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_NAME'); ?>" />
|
||||
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
|
||||
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
|
||||
</td>
|
||||
<td class="k2AdminTableFiltersSelects hidden-phone">
|
||||
<?php echo $this->lists['filter_group_k2']; ?> <?php echo $this->lists['filter_group']; ?> <?php echo $this->lists['status']; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="adminlist table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo JText::_('K2_NUM'); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_NAME', 'juser.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_USER_NAME', 'juser.username', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ENABLED', 'juser.block', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_GROUP', 'juser.usertype', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_K2_GROUP', 'groupname', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo JHTML::_('grid.sort', 'K2_ID', 'juser.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<?php if(K2_JVERSION == '30'): ?>
|
||||
<div class="k2LimitBox">
|
||||
<?php echo $this->page->getLimitBox(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->page->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach($this->rows as $key => $row): ?>
|
||||
<tr class="row<?php echo ($key%2); ?>">
|
||||
<td class="k2Center">
|
||||
<?php echo $key+1; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a class="k2ListItemDisabled" title="<?php echo JText::_('K2_CLICK_TO_ADD_THIS_ITEM'); ?>" onclick="window.parent.jSelectUser('<?php echo $row->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$row->name); ?>', 'id');"><?php echo $row->name; ?></a>
|
||||
</td>
|
||||
<td class="k2Center">
|
||||
<?php echo $row->username; ?>
|
||||
</td>
|
||||
<td class="k2Center">
|
||||
<?php echo $row->blockStatus; ?>
|
||||
</td>
|
||||
<td class="k2Center">
|
||||
<?php echo $row->usertype; ?>
|
||||
</td>
|
||||
<td class="k2Center">
|
||||
<?php echo $row->groupname; ?>
|
||||
</td>
|
||||
<td class="k2Center">
|
||||
<?php echo $row->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<?php if ($this->isAdmin): ?>
|
||||
<input type="hidden" name="view" value="users" />
|
||||
<input type="hidden" name="task" value="element" />
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="view" value="item" />
|
||||
<input type="hidden" name="task" value="users" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="tmpl" value="component" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
|
||||
</form>
|
||||
39
administrator/components/com_k2/views/users/tmpl/move.php
Normal file
39
administrator/components/com_k2/views/users/tmpl/move.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: move.php 1877 2013-02-07 14:37:58Z joomlaworks $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<form action="index.php" method="post" name="adminForm" id="adminForm">
|
||||
<fieldset style="float:left;">
|
||||
<legend><?php echo JText::_('K2_TARGET_JOOMLA_USER_GROUP'); ?></legend>
|
||||
<?php echo $this->lists['group']; ?>
|
||||
</fieldset>
|
||||
<fieldset style="float:left;">
|
||||
<legend><?php echo JText::_('K2_TARGET_K2_USER_GROUP'); ?></legend>
|
||||
<?php echo $this->lists['k2group']; ?>
|
||||
</fieldset>
|
||||
<fieldset style="clear:both;">
|
||||
<legend>(<?php echo count($this->rows); ?>) <?php echo JText::_('K2_USERS_BEING_MOVED'); ?></legend>
|
||||
<ol>
|
||||
<?php foreach ($this->rows as $row): ?>
|
||||
<li>
|
||||
<?php echo $row->name; ?>
|
||||
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<input type="hidden" name="option" value="com_k2" />
|
||||
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
|
||||
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
282
administrator/components/com_k2/views/users/view.html.php
Normal file
282
administrator/components/com_k2/views/users/view.html.php
Normal file
@ -0,0 +1,282 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.html.php 1978 2013-05-15 19:34:16Z joomlaworks $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
class K2ViewUsers extends K2View
|
||||
{
|
||||
|
||||
function display($tpl = null)
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
$document = JFactory::getDocument();
|
||||
$db = JFactory::getDBO();
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$option = JRequest::getCmd('option');
|
||||
$view = JRequest::getCmd('view');
|
||||
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
|
||||
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
|
||||
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', 'juser.name', 'cmd');
|
||||
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', '', 'word');
|
||||
$filter_status = $mainframe->getUserStateFromRequest($option.$view.'filter_status', 'filter_status', -1, 'int');
|
||||
$filter_group = $mainframe->getUserStateFromRequest($option.$view.'filter_group', 'filter_group', '', 'string');
|
||||
$filter_group_k2 = $mainframe->getUserStateFromRequest($option.$view.'filter_group_k2', 'filter_group_k2', '', 'string');
|
||||
$search = $mainframe->getUserStateFromRequest($option.$view.'search', 'search', '', 'string');
|
||||
$search = JString::strtolower($search);
|
||||
K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models');
|
||||
$model = K2Model::getInstance('Users', 'K2Model');
|
||||
$total = $model->getTotal();
|
||||
if ($limitstart > $total - $limit)
|
||||
{
|
||||
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
|
||||
JRequest::setVar('limitstart', $limitstart);
|
||||
}
|
||||
$users = $model->getData();
|
||||
$task = JRequest::getCmd('task');
|
||||
for ($i = 0; $i < sizeof($users); $i++)
|
||||
{
|
||||
|
||||
$users[$i]->loggedin = $model->checkLogin($users[$i]->id);
|
||||
$users[$i]->profileID = $model->hasProfile($users[$i]->id);
|
||||
if ($users[$i]->profileID)
|
||||
{
|
||||
$db->setQuery("SELECT ip FROM #__k2_users WHERE id = ".$users[$i]->profileID);
|
||||
$users[$i]->ip = $db->loadResult();
|
||||
}
|
||||
else
|
||||
{
|
||||
$users[$i]->ip = '';
|
||||
}
|
||||
|
||||
if ($users[$i]->lastvisitDate == "0000-00-00 00:00:00")
|
||||
{
|
||||
$users[$i]->lvisit = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$users[$i]->lvisit = $users[$i]->lastvisitDate;
|
||||
}
|
||||
$users[$i]->link = JRoute::_('index.php?option=com_k2&view=user&cid='.$users[$i]->id);
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
$users[$i]->published = $users[$i]->loggedin;
|
||||
$users[$i]->loggedInStatus = strip_tags(JHTML::_('grid.published', $users[$i], $i), '<img>');
|
||||
$users[$i]->blockStatus = '';
|
||||
if ($users[$i]->block)
|
||||
{
|
||||
$users[$i]->blockStatus .= '<a title="'.JText::_('K2_ENABLE').'" onclick="return listItemTask(\'cb'.$i.',\'enable\')" href="#"><img alt="'.JText::_('K2_ENABLED').'" src="images/publish_x.png"></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$users[$i]->blockStatus .= '<a title="'.JText::_('K2_DISABLE').'" onclick="return listItemTask(\'cb'.$i.',\'disable\')" href="#"><img alt="'.JText::_('K2_DISABLED').'" src="images/tick.png"></a>';
|
||||
}
|
||||
if ($task == 'element')
|
||||
{
|
||||
$users[$i]->blockStatus = strip_tags($users[$i]->blockStatus, '<img>');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$states = array(1 => array('', 'K2_LOGGED_IN', 'K2_LOGGED_IN', 'K2_LOGGED_IN', false, 'publish', 'publish'), 0 => array('', 'K2_NOT_LOGGED_IN', 'K2_NOT_LOGGED_IN', 'K2_NOT_LOGGED_IN', false, 'unpublish', 'unpublish'), );
|
||||
$users[$i]->loggedInStatus = JHtml::_('jgrid.state', $states, $users[$i]->loggedin, $i, '', false);
|
||||
$states = array(
|
||||
0 => array('disable', 'K2_ENABLED', 'K2_DISABLE', 'K2_ENABLED', false, 'publish', 'publish'),
|
||||
1 => array('enable', 'K2_DISABLED', 'K2_ENABLE', 'K2_DISABLED', false, 'unpublish', 'unpublish'));
|
||||
$users[$i]->blockStatus = JHtml::_('jgrid.state', $states, $users[$i]->block, $i, '', $task != 'element');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->assignRef('rows', $users);
|
||||
|
||||
jimport('joomla.html.pagination');
|
||||
$pageNav = new JPagination($total, $limitstart, $limit);
|
||||
$this->assignRef('page', $pageNav);
|
||||
|
||||
$lists = array();
|
||||
$lists['search'] = $search;
|
||||
$lists['order_Dir'] = $filter_order_Dir;
|
||||
$lists['order'] = $filter_order;
|
||||
|
||||
$filter_status_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
|
||||
$filter_status_options[] = JHTML::_('select.option', 0, JText::_('K2_ENABLED'));
|
||||
$filter_status_options[] = JHTML::_('select.option', 1, JText::_('K2_BLOCKED'));
|
||||
$lists['status'] = JHTML::_('select.genericlist', $filter_status_options, 'filter_status', '', 'value', 'text', $filter_status);
|
||||
|
||||
$userGroups = $model->getUserGroups();
|
||||
$groups[] = JHTML::_('select.option', '0', JText::_('K2_SELECT_JOOMLA_GROUP'));
|
||||
|
||||
foreach ($userGroups as $userGroup)
|
||||
{
|
||||
$groups[] = JHTML::_('select.option', $userGroup->value, $userGroup->text);
|
||||
}
|
||||
|
||||
$lists['filter_group'] = JHTML::_('select.genericlist', $groups, 'filter_group', '', 'value', 'text', $filter_group);
|
||||
|
||||
$K2userGroups = $model->getUserGroups('k2');
|
||||
$K2groups[] = JHTML::_('select.option', '0', JText::_('K2_SELECT_K2_GROUP'));
|
||||
|
||||
foreach ($K2userGroups as $K2userGroup)
|
||||
{
|
||||
$K2groups[] = JHTML::_('select.option', $K2userGroup->id, $K2userGroup->name);
|
||||
}
|
||||
|
||||
$lists['filter_group_k2'] = JHTML::_('select.genericlist', $K2groups, 'filter_group_k2', '', 'value', 'text', $filter_group_k2);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$dateFormat = JText::_('K2_J16_DATE_FORMAT');
|
||||
}
|
||||
else
|
||||
{
|
||||
$dateFormat = JText::_('K2_DATE_FORMAT');
|
||||
}
|
||||
$this->assignRef('dateFormat', $dateFormat);
|
||||
|
||||
$template = $mainframe->getTemplate();
|
||||
$this->assignRef('template', $template);
|
||||
|
||||
if ($mainframe->isAdmin())
|
||||
{
|
||||
JToolBarHelper::title(JText::_('K2_USERS'), 'k2.png');
|
||||
JToolBarHelper::custom('move', 'move.png', 'move_f2.png', 'K2_MOVE', true);
|
||||
JToolBarHelper::deleteList('K2_WARNING_YOU_ARE_ABOUT_TO_DELETE_THE_SELECTED_USERS_PERMANENTLY_FROM_THE_SYSTEM', 'delete', 'K2_DELETE');
|
||||
JToolBarHelper::publishList('enable', 'K2_ENABLE');
|
||||
JToolBarHelper::unpublishList('disable', 'K2_DISABLE');
|
||||
JToolBarHelper::editList();
|
||||
JToolBarHelper::deleteList('K2_ARE_YOU_SURE_YOU_WANT_TO_RESET_SELECTED_USERS', 'remove', 'K2_RESET_USER_DETAILS');
|
||||
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$toolbar->appendButton('Popup', 'config', 'K2_PARAMETERS', 'index.php?option=com_k2&view=settings');
|
||||
}
|
||||
|
||||
$this->loadHelper('html');
|
||||
K2HelperHTML::subMenu();
|
||||
|
||||
$user = JFactory::getUser();
|
||||
$canImport = false;
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
$canImport = $user->gid > 23;
|
||||
}
|
||||
else
|
||||
{
|
||||
$canImport = $user->authorise('core.admin', 'com_k2');
|
||||
}
|
||||
if ($canImport)
|
||||
{
|
||||
if (!$params->get('hideImportButton'))
|
||||
{
|
||||
$buttonUrl = JURI::base().'index.php?option=com_k2&view=users&task=import';
|
||||
$buttonText = JText::_('K2_IMPORT_JOOMLA_USERS');
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
$button = '<a id="K2ImportUsersButton" class="btn btn-small" href="'.$buttonUrl.'"><i class="icon-archive "></i>'.$buttonText.'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$button = '<a id="K2ImportUsersButton" href="'.$buttonUrl.'"><span class="icon-32-archive" title="'.$buttonText.'"></span>'.$buttonText.'</a>';
|
||||
|
||||
}
|
||||
$toolbar->appendButton('Custom', $button);
|
||||
}
|
||||
}
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration('var K2Language = ["'.JText::_('K2_REPORT_USER_WARNING', true).'"];');
|
||||
|
||||
}
|
||||
$isAdmin = $mainframe->isAdmin();
|
||||
$this->assignRef('isAdmin', $isAdmin);
|
||||
|
||||
if ($mainframe->isSite())
|
||||
{
|
||||
// CSS
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.frontend.css?v=2.6.7');
|
||||
$document->addStyleSheet(JURI::root(true).'/templates/system/css/general.css');
|
||||
$document->addStyleSheet(JURI::root(true).'/templates/system/css/system.css');
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$document->addStyleSheet(JURI::root(true).'/administrator/templates/bluestork/css/template.css');
|
||||
$document->addStyleSheet(JURI::root(true).'/media/system/css/system.css');
|
||||
}
|
||||
else
|
||||
{
|
||||
$document->addStyleSheet(JURI::root(true).'/administrator/templates/khepri/css/general.css');
|
||||
}
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
function move()
|
||||
{
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
|
||||
$cid = JRequest::getVar('cid');
|
||||
JArrayHelper::toInteger($cid);
|
||||
|
||||
foreach ($cid as $id)
|
||||
{
|
||||
$row = JFactory::getUser($id);
|
||||
$rows[] = $row;
|
||||
}
|
||||
$this->assignRef('rows', $rows);
|
||||
|
||||
$model = $this->getModel('users');
|
||||
$lists = array();
|
||||
$userGroups = $model->getUserGroups();
|
||||
$groups[] = JHTML::_('select.option', '', JText::_('K2_DO_NOT_CHANGE'));
|
||||
foreach ($userGroups as $userGroup)
|
||||
{
|
||||
$groups[] = JHTML::_('select.option', $userGroup->value, JText::_($userGroup->text));
|
||||
}
|
||||
$fieldName = 'group';
|
||||
$attributes = 'size="10"';
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$attributes .= 'multiple="multiple"';
|
||||
$fieldName .= '[]';
|
||||
}
|
||||
|
||||
$lists['group'] = JHTML::_('select.genericlist', $groups, $fieldName, $attributes, 'value', 'text', '');
|
||||
|
||||
$K2userGroups = $model->getUserGroups('k2');
|
||||
$K2groups[] = JHTML::_('select.option', '0', JText::_('K2_DO_NOT_CHANGE'));
|
||||
foreach ($K2userGroups as $K2userGroup)
|
||||
{
|
||||
$K2groups[] = JHTML::_('select.option', $K2userGroup->id, $K2userGroup->name);
|
||||
}
|
||||
$lists['k2group'] = JHTML::_('select.genericlist', $K2groups, 'k2group', 'size="10"', 'value', 'text', 0);
|
||||
|
||||
$this->assignRef('lists', $lists);
|
||||
|
||||
JToolBarHelper::title(JText::_('K2_MOVE_USERS'), 'k2.png');
|
||||
JToolBarHelper::custom('saveMove', 'save.png', 'save_f2.png', 'K2_SAVE', false);
|
||||
JToolBarHelper::cancel();
|
||||
|
||||
parent::display();
|
||||
}
|
||||
|
||||
}
|
||||
27
administrator/components/com_k2/views/view.php
Normal file
27
administrator/components/com_k2/views/view.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: view.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
if (version_compare(JVERSION, '3.0', 'ge'))
|
||||
{
|
||||
class K2View extends JViewLegacy
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
class K2View extends JView
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user