You've already forked joomla_test
first commit
This commit is contained in:
52
administrator/components/com_k2/elements/base.php
Normal file
52
administrator/components/com_k2/elements/base.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: base.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 ;
|
||||
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
jimport('joomla.html.parameter.element');
|
||||
class K2Element extends JElement
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
jimport('joomla.form.formfield');
|
||||
class K2Element extends JFormField
|
||||
{
|
||||
|
||||
function getInput()
|
||||
{
|
||||
return $this->fetchElement($this->name, $this->value, $this->element, $this->options['control']);
|
||||
}
|
||||
|
||||
function getLabel()
|
||||
{
|
||||
if (method_exists($this, 'fetchTooltip'))
|
||||
{
|
||||
return $this->fetchTooltip($this->element['label'], $this->description, $this->element, $this->options['control'], $this->element['name'] = '');
|
||||
}
|
||||
else
|
||||
{
|
||||
return parent::getLabel();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render()
|
||||
{
|
||||
return $this->getInput();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
94
administrator/components/com_k2/elements/categories.php
Normal file
94
administrator/components/com_k2/elements/categories.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: categories.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;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementCategories extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
|
||||
$query = 'SELECT m.* FROM #__k2_categories m WHERE trash = 0 ORDER BY parent, ordering';
|
||||
$db->setQuery($query);
|
||||
$mitems = $db->loadObjectList();
|
||||
$children = array();
|
||||
if ($mitems)
|
||||
{
|
||||
foreach ($mitems as $v)
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$v->title = $v->name;
|
||||
$v->parent_id = $v->parent;
|
||||
}
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push($list, $v);
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
$list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
|
||||
$mitems = array();
|
||||
$mitems[] = JHTML::_('select.option', '0', JText::_('K2_NONE_ONSELECTLISTS'));
|
||||
|
||||
foreach ($list as $item)
|
||||
{
|
||||
$item->treename = JString::str_ireplace(' ', ' -', $item->treename);
|
||||
$mitems[] = JHTML::_('select.option', $item->id, $item->treename);
|
||||
}
|
||||
|
||||
$attributes = 'class="inputbox"';
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$attribute = K2_JVERSION == '25' ? $node->getAttribute('multiple') : $node->attributes()->multiple;
|
||||
if ($attribute)
|
||||
{
|
||||
$attributes .= ' multiple="multiple" size="10"';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($node->attributes('multiple'))
|
||||
{
|
||||
$attributes .= ' multiple="multiple" size="10"';
|
||||
}
|
||||
}
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.']';
|
||||
if ($node->attributes('multiple'))
|
||||
{
|
||||
$fieldName .= '[]';
|
||||
}
|
||||
}
|
||||
|
||||
return JHTML::_('select.genericlist', $mitems, $fieldName, $attributes, 'value', 'text', $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldCategories extends K2ElementCategories
|
||||
{
|
||||
var $type = 'categories';
|
||||
}
|
||||
|
||||
class JElementCategories extends K2ElementCategories
|
||||
{
|
||||
var $_name = 'categories';
|
||||
}
|
139
administrator/components/com_k2/elements/categorieslatest.php
Normal file
139
administrator/components/com_k2/elements/categorieslatest.php
Normal file
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: categorieslatest.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementCategoriesLatest extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
JHTML::_('behavior.modal');
|
||||
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHTML::_('behavior.mootools');
|
||||
}
|
||||
K2HelperHTML::loadjQuery();
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name;
|
||||
if (!$node->attributes()->multiple)
|
||||
{
|
||||
$fieldName .= '[]';
|
||||
}
|
||||
$image = JURI::root(true).'/administrator/templates/'.$mainframe->getTemplate().'/images/admin/publish_x.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
$image = JURI::root(true).'/administrator/images/publish_x.png';
|
||||
}
|
||||
|
||||
$js = "
|
||||
function jSelectCategory(id, title, object) {
|
||||
var exists = false;
|
||||
\$K2('#categoriesList input').each(function(){
|
||||
if(\$K2(this).val()==id){
|
||||
alert('".JText::_('K2_THE_SELECTED_CATEGORY_IS_ALREADY_IN_THE_LIST', true)."');
|
||||
exists = true;
|
||||
}
|
||||
});
|
||||
if(!exists){
|
||||
var container = \$K2('<li/>').appendTo(\$K2('#categoriesList'));
|
||||
var img = \$K2('<img/>',{'class':'remove', src:'".$image."'}).appendTo(container);
|
||||
img.click(function(){\$K2(this).parent().remove();});
|
||||
var span = \$K2('<span/>',{'class':'handle'}).html(title).appendTo(container);
|
||||
var input = \$K2('<input/>',{value:id, type:'hidden', name:'".$fieldName."'}).appendTo(container);
|
||||
var div = \$K2('<div/>',{style:'clear:both;'}).appendTo(container);
|
||||
\$K2('#categoriesList').sortable('refresh');
|
||||
alert('".JText::_('K2_CATEGORY_ADDED_IN_THE_LIST', true)."');
|
||||
}
|
||||
}
|
||||
|
||||
\$K2(document).ready(function(){
|
||||
\$K2('#categoriesList').sortable({
|
||||
containment: '#categoriesList',
|
||||
items: 'li',
|
||||
handle: 'span.handle'
|
||||
});
|
||||
\$K2('body').css('overflow-y', 'scroll');
|
||||
\$K2('#categoriesList .remove').click(function(){
|
||||
\$K2(this).parent().remove();
|
||||
});
|
||||
});
|
||||
";
|
||||
|
||||
$document->addScriptDeclaration($js);
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.modules.css?v=2.6.7');
|
||||
|
||||
$current = array();
|
||||
if (is_string($value) && !empty($value))
|
||||
{
|
||||
$current[] = $value;
|
||||
}
|
||||
if (is_array($value))
|
||||
{
|
||||
$current = $value;
|
||||
}
|
||||
|
||||
$output = '
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal btn" title="'.JText::_('K2_CLICK_TO_SELECT_ONE_OR_MORE_CATEGORIES').'" href="index.php?option=com_k2&view=categories&task=element&tmpl=component" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_CLICK_TO_SELECT_ONE_OR_MORE_CATEGORIES').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
';
|
||||
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables');
|
||||
|
||||
$output .= '<ul id="categoriesList">';
|
||||
foreach ($current as $id)
|
||||
{
|
||||
$row = JTable::getInstance('K2Category', 'Table');
|
||||
$row->load($id);
|
||||
$output .= '
|
||||
<li>
|
||||
<img class="remove" src="'.$image.'"/>
|
||||
<span class="handle">'.$row->name.'</span>
|
||||
<input type="hidden" value="'.$row->id.'" name="'.$fieldName.'"/>
|
||||
<span style="clear:both;"></span>
|
||||
</li>
|
||||
';
|
||||
}
|
||||
$output .= '</ul>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldCategoriesLatest extends K2ElementCategoriesLatest
|
||||
{
|
||||
var $type = 'categorieslatest';
|
||||
}
|
||||
|
||||
class JElementCategoriesLatest extends K2ElementCategoriesLatest
|
||||
{
|
||||
var $_name = 'categorieslatest';
|
||||
}
|
160
administrator/components/com_k2/elements/categoriesmultiple.php
Normal file
160
administrator/components/com_k2/elements/categoriesmultiple.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: categoriesmultiple.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementCategoriesMultiple extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$document = JFactory::getDocument();
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHTML::_('behavior.mootools');
|
||||
}
|
||||
K2HelperHTML::loadjQuery();
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
$query = 'SELECT m.* FROM #__k2_categories m WHERE trash = 0 ORDER BY parent, ordering';
|
||||
$db->setQuery($query);
|
||||
$mitems = $db->loadObjectList();
|
||||
$children = array();
|
||||
if ($mitems)
|
||||
{
|
||||
foreach ($mitems as $v)
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$v->title = $v->name;
|
||||
$v->parent_id = $v->parent;
|
||||
}
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push($list, $v);
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
$list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
|
||||
$mitems = array();
|
||||
|
||||
foreach ($list as $item)
|
||||
{
|
||||
$item->treename = JString::str_ireplace(' ', '- ', $item->treename);
|
||||
$mitems[] = JHTML::_('select.option', $item->id, ' '.$item->treename);
|
||||
}
|
||||
|
||||
$doc = JFactory::getDocument();
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$js = "
|
||||
\$K2(document).ready(function(){
|
||||
|
||||
\$K2('#jform_params_catfilter0').click(function(){
|
||||
\$K2('#jformparamscategory_id').attr('disabled', 'disabled');
|
||||
\$K2('#jformparamscategory_id option').each(function() {
|
||||
\$K2(this).attr('selected', 'selected');
|
||||
});
|
||||
\$K2('#jformparamscategory_id').trigger('liszt:updated');
|
||||
});
|
||||
|
||||
\$K2('#jform_params_catfilter1').click(function(){
|
||||
\$K2('#jformparamscategory_id').removeAttr('disabled');
|
||||
\$K2('#jformparamscategory_id option').each(function() {
|
||||
\$K2(this).removeAttr('selected');
|
||||
});
|
||||
\$K2('#jformparamscategory_id').trigger('liszt:updated');
|
||||
});
|
||||
|
||||
if (\$K2('#jform_params_catfilter0').attr('checked')) {
|
||||
\$K2('#jformparamscategory_id').attr('disabled', 'disabled');
|
||||
\$K2('#jformparamscategory_id option').each(function() {
|
||||
\$K2(this).attr('selected', 'selected');
|
||||
});
|
||||
\$K2('#jformparamscategory_id').trigger('liszt:updated');
|
||||
}
|
||||
|
||||
if (\$K2('#jform_params_catfilter1').attr('checked')) {
|
||||
\$K2('#jformparamscategory_id').removeAttr('disabled');
|
||||
\$K2('#jformparamscategory_id').trigger('liszt:updated');
|
||||
}
|
||||
|
||||
});
|
||||
";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$js = "
|
||||
\$K2(document).ready(function(){
|
||||
|
||||
\$K2('#paramscatfilter0').click(function(){
|
||||
\$K2('#paramscategory_id').attr('disabled', 'disabled');
|
||||
\$K2('#paramscategory_id option').each(function() {
|
||||
\$K2(this).attr('selected', 'selected');
|
||||
});
|
||||
});
|
||||
|
||||
\$K2('#paramscatfilter1').click(function(){
|
||||
\$K2('#paramscategory_id').removeAttr('disabled');
|
||||
\$K2('#paramscategory_id option').each(function() {
|
||||
\$K2(this).removeAttr('selected');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
if (\$K2('#paramscatfilter0').attr('checked')) {
|
||||
\$K2('#paramscategory_id').attr('disabled', 'disabled');
|
||||
\$K2('#paramscategory_id option').each(function() {
|
||||
\$K2(this).attr('selected', 'selected');
|
||||
});
|
||||
}
|
||||
|
||||
if (\$K2('#paramscatfilter1').attr('checked')) {
|
||||
\$K2('#paramscategory_id').removeAttr('disabled');
|
||||
}
|
||||
|
||||
});
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name.'[]';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
}
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
$output = JHTML::_('select.genericlist', $mitems, $fieldName, 'class="inputbox" multiple="multiple" size="10"', 'value', 'text', $value);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldCategoriesMultiple extends K2ElementCategoriesMultiple
|
||||
{
|
||||
var $type = 'categoriesmultiple';
|
||||
}
|
||||
|
||||
class JElementCategoriesMultiple extends K2ElementCategoriesMultiple
|
||||
{
|
||||
var $_name = 'categoriesmultiple';
|
||||
}
|
255
administrator/components/com_k2/elements/category.php
Normal file
255
administrator/components/com_k2/elements/category.php
Normal file
@ -0,0 +1,255 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: category.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementCategory extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = 'SELECT m.* FROM #__k2_categories m WHERE trash = 0 ORDER BY parent, ordering';
|
||||
$db->setQuery($query);
|
||||
$mitems = $db->loadObjectList();
|
||||
$children = array();
|
||||
if ($mitems)
|
||||
{
|
||||
foreach ($mitems as $v)
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$v->title = $v->name;
|
||||
$v->parent_id = $v->parent;
|
||||
}
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push($list, $v);
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
|
||||
$list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
|
||||
$mitems = array();
|
||||
$option = JRequest::getCmd('option');
|
||||
$prefix = ($option == 'com_joomfish') ? 'refField_' : '';
|
||||
if ($name == 'categories' || $name == 'jform[params][categories]')
|
||||
{
|
||||
$doc = JFactory::getDocument();
|
||||
$js = "
|
||||
window.addEvent('domready', function(){
|
||||
setTask();
|
||||
});
|
||||
|
||||
function setTask() {
|
||||
var counter=0;
|
||||
$$('#".$prefix."paramscategories option').each(function(el) {
|
||||
if (el.selected){
|
||||
value=el.value;
|
||||
counter++;
|
||||
}
|
||||
});
|
||||
if (counter>1 || counter==0){
|
||||
$('urlparamsid').setProperty('value','');
|
||||
$('urlparamstask').setProperty('value','');
|
||||
$('".$prefix."paramssingleCatOrdering').setProperty('disabled', 'disabled');
|
||||
enableParams();
|
||||
}
|
||||
if (counter==1){
|
||||
$('urlparamsid').setProperty('value',value);
|
||||
$('urlparamstask').setProperty('value','category');
|
||||
$('".$prefix."paramssingleCatOrdering').removeProperty('disabled');
|
||||
disableParams();
|
||||
}
|
||||
}
|
||||
|
||||
function disableParams(){
|
||||
$('".$prefix."paramsnum_leading_items').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_leading_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsleadingImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_primary_items').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_primary_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsprimaryImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_secondary_items').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_secondary_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramssecondaryImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_links').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_links_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramslinksImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatCatalogMode').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeaturedItems').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatOrdering').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatPagination').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatPaginationResults0').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatPaginationResults1').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedLink0').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedLink1').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedIcon0').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedIcon1').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramstheme').setProperty('disabled','disabled');
|
||||
}
|
||||
|
||||
function enableParams(){
|
||||
$('".$prefix."paramsnum_leading_items').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_leading_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramsleadingImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_primary_items').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_primary_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramsprimaryImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_secondary_items').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_secondary_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramssecondaryImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_links').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_links_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramslinksImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramscatCatalogMode').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeaturedItems').removeProperty('disabled');
|
||||
$('".$prefix."paramscatOrdering').removeProperty('disabled');
|
||||
$('".$prefix."paramscatPagination').removeProperty('disabled');
|
||||
$('".$prefix."paramscatPaginationResults0').removeProperty('disabled');
|
||||
$('".$prefix."paramscatPaginationResults1').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedLink0').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedLink1').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedIcon0').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedIcon1').removeProperty('disabled');
|
||||
$('".$prefix."paramstheme').removeProperty('disabled');
|
||||
}
|
||||
";
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$js = "
|
||||
function disableParams(){
|
||||
$('jform_params_num_leading_items').setProperty('disabled','disabled');
|
||||
$('jform_params_num_leading_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_leadingImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_num_primary_items').setProperty('disabled','disabled');
|
||||
$('jform_params_num_primary_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_primaryImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_num_secondary_items').setProperty('disabled','disabled');
|
||||
$('jform_params_num_secondary_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_secondaryImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_num_links').setProperty('disabled','disabled');
|
||||
$('jform_params_num_links_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_linksImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_catCatalogMode').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeaturedItems').setProperty('disabled','disabled');
|
||||
$('jform_params_catOrdering').setProperty('disabled','disabled');
|
||||
$('jform_params_catPagination').setProperty('disabled','disabled');
|
||||
$('jform_params_catPaginationResults0').setProperty('disabled','disabled');
|
||||
$('jform_params_catPaginationResults1').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedLink0').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedLink1').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedIcon0').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedIcon1').setProperty('disabled','disabled');
|
||||
$('jformparamstheme').setProperty('disabled','disabled');
|
||||
}
|
||||
|
||||
function enableParams(){
|
||||
$('jform_params_num_leading_items').removeProperty('disabled');
|
||||
$('jform_params_num_leading_columns').removeProperty('disabled');
|
||||
$('jform_params_leadingImgSize').removeProperty('disabled');
|
||||
$('jform_params_num_primary_items').removeProperty('disabled');
|
||||
$('jform_params_num_primary_columns').removeProperty('disabled');
|
||||
$('jform_params_primaryImgSize').removeProperty('disabled');
|
||||
$('jform_params_num_secondary_items').removeProperty('disabled');
|
||||
$('jform_params_num_secondary_columns').removeProperty('disabled');
|
||||
$('jform_params_secondaryImgSize').removeProperty('disabled');
|
||||
$('jform_params_num_links').removeProperty('disabled');
|
||||
$('jform_params_num_links_columns').removeProperty('disabled');
|
||||
$('jform_params_linksImgSize').removeProperty('disabled');
|
||||
$('jform_params_catCatalogMode').removeProperty('disabled');
|
||||
$('jform_params_catFeaturedItems').removeProperty('disabled');
|
||||
$('jform_params_catOrdering').removeProperty('disabled');
|
||||
$('jform_params_catPagination').removeProperty('disabled');
|
||||
$('jform_params_catPaginationResults0').removeProperty('disabled');
|
||||
$('jform_params_catPaginationResults1').removeProperty('disabled');
|
||||
$('jform_params_catFeedLink0').removeProperty('disabled');
|
||||
$('jform_params_catFeedLink1').removeProperty('disabled');
|
||||
$('jform_params_catFeedIcon0').removeProperty('disabled');
|
||||
$('jform_params_catFeedIcon1').removeProperty('disabled');
|
||||
$('jformparamstheme').removeProperty('disabled');
|
||||
}
|
||||
|
||||
function setTask() {
|
||||
var counter=0;
|
||||
$$('#jformparamscategories option').each(function(el) {
|
||||
if (el.selected){
|
||||
value=el.value;
|
||||
counter++;
|
||||
}
|
||||
});
|
||||
if (counter>1 || counter==0){
|
||||
$('jform_request_id').setProperty('value','');
|
||||
$('jform_request_task').setProperty('value','');
|
||||
$('jform_params_singleCatOrdering').setProperty('disabled', 'disabled');
|
||||
enableParams();
|
||||
}
|
||||
if (counter==1){
|
||||
$('jform_request_id').setProperty('value',value);
|
||||
$('jform_request_task').setProperty('value','category');
|
||||
$('jform_params_singleCatOrdering').removeProperty('disabled');
|
||||
disableParams();
|
||||
}
|
||||
}
|
||||
|
||||
window.addEvent('domready', function(){
|
||||
if($('request-options')) {
|
||||
$$('.panel')[0].setStyle('display', 'none');
|
||||
}
|
||||
setTask();
|
||||
});
|
||||
";
|
||||
}
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
}
|
||||
|
||||
foreach ($list as $item)
|
||||
{
|
||||
$item->treename = JString::str_ireplace(' ', '- ', $item->treename);
|
||||
@$mitems[] = JHTML::_('select.option', $item->id, $item->treename);
|
||||
}
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name.'[]';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
}
|
||||
|
||||
if ($name == 'categories' || $name == 'jform[params][categories]')
|
||||
{
|
||||
$onChange = 'onchange="setTask();"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$onChange = '';
|
||||
}
|
||||
|
||||
return JHTML::_('select.genericlist', $mitems, $fieldName, $onChange.' class="inputbox" style="width:90%;" multiple="multiple" size="15"', 'value', 'text', $value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldCategory extends K2ElementCategory
|
||||
{
|
||||
var $type = 'category';
|
||||
}
|
||||
|
||||
class JElementCategory extends K2ElementCategory
|
||||
{
|
||||
var $_name = 'category';
|
||||
}
|
47
administrator/components/com_k2/elements/header.php
Normal file
47
administrator/components/com_k2/elements/header.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: header.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
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementHeader extends K2Element
|
||||
{
|
||||
public function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
|
||||
$document = JFactory::getDocument();
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.modules.css?v=2.6.7');
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
return '<div class="paramHeaderContainer15"><div class="paramHeaderContent">'.JText::_($value).'</div><div class="k2clr"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
return '<div class="paramHeaderContainer"><div class="paramHeaderContent">'.JText::_($value).'</div><div class="k2clr"></div></div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function fetchTooltip($label, $description, &$node, $control_name, $name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldHeader extends K2ElementHeader
|
||||
{
|
||||
var $type = 'header';
|
||||
}
|
||||
|
||||
class JElementHeader extends K2ElementHeader
|
||||
{
|
||||
var $_name = 'header';
|
||||
}
|
85
administrator/components/com_k2/elements/item.php
Normal file
85
administrator/components/com_k2/elements/item.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: item.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementItem extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$mainframe = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
$doc = JFactory::getDocument();
|
||||
$fieldName = (K2_JVERSION != '15') ? $name : $control_name.'['.$name.']';
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables');
|
||||
$item = JTable::getInstance('K2Item', 'Table');
|
||||
if ($value)
|
||||
{
|
||||
$item->load($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->title = JText::_('K2_SELECT_AN_ITEM');
|
||||
}
|
||||
|
||||
$js = "
|
||||
function jSelectItem(id, title, object) {
|
||||
document.getElementById('".$name."' + '_id').value = id;
|
||||
document.getElementById('".$name."' + '_name').value = title;
|
||||
if(typeof(window.parent.SqueezeBox.close=='function')){
|
||||
window.parent.SqueezeBox.close();
|
||||
}
|
||||
else {
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
}
|
||||
";
|
||||
$doc->addScriptDeclaration($js);
|
||||
$link = 'index.php?option=com_k2&view=items&task=element&tmpl=component&object='.$name;
|
||||
JHTML::_('behavior.modal', 'a.modal');
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
$html = '<span class="input-append">
|
||||
<input type="text" id="'.$name.'_name" value="'.htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
<a class="modal btn" title="'.JText::_('K2_SELECT_AN_ITEM').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}"><i class="icon-file"></i>'.JText::_('K2_SELECT').'</a>
|
||||
<input type="hidden" class="required modal-value" id="'.$name.'_id" name="'.$fieldName.'" value="'.( int )$value.'" />
|
||||
</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = '
|
||||
<div style="float:left;">
|
||||
<input style="background:#fff;margin:3px 0;" type="text" id="'.$name.'_name" value="'.htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
</div>
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal btn" title="'.JText::_('K2_SELECT_AN_ITEM').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_SELECT').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.( int )$value.'" />';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldItem extends K2ElementItem
|
||||
{
|
||||
var $type = 'item';
|
||||
}
|
||||
|
||||
class JElementItem extends K2ElementItem
|
||||
{
|
||||
var $_name = 'item';
|
||||
}
|
56
administrator/components/com_k2/elements/itemform.php
Normal file
56
administrator/components/com_k2/elements/itemform.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: itemform.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementItemForm extends K2Element
|
||||
{
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration("
|
||||
window.addEvent('domready', function() {
|
||||
if($('request-options')) {
|
||||
$$('.panel')[0].setStyle('display', 'none');
|
||||
}
|
||||
if($('jform_browserNav')) {
|
||||
$('jform_browserNav').setProperty('value', 2);
|
||||
$('jform_browserNav').getElements('option')[0].destroy();
|
||||
}
|
||||
if($('browserNav')) {
|
||||
$('browserNav').setProperty('value', 2);
|
||||
options = $('browserNav').getElements('option');
|
||||
if(options.length == 3) {
|
||||
options[0].remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
");
|
||||
return '';
|
||||
}
|
||||
|
||||
function fetchTooltip($label, $description, &$node, $control_name, $name)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFielditemform extends K2ElementItemForm
|
||||
{
|
||||
var $type = 'itemform';
|
||||
}
|
||||
|
||||
class JElementitemform extends K2ElementItemForm
|
||||
{
|
||||
var $_name = 'itemform';
|
||||
}
|
123
administrator/components/com_k2/elements/items.php
Normal file
123
administrator/components/com_k2/elements/items.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: items.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementItems extends K2Element
|
||||
{
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$document = JFactory::getDocument();
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHTML::_('behavior.mootools');
|
||||
}
|
||||
K2HelperHTML::loadjQuery();
|
||||
$mainframe = JFactory::getApplication();
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name;
|
||||
$attribute = K2_JVERSION == '25' ? $node->getAttribute('multiple') : $node->attributes()->multiple;
|
||||
if (!$attribute)
|
||||
{
|
||||
$fieldName .= '[]';
|
||||
}
|
||||
$image = JURI::root(true).'/administrator/templates/'.$mainframe->getTemplate().'/images/admin/publish_x.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
$image = JURI::root(true).'/administrator/images/publish_x.png';
|
||||
}
|
||||
|
||||
$js = "
|
||||
function jSelectItem(id, title, object) {
|
||||
var exists = false;
|
||||
\$K2('#itemsList input').each(function(){
|
||||
if(\$K2(this).val()==id){
|
||||
alert('".JText::_('K2_THE_SELECTED_ITEM_IS_ALREADY_IN_THE_LIST')."');
|
||||
exists = true;
|
||||
}
|
||||
});
|
||||
if(!exists){
|
||||
var container = \$K2('<li/>').appendTo(\$K2('#itemsList'));
|
||||
var img = \$K2('<img/>',{'class':'remove', src:'".$image."'}).appendTo(container);
|
||||
img.click(function(){\$K2(this).parent().remove();});
|
||||
var span = \$K2('<span/>',{'class':'handle'}).html(title).appendTo(container);
|
||||
var input = \$K2('<input/>',{value:id, type:'hidden', name:'".$fieldName."'}).appendTo(container);
|
||||
var div = \$K2('<div/>',{style:'clear:both;'}).appendTo(container);
|
||||
\$K2('#itemsList').sortable('refresh');
|
||||
alert('".JText::_('K2_ITEM_ADDED_IN_THE_LIST', true)."');
|
||||
}
|
||||
}
|
||||
|
||||
\$K2(document).ready(function(){
|
||||
\$K2('#itemsList').sortable({
|
||||
containment: '#itemsList',
|
||||
items: 'li',
|
||||
handle: 'span.handle'
|
||||
});
|
||||
\$K2('body').css('overflow-y', 'scroll');
|
||||
\$K2('#itemsList .remove').click(function(){
|
||||
\$K2(this).parent().remove();
|
||||
});
|
||||
});
|
||||
";
|
||||
|
||||
$document->addScriptDeclaration($js);
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.modules.css?v=2.6.7');
|
||||
|
||||
$current = array();
|
||||
if (is_string($value) && !empty($value))
|
||||
{
|
||||
$current[] = $value;
|
||||
}
|
||||
if (is_array($value))
|
||||
{
|
||||
$current = $value;
|
||||
}
|
||||
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables');
|
||||
$output = '<div style="clear:both"></div><ul id="itemsList">';
|
||||
foreach ($current as $id)
|
||||
{
|
||||
$row = JTable::getInstance('K2Item', 'Table');
|
||||
$row->load($id);
|
||||
$output .= '
|
||||
<li>
|
||||
<img class="remove" src="'.$image.'" alt="'.JText::_('K2_REMOVE_ENTRY_FROM_LIST').'" />
|
||||
<span class="handle">'.$row->title.'</span>
|
||||
<input type="hidden" value="'.$row->id.'" name="'.$fieldName.'"/>
|
||||
<span style="clear:both;"></span>
|
||||
</li>
|
||||
';
|
||||
}
|
||||
$output .= '</ul>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldItems extends K2ElementItems
|
||||
{
|
||||
var $type = 'items';
|
||||
}
|
||||
|
||||
class JElementItems extends K2ElementItems
|
||||
{
|
||||
var $_name = 'items';
|
||||
}
|
255
administrator/components/com_k2/elements/k2category.php
Normal file
255
administrator/components/com_k2/elements/k2category.php
Normal file
@ -0,0 +1,255 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: k2category.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementK2Category extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = 'SELECT m.* FROM #__k2_categories m WHERE trash = 0 ORDER BY parent, ordering';
|
||||
$db->setQuery($query);
|
||||
$mitems = $db->loadObjectList();
|
||||
$children = array();
|
||||
if ($mitems)
|
||||
{
|
||||
foreach ($mitems as $v)
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$v->title = $v->name;
|
||||
$v->parent_id = $v->parent;
|
||||
}
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push($list, $v);
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
|
||||
$list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
|
||||
$mitems = array();
|
||||
$option = JRequest::getCmd('option');
|
||||
$prefix = ($option == 'com_joomfish') ? 'refField_' : '';
|
||||
if ($name == 'categories' || $name == 'jform[params][categories]')
|
||||
{
|
||||
$doc = JFactory::getDocument();
|
||||
$js = "
|
||||
window.addEvent('domready', function(){
|
||||
setTask();
|
||||
});
|
||||
|
||||
function setTask() {
|
||||
var counter=0;
|
||||
$$('#".$prefix."paramscategories option').each(function(el) {
|
||||
if (el.selected){
|
||||
value=el.value;
|
||||
counter++;
|
||||
}
|
||||
});
|
||||
if (counter>1 || counter==0){
|
||||
$('urlparamsid').setProperty('value','');
|
||||
$('urlparamstask').setProperty('value','');
|
||||
$('".$prefix."paramssingleCatOrdering').setProperty('disabled', 'disabled');
|
||||
enableParams();
|
||||
}
|
||||
if (counter==1){
|
||||
$('urlparamsid').setProperty('value',value);
|
||||
$('urlparamstask').setProperty('value','category');
|
||||
$('".$prefix."paramssingleCatOrdering').removeProperty('disabled');
|
||||
disableParams();
|
||||
}
|
||||
}
|
||||
|
||||
function disableParams(){
|
||||
$('".$prefix."paramsnum_leading_items').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_leading_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsleadingImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_primary_items').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_primary_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsprimaryImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_secondary_items').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_secondary_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramssecondaryImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_links').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramsnum_links_columns').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramslinksImgSize').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatCatalogMode').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeaturedItems').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatOrdering').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatPagination').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatPaginationResults0').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatPaginationResults1').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedLink0').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedLink1').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedIcon0').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramscatFeedIcon1').setProperty('disabled','disabled');
|
||||
$('".$prefix."paramstheme').setProperty('disabled','disabled');
|
||||
}
|
||||
|
||||
function enableParams(){
|
||||
$('".$prefix."paramsnum_leading_items').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_leading_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramsleadingImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_primary_items').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_primary_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramsprimaryImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_secondary_items').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_secondary_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramssecondaryImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_links').removeProperty('disabled');
|
||||
$('".$prefix."paramsnum_links_columns').removeProperty('disabled');
|
||||
$('".$prefix."paramslinksImgSize').removeProperty('disabled');
|
||||
$('".$prefix."paramscatCatalogMode').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeaturedItems').removeProperty('disabled');
|
||||
$('".$prefix."paramscatOrdering').removeProperty('disabled');
|
||||
$('".$prefix."paramscatPagination').removeProperty('disabled');
|
||||
$('".$prefix."paramscatPaginationResults0').removeProperty('disabled');
|
||||
$('".$prefix."paramscatPaginationResults1').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedLink0').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedLink1').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedIcon0').removeProperty('disabled');
|
||||
$('".$prefix."paramscatFeedIcon1').removeProperty('disabled');
|
||||
$('".$prefix."paramstheme').removeProperty('disabled');
|
||||
}
|
||||
";
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$js = "
|
||||
function disableParams(){
|
||||
$('jform_params_num_leading_items').setProperty('disabled','disabled');
|
||||
$('jform_params_num_leading_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_leadingImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_num_primary_items').setProperty('disabled','disabled');
|
||||
$('jform_params_num_primary_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_primaryImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_num_secondary_items').setProperty('disabled','disabled');
|
||||
$('jform_params_num_secondary_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_secondaryImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_num_links').setProperty('disabled','disabled');
|
||||
$('jform_params_num_links_columns').setProperty('disabled','disabled');
|
||||
$('jform_params_linksImgSize').setProperty('disabled','disabled');
|
||||
$('jform_params_catCatalogMode').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeaturedItems').setProperty('disabled','disabled');
|
||||
$('jform_params_catOrdering').setProperty('disabled','disabled');
|
||||
$('jform_params_catPagination').setProperty('disabled','disabled');
|
||||
$('jform_params_catPaginationResults0').setProperty('disabled','disabled');
|
||||
$('jform_params_catPaginationResults1').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedLink0').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedLink1').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedIcon0').setProperty('disabled','disabled');
|
||||
$('jform_params_catFeedIcon1').setProperty('disabled','disabled');
|
||||
$('jformparamstheme').setProperty('disabled','disabled');
|
||||
}
|
||||
|
||||
function enableParams(){
|
||||
$('jform_params_num_leading_items').removeProperty('disabled');
|
||||
$('jform_params_num_leading_columns').removeProperty('disabled');
|
||||
$('jform_params_leadingImgSize').removeProperty('disabled');
|
||||
$('jform_params_num_primary_items').removeProperty('disabled');
|
||||
$('jform_params_num_primary_columns').removeProperty('disabled');
|
||||
$('jform_params_primaryImgSize').removeProperty('disabled');
|
||||
$('jform_params_num_secondary_items').removeProperty('disabled');
|
||||
$('jform_params_num_secondary_columns').removeProperty('disabled');
|
||||
$('jform_params_secondaryImgSize').removeProperty('disabled');
|
||||
$('jform_params_num_links').removeProperty('disabled');
|
||||
$('jform_params_num_links_columns').removeProperty('disabled');
|
||||
$('jform_params_linksImgSize').removeProperty('disabled');
|
||||
$('jform_params_catCatalogMode').removeProperty('disabled');
|
||||
$('jform_params_catFeaturedItems').removeProperty('disabled');
|
||||
$('jform_params_catOrdering').removeProperty('disabled');
|
||||
$('jform_params_catPagination').removeProperty('disabled');
|
||||
$('jform_params_catPaginationResults0').removeProperty('disabled');
|
||||
$('jform_params_catPaginationResults1').removeProperty('disabled');
|
||||
$('jform_params_catFeedLink0').removeProperty('disabled');
|
||||
$('jform_params_catFeedLink1').removeProperty('disabled');
|
||||
$('jform_params_catFeedIcon0').removeProperty('disabled');
|
||||
$('jform_params_catFeedIcon1').removeProperty('disabled');
|
||||
$('jformparamstheme').removeProperty('disabled');
|
||||
}
|
||||
|
||||
function setTask() {
|
||||
var counter=0;
|
||||
$$('#jformparamscategories option').each(function(el) {
|
||||
if (el.selected){
|
||||
value=el.value;
|
||||
counter++;
|
||||
}
|
||||
});
|
||||
if (counter>1 || counter==0){
|
||||
$('jform_request_id').setProperty('value','');
|
||||
$('jform_request_task').setProperty('value','');
|
||||
$('jform_params_singleCatOrdering').setProperty('disabled', 'disabled');
|
||||
enableParams();
|
||||
}
|
||||
if (counter==1){
|
||||
$('jform_request_id').setProperty('value',value);
|
||||
$('jform_request_task').setProperty('value','category');
|
||||
$('jform_params_singleCatOrdering').removeProperty('disabled');
|
||||
disableParams();
|
||||
}
|
||||
}
|
||||
|
||||
window.addEvent('domready', function(){
|
||||
if($('request-options')) {
|
||||
$$('.panel')[0].setStyle('display', 'none');
|
||||
}
|
||||
setTask();
|
||||
});
|
||||
";
|
||||
}
|
||||
|
||||
$doc->addScriptDeclaration($js);
|
||||
}
|
||||
|
||||
foreach ($list as $item)
|
||||
{
|
||||
$item->treename = JString::str_ireplace(' ', '- ', $item->treename);
|
||||
@$mitems[] = JHTML::_('select.option', $item->id, $item->treename);
|
||||
}
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name.'[]';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
}
|
||||
|
||||
if ($name == 'categories' || $name == 'jform[params][categories]')
|
||||
{
|
||||
$onChange = 'onchange="setTask();"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$onChange = '';
|
||||
}
|
||||
|
||||
return JHTML::_('select.genericlist', $mitems, $fieldName, $onChange.' class="inputbox" multiple="multiple" size="15"', 'value', 'text', $value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldK2Category extends K2ElementK2Category
|
||||
{
|
||||
var $type = 'k2category';
|
||||
}
|
||||
|
||||
class JElementK2Category extends K2ElementK2Category
|
||||
{
|
||||
var $_name = 'k2category';
|
||||
}
|
89
administrator/components/com_k2/elements/k2tag.php
Normal file
89
administrator/components/com_k2/elements/k2tag.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: k2tag.php 1975 2013-05-08 12:51:47Z 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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementK2Tag extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$mainframe = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
$doc = JFactory::getDocument();
|
||||
$fieldName = (K2_JVERSION != '15') ? $name : $control_name.'['.$name.']';
|
||||
JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'tables');
|
||||
$tag = JTable::getInstance('K2Tag', 'Table');
|
||||
if ($value)
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = "SELECT * FROM #__k2_tags WHERE name=".$db->Quote($value);
|
||||
$db->setQuery($query);
|
||||
$tag = $db->loadObject();
|
||||
}
|
||||
if (is_null($tag))
|
||||
{
|
||||
$tag = new stdClass;
|
||||
$tag->name = JText::_('K2_SELECT_A_TAG');
|
||||
}
|
||||
// Move this to main JS file
|
||||
$js = "
|
||||
function jSelectTag(id, title, object) {
|
||||
document.getElementById('".$name."' + '_id').value = id;
|
||||
document.getElementById('".$name."' + '_name').value = title;
|
||||
if(typeof(window.parent.SqueezeBox.close=='function')){
|
||||
window.parent.SqueezeBox.close();
|
||||
}
|
||||
else {
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
}
|
||||
";
|
||||
$doc->addScriptDeclaration($js);
|
||||
$link = 'index.php?option=com_k2&view=tags&task=element&tmpl=component&object='.$name;
|
||||
JHTML::_('behavior.modal', 'a.modal');
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
$html = '<span class="input-append">
|
||||
<input type="text" id="'.$name.'_name" value="'.htmlspecialchars($tag->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
<a class="modal btn" title="'.JText::_('K2_SELECT_A_TAG').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}"><i class="icon-file"></i>'.JText::_('K2_SELECT').'</a>
|
||||
<input type="hidden" class="required modal-value" id="'.$name.'_id" name="'.$fieldName.'" value="'.$value.'" />
|
||||
</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = '
|
||||
<div style="float:left;">
|
||||
<input style="background:#fff;margin:3px 0;" type="text" id="'.$name.'_name" value="'.htmlspecialchars($tag->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
</div>
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal" title="'.JText::_('K2_SELECT_A_TAG').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_SELECT').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.$value.'" />
|
||||
';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldK2Tag extends K2ElementK2Tag
|
||||
{
|
||||
var $type = 'k2tag';
|
||||
}
|
||||
|
||||
class JElementK2Tag extends K2ElementK2Tag
|
||||
{
|
||||
var $_name = 'k2tag';
|
||||
}
|
84
administrator/components/com_k2/elements/k2user.php
Normal file
84
administrator/components/com_k2/elements/k2user.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: k2user.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementK2User extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$mainframe = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
$doc = JFactory::getDocument();
|
||||
$fieldName = (K2_JVERSION != '15') ? $name : $control_name.'['.$name.']';
|
||||
if ($value)
|
||||
{
|
||||
$user = JFactory::getUser($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = new stdClass;
|
||||
$user->name = JText::_('K2_SELECT_A_USER');
|
||||
}
|
||||
// Move this to main JS file
|
||||
$js = "
|
||||
function jSelectUser(id, title, object) {
|
||||
document.getElementById('".$name."' + '_id').value = id;
|
||||
document.getElementById('".$name."' + '_name').value = title;
|
||||
if(typeof(window.parent.SqueezeBox.close=='function')){
|
||||
window.parent.SqueezeBox.close();
|
||||
}
|
||||
else {
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
}
|
||||
";
|
||||
$doc->addScriptDeclaration($js);
|
||||
$link = 'index.php?option=com_k2&view=users&task=element&tmpl=component&object='.$name;
|
||||
JHTML::_('behavior.modal', 'a.modal');
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
$html = '<span class="input-append">
|
||||
<input type="text" id="'.$name.'_name" value="'.htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
<a class="modal btn" title="'.JText::_('K2_SELECT_A_USER').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}"><i class="icon-file"></i>'.JText::_('K2_SELECT').'</a>
|
||||
<input type="hidden" class="required modal-value" id="'.$name.'_id" name="'.$fieldName.'" value="'.(int)$value.'" />
|
||||
</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = '
|
||||
<div style="float:left;">
|
||||
<input style="background:#fff;margin:3px 0;" type="text" id="'.$name.'_name" value="'.htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
</div>
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal" title="'.JText::_('K2_SELECT_A_USER').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_SELECT').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.(int)$value.'" />
|
||||
';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldK2User extends K2ElementK2User
|
||||
{
|
||||
var $type = 'k2user';
|
||||
}
|
||||
|
||||
class JElementK2User extends K2ElementK2User
|
||||
{
|
||||
var $_name = 'k2user';
|
||||
}
|
152
administrator/components/com_k2/elements/menuitem.php
Normal file
152
administrator/components/com_k2/elements/menuitem.php
Normal file
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: menuitem.php 1949 2013-03-11 16:59:08Z 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
|
||||
*/
|
||||
|
||||
// Check to ensure this file is within the rest of the framework
|
||||
defined('JPATH_BASE') or die();
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementMenuItem extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
|
||||
// load the list of menu types
|
||||
// TODO: move query to model
|
||||
$query = 'SELECT menutype, title'.' FROM #__menu_types'.' ORDER BY title';
|
||||
$db->setQuery($query);
|
||||
$menuTypes = $db->loadObjectList();
|
||||
|
||||
$where = '';
|
||||
if ($state = $node->attributes('state'))
|
||||
{
|
||||
$where .= ' AND published = '.(int)$state;
|
||||
}
|
||||
|
||||
// load the list of menu items
|
||||
// TODO: move query to model
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$query = 'SELECT id, parent_id, title, menutype, type, published'.' FROM #__menu'.$where.' ORDER BY menutype, parent_id, ordering';
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = 'SELECT id, parent, name, menutype, type, published'.' FROM #__menu'.$where.' ORDER BY menutype, parent, ordering';
|
||||
|
||||
}
|
||||
|
||||
$db->setQuery($query);
|
||||
$menuItems = $db->loadObjectList();
|
||||
|
||||
// establish the hierarchy of the menu
|
||||
// TODO: use node model
|
||||
$children = array();
|
||||
|
||||
if ($menuItems)
|
||||
{
|
||||
// first pass - collect children
|
||||
foreach ($menuItems as $v)
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$v->parent = $v->parent_id;
|
||||
$v->name = $v->title;
|
||||
}
|
||||
$pt = $v->parent;
|
||||
$list = @$children[$pt] ? $children[$pt] : array();
|
||||
array_push($list, $v);
|
||||
$children[$pt] = $list;
|
||||
}
|
||||
}
|
||||
|
||||
// second pass - get an indent list of the items
|
||||
$list = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
|
||||
|
||||
foreach ($list as $item)
|
||||
{
|
||||
$item->treename = JString::str_ireplace(' ', ' -', $item->treename);
|
||||
$mitems[] = JHTML::_('select.option', $item->id, ' '.$item->treename);
|
||||
}
|
||||
|
||||
// assemble into menutype groups
|
||||
$n = count($list);
|
||||
$groupedList = array();
|
||||
foreach ($list as $k => $v)
|
||||
{
|
||||
$groupedList[$v->menutype][] = &$list[$k];
|
||||
}
|
||||
|
||||
// assemble menu items to the array
|
||||
$options = array();
|
||||
$options[] = JHTML::_('select.option', '', '- '.JText::_('K2_SELECT_MENU_ITEM').' -');
|
||||
|
||||
foreach ($menuTypes as $type)
|
||||
{
|
||||
if ($type != '')
|
||||
{
|
||||
$options[] = JHTML::_('select.option', '0', ' ', 'value', 'text', true);
|
||||
$options[] = JHTML::_('select.option', $type->menutype, $type->title.' - '.JText::_('K2_TOP'), 'value', 'text', true);
|
||||
}
|
||||
if (isset($groupedList[$type->menutype]))
|
||||
{
|
||||
$n = count($groupedList[$type->menutype]);
|
||||
for ($i = 0; $i < $n; $i++)
|
||||
{
|
||||
$item = &$groupedList[$type->menutype][$i];
|
||||
|
||||
//If menutype is changed but item is not saved yet, use the new type in the list
|
||||
if (JRequest::getString('option', '', 'get') == 'com_menus')
|
||||
{
|
||||
$currentItemArray = JRequest::getVar('cid', array(0), '', 'array');
|
||||
$currentItemId = (int)$currentItemArray[0];
|
||||
$currentItemType = JRequest::getString('type', $item->type, 'get');
|
||||
if ($currentItemId == $item->id && $currentItemType != $item->type)
|
||||
{
|
||||
$item->type = $currentItemType;
|
||||
}
|
||||
}
|
||||
|
||||
$disable = @strpos($node->attributes('disable'), $item->type) !== false ? true : false;
|
||||
|
||||
if ($item->published == 0)
|
||||
$item->treename .= ' [**'.JText::_('K2_UNPUBLISHED').'**]';
|
||||
if ($item->published == -2)
|
||||
$item->treename .= ' [**'.JText::_('K2_TRASHED').'**]';
|
||||
|
||||
$options[] = JHTML::_('select.option', $item->id, $item->treename, 'value', 'text', $disable);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.']';
|
||||
}
|
||||
|
||||
return JHTML::_('select.genericlist', $options, $fieldName, 'class="inputbox"', 'value', 'text', $value, $control_name.$name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldMenuItem extends K2ElementMenuItem
|
||||
{
|
||||
var $type = 'MenuItem';
|
||||
}
|
||||
|
||||
class JElementMenuItem extends K2ElementMenuItem
|
||||
{
|
||||
var $_name = 'MenuItem';
|
||||
}
|
44
administrator/components/com_k2/elements/menus.php
Normal file
44
administrator/components/com_k2/elements/menus.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: menus.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementMenus extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$fieldName = (K2_JVERSION != '15') ? $name : $control_name.'['.$name.']';
|
||||
$db = JFactory::getDBO();
|
||||
$query = "SELECT menutype, title FROM #__menu_types";
|
||||
$db->setQuery($query);
|
||||
$menus = $db->loadObjectList();
|
||||
$options = array();
|
||||
$options[] = JHTML::_('select.option', '', JText::_('K2_NONE_ONSELECTLISTS'));
|
||||
foreach ($menus as $menu)
|
||||
{
|
||||
$options[] = JHTML::_('select.option', $menu->menutype, $menu->title);
|
||||
}
|
||||
return JHTML::_('select.genericlist', $options, $fieldName, 'class="inputbox"', 'value', 'text', $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldMenus extends K2ElementMenus
|
||||
{
|
||||
var $type = 'menus';
|
||||
}
|
||||
|
||||
class JElementMenus extends K2ElementMenus
|
||||
{
|
||||
var $_name = 'menus';
|
||||
}
|
93
administrator/components/com_k2/elements/moduletemplate.php
Normal file
93
administrator/components/com_k2/elements/moduletemplate.php
Normal file
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: moduletemplate.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementModuleTemplate extends K2Element
|
||||
{
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
|
||||
jimport('joomla.filesystem.folder');
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$moduleName = $node->attributes()->modulename;
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleName = $node->_attributes['modulename'];
|
||||
}
|
||||
$moduleTemplatesPath = JPATH_SITE.DS.'modules'.DS.$moduleName.DS.'tmpl';
|
||||
$moduleTemplatesFolders = JFolder::folders($moduleTemplatesPath);
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$query = "SELECT template FROM #__template_styles WHERE client_id = 0 AND home = 1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = "SELECT template FROM #__templates_menu WHERE client_id = 0 AND menuid = 0";
|
||||
}
|
||||
$db->setQuery($query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
$templatePath = JPATH_SITE.DS.'templates'.DS.$defaultemplate.DS.'html'.DS.$moduleName;
|
||||
|
||||
if (JFolder::exists($templatePath))
|
||||
{
|
||||
$templateFolders = JFolder::folders($templatePath);
|
||||
$folders = @array_merge($templateFolders, $moduleTemplatesFolders);
|
||||
$folders = @array_unique($folders);
|
||||
}
|
||||
else
|
||||
{
|
||||
$folders = $moduleTemplatesFolders;
|
||||
}
|
||||
|
||||
$exclude = 'Default';
|
||||
$options = array();
|
||||
|
||||
foreach ($folders as $folder)
|
||||
{
|
||||
if (preg_match(chr(1).$exclude.chr(1), $folder))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$options[] = JHTML::_('select.option', $folder, $folder);
|
||||
}
|
||||
|
||||
array_unshift($options, JHTML::_('select.option', 'Default', '-- '.JText::_('K2_USE_DEFAULT').' --'));
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.']';
|
||||
}
|
||||
|
||||
return JHTML::_('select.genericlist', $options, $fieldName, 'class="inputbox"', 'value', 'text', $value, $control_name.$name);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldModuleTemplate extends K2ElementModuleTemplate
|
||||
{
|
||||
var $type = 'moduletemplate';
|
||||
}
|
||||
|
||||
class JElementModuleTemplate extends K2ElementModuleTemplate
|
||||
{
|
||||
var $_name = 'moduletemplate';
|
||||
}
|
85
administrator/components/com_k2/elements/template.php
Normal file
85
administrator/components/com_k2/elements/template.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: template.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementTemplate extends K2Element
|
||||
{
|
||||
|
||||
public function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
|
||||
jimport('joomla.filesystem.folder');
|
||||
$mainframe = JFactory::getApplication();
|
||||
$fieldName = (K2_JVERSION != '15') ? $name : $control_name.'['.$name.']';
|
||||
$componentPath = JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'templates';
|
||||
$componentFolders = JFolder::folders($componentPath);
|
||||
$db = JFactory::getDBO();
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$query = "SELECT template FROM #__template_styles WHERE client_id = 0 AND home = 1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = "SELECT template FROM #__templates_menu WHERE client_id = 0 AND menuid = 0";
|
||||
}
|
||||
$db->setQuery($query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
|
||||
if (JFolder::exists(JPATH_SITE.DS.'templates'.DS.$defaultemplate.DS.'html'.DS.'com_k2'.DS.'templates'))
|
||||
{
|
||||
$templatePath = JPATH_SITE.DS.'templates'.DS.$defaultemplate.DS.'html'.DS.'com_k2'.DS.'templates';
|
||||
}
|
||||
else
|
||||
{
|
||||
$templatePath = JPATH_SITE.DS.'templates'.DS.$defaultemplate.DS.'html'.DS.'com_k2';
|
||||
}
|
||||
|
||||
if (JFolder::exists($templatePath))
|
||||
{
|
||||
$templateFolders = JFolder::folders($templatePath);
|
||||
$folders = @array_merge($templateFolders, $componentFolders);
|
||||
$folders = @array_unique($folders);
|
||||
}
|
||||
else
|
||||
{
|
||||
$folders = $componentFolders;
|
||||
}
|
||||
|
||||
$exclude = 'default';
|
||||
$options = array();
|
||||
foreach ($folders as $folder)
|
||||
{
|
||||
if (preg_match(chr(1).$exclude.chr(1), $folder))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$options[] = JHTML::_('select.option', $folder, $folder);
|
||||
}
|
||||
|
||||
array_unshift($options, JHTML::_('select.option', '', '-- '.JText::_('K2_USE_DEFAULT').' --'));
|
||||
|
||||
return JHTML::_('select.genericlist', $options, $fieldName, 'class="inputbox"', 'value', 'text', $value, $control_name.$name);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldTemplate extends K2ElementTemplate
|
||||
{
|
||||
var $type = 'template';
|
||||
}
|
||||
|
||||
class JElementTemplate extends K2ElementTemplate
|
||||
{
|
||||
var $_name = 'template';
|
||||
}
|
84
administrator/components/com_k2/elements/user.php
Normal file
84
administrator/components/com_k2/elements/user.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: user.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementUser extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
$mainframe = JFactory::getApplication();
|
||||
$db = JFactory::getDBO();
|
||||
$doc = JFactory::getDocument();
|
||||
$fieldName = (K2_JVERSION != '15') ? $name : $control_name.'['.$name.']';
|
||||
if ($value)
|
||||
{
|
||||
$user = JFactory::getUser($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = new stdClass;
|
||||
$user->name = JText::_('K2_SELECT_A_USER');
|
||||
}
|
||||
// Move this to main JS file
|
||||
$js = "
|
||||
function jSelectUser(id, title, object) {
|
||||
document.getElementById('".$name."' + '_id').value = id;
|
||||
document.getElementById('".$name."' + '_name').value = title;
|
||||
if(typeof(window.parent.SqueezeBox.close=='function')){
|
||||
window.parent.SqueezeBox.close();
|
||||
}
|
||||
else {
|
||||
document.getElementById('sbox-window').close();
|
||||
}
|
||||
}
|
||||
";
|
||||
$doc->addScriptDeclaration($js);
|
||||
$link = 'index.php?option=com_k2&view=users&task=element&tmpl=component&object='.$name;
|
||||
JHTML::_('behavior.modal', 'a.modal');
|
||||
if (K2_JVERSION == '30')
|
||||
{
|
||||
$html = '<span class="input-append">
|
||||
<input type="text" id="'.$name.'_name" value="'.htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
<a class="modal btn" title="'.JText::_('K2_SELECT_A_USER').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}"><i class="icon-file"></i>'.JText::_('K2_SELECT').'</a>
|
||||
<input type="hidden" class="required modal-value" id="'.$name.'_id" name="'.$fieldName.'" value="'.(int)$value.'" />
|
||||
</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$html = '
|
||||
<div style="float:left;">
|
||||
<input style="background:#fff;margin:3px 0;" type="text" id="'.$name.'_name" value="'.htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8').'" disabled="disabled" />
|
||||
</div>
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal" title="'.JText::_('K2_SELECT_A_USER').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_SELECT').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="'.$name.'_id" name="'.$fieldName.'" value="'.(int)$value.'" />
|
||||
';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldUser extends K2ElementUser
|
||||
{
|
||||
var $type = 'k2user';
|
||||
}
|
||||
|
||||
class JElementHeader extends K2ElementUser
|
||||
{
|
||||
var $_name = 'k2user';
|
||||
}
|
122
administrator/components/com_k2/elements/users.php
Normal file
122
administrator/components/com_k2/elements/users.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: users.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementUsers extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
JHTML::_('behavior.modal');
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$document = JFactory::getDocument();
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHTML::_('behavior.mootools');
|
||||
}
|
||||
K2HelperHTML::loadjQuery();
|
||||
$mainframe = JFactory::getApplication();
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name;
|
||||
if (!$node->attributes('multiple'))
|
||||
{
|
||||
$fieldName .= '[]';
|
||||
}
|
||||
$image = JURI::root(true).'/administrator/templates/'.$mainframe->getTemplate().'/images/admin/publish_x.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
$image = JURI::root(true).'/administrator/images/publish_x.png';
|
||||
}
|
||||
|
||||
$js = "
|
||||
function jSelectUser(id, title, object) {
|
||||
var exists = false;
|
||||
\$K2('#usersList input').each(function(){
|
||||
if(\$K2(this).val()==id){
|
||||
alert('".JText::_('K2_THE_SELECTED_USER_IS_ALREADY_IN_THE_LIST', true)."');
|
||||
exists = true;
|
||||
}
|
||||
});
|
||||
if(!exists){
|
||||
var container = \$K2('<li/>').appendTo(\$K2('#usersList'));
|
||||
var img = \$K2('<img/>',{'class':'remove', src:'".$image."'}).appendTo(container);
|
||||
img.click(function(){\$K2(this).parent().remove();});
|
||||
var span = \$K2('<span/>',{'class':'handle'}).html(title).appendTo(container);
|
||||
var input = \$K2('<input/>',{value:id, type:'hidden', name:'".$fieldName."'}).appendTo(container);
|
||||
var div = \$K2('<div/>',{style:'clear:both;'}).appendTo(container);
|
||||
\$K2('#usersList').sortable('refresh');
|
||||
alert('".JText::_('K2_USER_ADDED_IN_THE_LIST', true)."');
|
||||
}
|
||||
}
|
||||
|
||||
\$K2(document).ready(function(){
|
||||
\$K2('#usersList').sortable({
|
||||
containment: '#usersList',
|
||||
items: 'li',
|
||||
handle: 'span.handle'
|
||||
});
|
||||
\$K2('body').css('overflow-y', 'scroll');
|
||||
\$K2('#usersList .remove').click(function(){
|
||||
\$K2(this).parent().remove();
|
||||
});
|
||||
});
|
||||
";
|
||||
|
||||
$document->addScriptDeclaration($js);
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.modules.css?v=2.6.7');
|
||||
|
||||
$current = array();
|
||||
if (is_string($value) && !empty($value))
|
||||
{
|
||||
$current[] = $value;
|
||||
}
|
||||
if (is_array($value))
|
||||
{
|
||||
$current = $value;
|
||||
}
|
||||
|
||||
$output = '<ul id="usersList">';
|
||||
foreach ($current as $id)
|
||||
{
|
||||
$row = JFactory::getUser($id);
|
||||
$output .= '
|
||||
<li>
|
||||
<img class="remove" src="'.$image.'" alt="'.JText::_('K2_REMOVE_ENTRY_FROM_LIST').'" />
|
||||
<span class="handle">'.$row->name.'</span>
|
||||
<input type="hidden" value="'.$row->id.'" name="'.$fieldName.'"/>
|
||||
<div style="clear:both;"></div>
|
||||
</li>
|
||||
';
|
||||
}
|
||||
$output .= '</ul>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldUsers extends K2ElementUsers
|
||||
{
|
||||
var $type = 'users';
|
||||
}
|
||||
|
||||
class JElementUsers extends K2ElementUsers
|
||||
{
|
||||
var $_name = 'users';
|
||||
}
|
133
administrator/components/com_k2/elements/userslatest.php
Normal file
133
administrator/components/com_k2/elements/userslatest.php
Normal file
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: userslatest.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 ;
|
||||
|
||||
require_once (JPATH_ADMINISTRATOR.'/components/com_k2/elements/base.php');
|
||||
|
||||
class K2ElementUsersLatest extends K2Element
|
||||
{
|
||||
|
||||
function fetchElement($name, $value, &$node, $control_name)
|
||||
{
|
||||
JHTML::_('behavior.modal');
|
||||
$params = JComponentHelper::getParams('com_k2');
|
||||
$document = JFactory::getDocument();
|
||||
if (version_compare(JVERSION, '1.6.0', 'ge'))
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHTML::_('behavior.mootools');
|
||||
}
|
||||
|
||||
K2HelperHTML::loadjQuery();
|
||||
|
||||
$mainframe = JFactory::getApplication();
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$fieldName = $name;
|
||||
if (!$node->attributes('multiple'))
|
||||
{
|
||||
$fieldName .= '[]';
|
||||
}
|
||||
$image = JURI::root(true).'/administrator/templates/'.$mainframe->getTemplate().'/images/admin/publish_x.png';
|
||||
}
|
||||
else
|
||||
{
|
||||
$fieldName = $control_name.'['.$name.'][]';
|
||||
$image = JURI::root(true).'/administrator/images/publish_x.png';
|
||||
}
|
||||
|
||||
$js = "
|
||||
function jSelectUser(id, title, object) {
|
||||
var exists = false;
|
||||
\$K2('#usersList input').each(function(){
|
||||
if(\$K2(this).val()==id){
|
||||
alert('".JText::_('K2_THE_SELECTED_USER_IS_ALREADY_IN_THE_LIST', true)."');
|
||||
exists = true;
|
||||
}
|
||||
});
|
||||
if(!exists){
|
||||
var container = \$K2('<li/>').appendTo(\$K2('#usersList'));
|
||||
var img = \$K2('<img/>',{'class':'remove', src:'".$image."'}).appendTo(container);
|
||||
img.click(function(){\$K2(this).parent().remove();});
|
||||
var span = \$K2('<span/>',{'class':'handle'}).html(title).appendTo(container);
|
||||
var input = \$K2('<input/>',{value:id, type:'hidden', name:'".$fieldName."'}).appendTo(container);
|
||||
var div = \$K2('<div/>',{style:'clear:both;'}).appendTo(container);
|
||||
\$K2('#usersList').sortable('refresh');
|
||||
alert('".JText::_('K2_USER_ADDED_IN_THE_LIST', true)."');
|
||||
}
|
||||
}
|
||||
|
||||
\$K2(document).ready(function(){
|
||||
\$K2('#usersList').sortable({
|
||||
containment: '#usersList',
|
||||
items: 'li',
|
||||
handle: 'span.handle'
|
||||
});
|
||||
\$K2('body').css('overflow-y', 'scroll');
|
||||
\$K2('#usersList .remove').click(function(){
|
||||
\$K2(this).parent().remove();
|
||||
});
|
||||
});
|
||||
";
|
||||
|
||||
$document->addScriptDeclaration($js);
|
||||
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.modules.css?v=2.6.7');
|
||||
|
||||
$current = array();
|
||||
if (is_string($value) && !empty($value))
|
||||
{
|
||||
$current[] = $value;
|
||||
}
|
||||
if (is_array($value))
|
||||
{
|
||||
$current = $value;
|
||||
}
|
||||
|
||||
$output = '
|
||||
<div class="button2-left">
|
||||
<div class="blank">
|
||||
<a class="modal btn" title="'.JText::_('K2_CLICK_TO_SELECT_ONE_OR_MORE_USERS').'" href="index.php?option=com_k2&view=users&task=element&tmpl=component" rel="{handler: \'iframe\', size: {x: 700, y: 450}}">'.JText::_('K2_CLICK_TO_SELECT_ONE_OR_MORE_USERS').'</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
';
|
||||
|
||||
$output .= '<ul id="usersList">';
|
||||
foreach ($current as $id)
|
||||
{
|
||||
$row = JFactory::getUser($id);
|
||||
$output .= '
|
||||
<li>
|
||||
<img class="remove" src="'.$image.'" alt="'.JText::_('K2_REMOVE_ENTRY_FROM_LIST').'" />
|
||||
<span class="handle">'.$row->name.'</span>
|
||||
<input type="hidden" value="'.$row->id.'" name="'.$fieldName.'"/>
|
||||
<span style="clear:both;"></span>
|
||||
</li>
|
||||
';
|
||||
}
|
||||
$output .= '</ul>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JFormFieldUsersLatest extends K2ElementUsersLatest
|
||||
{
|
||||
var $type = 'userslatest';
|
||||
}
|
||||
|
||||
class JElementUsersLatest extends K2ElementUsersLatest
|
||||
{
|
||||
var $_name = 'userslatest';
|
||||
}
|
Reference in New Issue
Block a user