first commit

This commit is contained in:
alazhar
2020-01-02 22:20:31 +07:00
commit 10eb3340ad
5753 changed files with 631345 additions and 0 deletions

View File

@ -0,0 +1,151 @@
<?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;
jimport('joomla.application.component.controller');
class K2ControllerCategories extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'categories');
parent::display();
}
function publish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->publish();
}
function unpublish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->unpublish();
}
function saveorder()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->saveorder();
$document = JFactory::getDocument();
if ($document->getType() == 'raw')
{
echo '1';
return $this;
}
else
{
$this->setRedirect('index.php?option=com_k2&view=categories', JText::_('K2_NEW_ORDERING_SAVED'));
}
}
function orderup()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->orderup();
}
function orderdown()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->orderdown();
}
function accessregistered()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->accessregistered();
}
function accessspecial()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->accessspecial();
}
function accesspublic()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->accesspublic();
}
function trash()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->trash();
}
function restore()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->restore();
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->remove();
}
function add()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=category');
}
function edit()
{
$mainframe = JFactory::getApplication();
$cid = JRequest::getVar('cid');
$mainframe->redirect('index.php?option=com_k2&view=category&cid='.$cid[0]);
}
function element()
{
JRequest::setVar('view', 'categories');
JRequest::setVar('layout', 'element');
parent::display();
}
function move()
{
$view = $this->getView('categories', 'html');
$view->setLayout('move');
$view->move();
}
function saveMove()
{
$model = $this->getModel('categories');
$model->move();
}
function copy()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('categories');
$model->copy();
}
}

View File

@ -0,0 +1,49 @@
<?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;
jimport('joomla.application.component.controller');
class K2ControllerCategory extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'category');
parent::display();
}
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('category');
$model->save();
}
function saveAndNew()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('category');
$model->save();
}
function apply()
{
$this->save();
}
function cancel()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=categories');
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* @version $Id: comments.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.controller');
class K2ControllerComments extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
JRequest::setVar('view', 'comments');
parent::display();
}
function publish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('comments');
$model->publish();
}
function unpublish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('comments');
$model->unpublish();
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('comments');
$model->remove();
}
function deleteUnpublished()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('comments');
$model->deleteUnpublished();
}
function saveComment()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('comments');
$model->save();
}
}

View File

@ -0,0 +1,49 @@
<?php
/**
* @version $Id: controller.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.controller');
if (version_compare(JVERSION, '3.0', 'ge'))
{
class K2Controller extends JControllerLegacy
{
public function display($cachable = false, $urlparams = array())
{
parent::display($cachable, $urlparams);
}
}
}
else if (version_compare(JVERSION, '2.5', 'ge'))
{
class K2Controller extends JController
{
public function display($cachable = false, $urlparams = false)
{
parent::display($cachable, $urlparams);
}
}
}
else
{
class K2Controller extends JController
{
public function display($cachable = false)
{
parent::display($cachable);
}
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
* @version $Id: extrafield.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.controller');
class K2ControllerExtraField extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'extrafield');
parent::display();
}
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraField');
$model->save();
}
function apply()
{
$this->save();
}
function cancel()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=extrafields');
}
}

View File

@ -0,0 +1,89 @@
<?php
/**
* @version $Id: extrafields.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.controller');
class K2ControllerExtraFields extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'extrafields');
parent::display();
}
function publish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$model->publish();
}
function unpublish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$model->unpublish();
}
function saveorder()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$model->saveorder();
$document = JFactory::getDocument();
if ($document->getType() == 'raw')
{
echo '1';
return $this;
}
else
{
$this->setRedirect('index.php?option=com_k2&view=extrafields', JText::_('K2_NEW_ORDERING_SAVED'));
}
}
function orderup()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$model->orderup();
}
function orderdown()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$model->orderdown();
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$model->remove();
}
function add()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=extrafield');
}
function edit()
{
$mainframe = JFactory::getApplication();
$cid = JRequest::getVar('cid');
$mainframe->redirect('index.php?option=com_k2&view=extrafield&cid='.$cid[0]);
}
}

View File

@ -0,0 +1,47 @@
<?php
/**
* @version $Id: extrafieldsgroup.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.controller');
class K2ControllerExtraFieldsGroup extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'extrafieldsgroup');
$model = $this->getModel('extraFields');
$view = $this->getView('extrafieldsgroup', 'html');
$view->setModel($model, true);
parent::display();
}
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$view = $this->getView('extrafieldsgroup', 'html');
$view->setModel($model, true);
$model->saveGroup();
}
function apply()
{
$this->save();
}
function cancel()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=extrafieldsgroups');
}
}

View File

@ -0,0 +1,47 @@
<?php
/**
* @version $Id: extrafieldsgroups.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.controller');
class K2ControllerExtraFieldsGroups extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'extrafieldsgroups');
$model = $this->getModel('extraFields');
$view = $this->getView('extrafieldsgroups', 'html');
$view->setModel($model, true);
parent::display();
}
function add()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=extrafieldsgroup');
}
function edit()
{
$mainframe = JFactory::getApplication();
$cid = JRequest::getVar('cid');
$mainframe->redirect('index.php?option=com_k2&view=extrafieldsgroup&cid='.$cid[0]);
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('extraFields');
$model->removeGroups();
}
}

View File

@ -0,0 +1,24 @@
<?php
/**
* @version $Id: info.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.controller');
class K2ControllerInfo extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'info');
parent::display();
}
}

View File

@ -0,0 +1,115 @@
<?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 ;
jimport('joomla.application.component.controller');
class K2ControllerItem extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'item');
parent::display();
}
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('item');
$model->save();
}
function apply()
{
$this->save();
}
function cancel()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('item');
$model->cancel();
}
function deleteAttachment()
{
$model = $this->getModel('item');
$model->deleteAttachment();
}
function tag()
{
$model = $this->getModel('tag');
$model->addTag();
}
function download()
{
$model = $this->getModel('item');
$model->download();
}
function extraFields()
{
$mainframe = JFactory::getApplication();
$itemID = JRequest::getInt('id', NULL);
$categoryModel = $this->getModel('category');
$category = $categoryModel->getData();
$extraFieldModel = $this->getModel('extraField');
$extraFields = $extraFieldModel->getExtraFieldsByGroup($category->extraFieldsGroup);
$output = '<table class="admintable" id="extraFields">';
$counter = 0;
if (count($extraFields))
{
foreach ($extraFields as $extraField)
{
if ($extraField->type == 'header')
{
$output .= '<tr><td colspan="2" ><h4 class="k2ExtraFieldHeader">'.$extraField->name.'</h4></td></tr>';
}
else
{
$output .= '<tr><td align="right" class="key"><label for="K2ExtraField_'.$extraField->id.'">'.$extraField->name.'</label></td>';
$output .= '<td>'.$extraFieldModel->renderExtraField($extraField, $itemID).'</td></tr>';
}
$counter++;
}
}
$output .= '</table>';
if ($counter == 0)
$output = JText::_('K2_THIS_CATEGORY_DOESNT_HAVE_ASSIGNED_EXTRA_FIELDS');
echo $output;
$mainframe->close();
}
function resetHits()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('item');
$model->resetHits();
}
function resetRating()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('item');
$model->resetRating();
}
}

View File

@ -0,0 +1,202 @@
<?php
/**
* @version $Id: items.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.controller');
class K2ControllerItems extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'items');
parent::display();
}
function publish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->publish();
}
function unpublish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->unpublish();
}
function saveorder()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$result = $model->saveorder();
$document = JFactory::getDocument();
if ($document->getType() == 'raw')
{
echo '1';
return $this;
}
else
{
$this->setRedirect('index.php?option=com_k2&view=items', JText::_('K2_NEW_ORDERING_SAVED'));
}
}
function orderup()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->orderup();
}
function orderdown()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->orderdown();
}
function savefeaturedorder()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$result = $model->savefeaturedorder();
$document = JFactory::getDocument();
if ($document->getType() == 'raw')
{
echo '1';
return $this;
}
else
{
$this->setRedirect('index.php?option=com_k2&view=items', JText::_('K2_NEW_FEATURED_ORDERING_SAVED'));
}
}
function featuredorderup()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->featuredorderup();
}
function featuredorderdown()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->featuredorderdown();
}
function accessregistered()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->accessregistered();
}
function accessspecial()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->accessspecial();
}
function accesspublic()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->accesspublic();
}
function featured()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->featured();
}
function trash()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->trash();
}
function restore()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->restore();
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->remove();
}
function add()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=item');
}
function edit()
{
$mainframe = JFactory::getApplication();
$cid = JRequest::getVar('cid');
$mainframe->redirect('index.php?option=com_k2&view=item&cid='.$cid[0]);
}
function copy()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('items');
$model->copy();
}
function element()
{
JRequest::setVar('view', 'items');
JRequest::setVar('layout', 'element');
parent::display();
}
function import()
{
$model = $this->getModel('items');
if (K2_JVERSION != '15')
{
$model->importJ16();
}
else
{
$model->import();
}
}
function move()
{
$view = $this->getView('items', 'html');
$view->setLayout('move');
$view->move();
}
function saveMove()
{
$model = $this->getModel('items');
$model->move();
}
}

View File

@ -0,0 +1,82 @@
<?php
/**
* @version $Id: media.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.controller');
class K2ControllerMedia extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'media');
parent::display();
}
function connector()
{
$mainframe = JFactory::getApplication();
$params = JComponentHelper::getParams('com_media');
$root = $params->get('file_path', 'media');
$folder = JRequest::getVar('folder', $root, 'default', 'path');
$type = JRequest::getCmd('type', 'video');
if (JString::trim($folder) == "")
{
$folder = $root;
}
$url = JURI::root(true).'/'.$folder;
$path = JPATH_SITE.DS.JPath::clean($folder);
JPath::check($path);
include_once JPATH_COMPONENT_ADMINISTRATOR.DS.'lib'.DS.'elfinder'.DS.'elFinderConnector.class.php';
include_once JPATH_COMPONENT_ADMINISTRATOR.DS.'lib'.DS.'elfinder'.DS.'elFinder.class.php';
include_once JPATH_COMPONENT_ADMINISTRATOR.DS.'lib'.DS.'elfinder'.DS.'elFinderVolumeDriver.class.php';
include_once JPATH_COMPONENT_ADMINISTRATOR.DS.'lib'.DS.'elfinder'.DS.'elFinderVolumeLocalFileSystem.class.php';
function access($attr, $path, $data, $volume)
{
$mainframe = JFactory::getApplication();
// Hide files and folders starting with .
if (strpos(basename($path), '.') === 0 && $attr == 'hidden')
{
return true;
}
// Read only access for front-end. Full access for administration section.
switch($attr)
{
case 'read' :
return true;
break;
case 'write' :
return ($mainframe->isSite()) ? false : true;
break;
case 'locked' :
return ($mainframe->isSite()) ? true : false;
break;
case 'hidden' :
return false;
break;
}
}
if ($mainframe->isAdmin())
{
$permissions = array('read' => true, 'write' => true);
}
else
{
$permissions = array('read' => true, 'write' => false);
}
$options = array('roots' => array( array('driver' => 'LocalFileSystem', 'path' => $path, 'URL' => $url, 'accessControl' => 'access', 'defaults' => $permissions)));
$connector = new elFinderConnector(new elFinder($options));
$connector->run();
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
* @version $Id: settings.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.controller');
class K2ControllerSettings extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
if (K2_JVERSION != '15')
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_config&view=component&component=com_k2&path=&tmpl=component');
}
else
{
JRequest::setVar('tmpl', 'component');
parent::display();
}
}
function save()
{
$mainframe = JFactory::getApplication();
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('settings');
$model->save();
$mainframe->redirect('index.php?option=com_k2&view=settings');
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
* @version $Id: tag.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.controller');
class K2ControllerTag extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'tag');
parent::display();
}
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('tag');
$model->save();
}
function apply()
{
$this->save();
}
function cancel()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=tags');
}
}

View File

@ -0,0 +1,72 @@
<?php
/**
* @version $Id: tags.php 1927 2013-02-12 11:52:35Z 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.controller');
class K2ControllerTags extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'tags');
parent::display();
}
function publish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('tags');
$model->publish();
}
function unpublish()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('tags');
$model->unpublish();
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('tags');
$model->remove();
}
function add()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=tag');
}
function edit()
{
$mainframe = JFactory::getApplication();
$cid = JRequest::getVar('cid');
$mainframe->redirect('index.php?option=com_k2&view=tag&cid='.$cid[0]);
}
function element()
{
JRequest::setVar('view', 'tags');
JRequest::setVar('layout', 'element');
parent::display();
}
function removeOrphans()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('tags');
$model->removeOrphans();
}
}

View File

@ -0,0 +1,50 @@
<?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;
jimport('joomla.application.component.controller');
class K2ControllerUser extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'user');
parent::display();
}
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('user');
$model->save();
}
function apply()
{
$this->save();
}
function cancel()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=users');
}
function report()
{
$model = K2Model::getInstance('User', 'K2Model');
$model->setState('id', JRequest::getInt('id'));
$model->reportSpammer();
$this->setRedirect('index.php?option=com_k2&view=users');
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
* @version $Id: usergroup.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.controller');
class K2ControllerUserGroup extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'usergroup');
parent::display();
}
function save()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('userGroup');
$model->save();
}
function apply()
{
$this->save();
}
function cancel()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=usergroups');
}
}

View File

@ -0,0 +1,44 @@
<?php
/**
* @version $Id: usergroups.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.controller');
class K2ControllerUserGroups extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'usergroups');
parent::display();
}
function edit()
{
$mainframe = JFactory::getApplication();
$cid = JRequest::getVar('cid');
$mainframe->redirect('index.php?option=com_k2&view=usergroup&cid='.$cid[0]);
}
function add()
{
$mainframe = JFactory::getApplication();
$mainframe->redirect('index.php?option=com_k2&view=usergroup');
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('userGroups');
$model->remove();
}
}

View File

@ -0,0 +1,88 @@
<?php
/**
* @version $Id: users.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.controller');
class K2ControllerUsers extends K2Controller
{
public function display($cachable = false, $urlparams = array())
{
JRequest::setVar('view', 'users');
parent::display();
}
function edit()
{
$mainframe = JFactory::getApplication();
$cid = JRequest::getVar('cid');
$mainframe->redirect('index.php?option=com_k2&view=user&cid='.$cid[0]);
}
function remove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('users');
$model->remove();
}
function element()
{
JRequest::setVar('view', 'users');
JRequest::setVar('layout', 'element');
parent::display();
}
function enable()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('users');
$model->enable();
}
function disable()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('users');
$model->disable();
}
function delete()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('users');
$model->delete();
}
function move()
{
$view = $this->getView('users', 'html');
$view->setLayout('move');
$model = $this->getModel('users');
$view->setModel($model);
$view->move();
}
function saveMove()
{
JRequest::checkToken() or jexit('Invalid Token');
$model = $this->getModel('users');
$model->saveMove();
}
function import()
{
$model = $this->getModel('users');
$model->import();
}
}