primo commit
This commit is contained in:
		| @ -0,0 +1 @@ | ||||
| <html><body></body></html> | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryCoImgsHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0, $imageCommentId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagallerycoimgs.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryCosHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0, $commentId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagallerycos.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,34 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryCpHelper | ||||
| { | ||||
| 	public static function getActions() | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		$assetName = 'com_phocagallery'; | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryCsHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagallerycs.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryEfsHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0, $commentId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryefs.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,39 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryFbsHelper | ||||
| { | ||||
| 	public static function getActions($id = '') | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if ($id != '') { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryfbs.'.(int)$id; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryfbs'; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryImgsHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryimgs.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryMHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagallerym.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryRaHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryra.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryRaImgHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryraimg.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryTHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryt.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,102 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\HTML\HTMLHelper; | ||||
|  | ||||
| class PhocaGalleryTagHelper | ||||
| { | ||||
| 	public function getTags($fileId, $select = 0) { | ||||
|  | ||||
| 		$db =Factory::getDBO(); | ||||
|  | ||||
| 		if ($select == 1) { | ||||
| 			$query = 'SELECT r.tagid'; | ||||
| 		} else { | ||||
| 			$query = 'SELECT a.*'; | ||||
| 		} | ||||
| 		$query .= ' FROM #__phocagallery_tags AS a' | ||||
| 				//.' LEFT JOIN #__phocagallery AS f ON f.id = r.fileid' | ||||
| 				.' LEFT JOIN #__phocagallery_tags_ref AS r ON a.id = r.tagid' | ||||
| 			    .' WHERE r.fileid = '.(int) $fileId; | ||||
| 		$db->setQuery($query); | ||||
|  | ||||
|  | ||||
| 		if ($select == 1) { | ||||
| 			$tags = $db->loadColumn(); | ||||
| 		} else { | ||||
| 			$tags = $db->loadObjectList(); | ||||
| 		} | ||||
|  | ||||
| 		return $tags; | ||||
| 	} | ||||
|  | ||||
| 	public function storeTags($tagsArray, $fileId) { | ||||
|  | ||||
|  | ||||
| 		if ((int)$fileId > 0) { | ||||
| 			$db =Factory::getDBO(); | ||||
| 			$query = ' DELETE ' | ||||
| 					.' FROM #__phocagallery_tags_ref' | ||||
| 					. ' WHERE fileid = '. (int)$fileId; | ||||
| 			$db->setQuery($query); | ||||
| 			if (!$db->execute()) { | ||||
| 				$this->setError('Database Error - Deleting FileId Tags'); | ||||
| 				return false; | ||||
| 			} | ||||
|  | ||||
| 			if (!empty($tagsArray)) { | ||||
|  | ||||
| 				$values 		= array(); | ||||
| 				$valuesString 	= ''; | ||||
|  | ||||
| 				foreach($tagsArray as $k => $v) { | ||||
| 					$values[] = ' ('.(int)$fileId.', '.(int)$v.')'; | ||||
| 				} | ||||
|  | ||||
| 				if (!empty($values)) { | ||||
| 					$valuesString = implode($values, ','); | ||||
|  | ||||
| 					$query = ' INSERT INTO #__phocagallery_tags_ref (fileid, tagid)' | ||||
| 								.' VALUES '.(string)$valuesString; | ||||
|  | ||||
| 					$db->setQuery($query); | ||||
| 					if (!$db->execute()) { | ||||
| 						$this->setError('Database Error - Insert FileId Tags'); | ||||
| 						return false; | ||||
| 					} | ||||
|  | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	public function getAllTagsSelectBox($name, $id, $activeArray, $javascript = NULL, $order = 'id' ) { | ||||
|  | ||||
| 		$db =Factory::getDBO(); | ||||
| 		$query = 'SELECT a.id AS value, a.title AS text' | ||||
| 				.' FROM #__phocagallery_tags AS a' | ||||
| 				. ' ORDER BY '. $order; | ||||
| 		$db->setQuery($query); | ||||
|  | ||||
| 		/*if (!$db->query()) { | ||||
| 			$this->setError('Database Error - Getting All Tags'); | ||||
| 			return false; | ||||
| 		}*/ | ||||
|  | ||||
| 		$tags = $db->loadObjectList(); | ||||
|  | ||||
| 		$tagsO = HTMLHelper::_('select.genericlist', $tags, $name, 'class="form-control" size="4" multiple="multiple"'. $javascript, 'value', 'text', $activeArray, $id); | ||||
|  | ||||
| 		return $tagsO; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,39 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryTagsHelper | ||||
| { | ||||
| 	public static function getActions($itemId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($itemId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagallerytags'.(int) $itemId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
| @ -0,0 +1,38 @@ | ||||
| <?php | ||||
| /* | ||||
|  * @package		Joomla.Framework | ||||
|  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved. | ||||
|  * @license		GNU General Public License version 2 or later; see LICENSE.txt | ||||
|  * | ||||
|  * @component Phoca Component | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later; | ||||
|  */ | ||||
| defined('_JEXEC') or die; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
|  | ||||
| class PhocaGalleryUsersHelper | ||||
| { | ||||
| 	public static function getActions($categoryId = 0) | ||||
| 	{ | ||||
| 		$user	= Factory::getUser(); | ||||
| 		$result	= new CMSObject; | ||||
|  | ||||
| 		if (empty($categoryId)) { | ||||
| 			$assetName = 'com_phocagallery'; | ||||
| 		} else { | ||||
| 			$assetName = 'com_phocagallery.phocagalleryusers.'.(int) $categoryId; | ||||
| 		} | ||||
|  | ||||
| 		$actions = array( | ||||
| 			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' | ||||
| 		); | ||||
|  | ||||
| 		foreach ($actions as $action) { | ||||
| 			$result->set($action,	$user->authorise($action, $assetName)); | ||||
| 		} | ||||
|  | ||||
| 		return $result; | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user