89 lines
2.7 KiB
PHP
89 lines
2.7 KiB
PHP
<?php
|
|
/**
|
|
* @version 6.2.6 tabulizer $
|
|
* @package tabulizer
|
|
* @copyright Copyright © 2011 - All rights reserved.
|
|
* @license GNU/GPL
|
|
* @author Dimitrios Mourloukos
|
|
* @author mail info@alterora.gr
|
|
* @website www.tabulizer.com
|
|
*
|
|
*/
|
|
|
|
|
|
// no direct access
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
jimport( 'joomla.application.component.model' );
|
|
|
|
TabulizerPath::requireLib('ruleset','admin');
|
|
|
|
class tabulizerModelRuleset extends JModelLegacy {
|
|
|
|
var $ruleset_name = null;
|
|
var $archive_filename = null;
|
|
var $ruleset = null;
|
|
|
|
function __construct(){
|
|
parent::__construct();
|
|
}
|
|
|
|
function loadRuleset($ruleset_name, $archive_file) {
|
|
$this->archive_filename = $archive_file;
|
|
$this->ruleset_name = $ruleset_name;
|
|
|
|
$ruleset = new Ruleset();
|
|
$this->ruleset = $ruleset->getRuleset($this->ruleset_name, $this->archive_filename);
|
|
|
|
return $this->ruleset;
|
|
}
|
|
|
|
function getRuleset() {
|
|
if (empty($this->ruleset)) {
|
|
$this->loadRuleset($this->ruleset_name, $this->archive_filename);
|
|
}
|
|
|
|
return $this->ruleset;
|
|
}
|
|
|
|
function saveRuleset($new_ruleset, $ruleset_file) {
|
|
$ruleset = new Ruleset();
|
|
return $ruleset->saveRuleset($new_ruleset, $ruleset_file);
|
|
}
|
|
|
|
function deleteRuleset($ruleset_names, $ruleset_file) {
|
|
$ruleset = new Ruleset();
|
|
return $ruleset->deleteRuleset($ruleset_names, $ruleset_file);
|
|
}
|
|
|
|
function getAllRulesetNames($exclude_ruleset_names = array()) {
|
|
$ruleset = new Ruleset();
|
|
return $ruleset->getAllRulesetNames($exclude_ruleset_names);
|
|
}
|
|
|
|
function getAllRulesetTitles($exclude_ruleset_titles = array()) {
|
|
$ruleset = new Ruleset();
|
|
return $ruleset->getAllRulesetTitles($exclude_ruleset_titles);
|
|
}
|
|
|
|
function getRecommendedName($seed = '') {
|
|
$ruleset = new Ruleset();
|
|
return $ruleset->getRecommendedName($seed);
|
|
}
|
|
|
|
function getReturnURLs(&$urls) {
|
|
$jinput = JFactory::getApplication()->input;
|
|
$option = $jinput->getCmd('option');
|
|
|
|
$urls = array();
|
|
$url = $jinput->getString('archives_return_url','');
|
|
$urls['archives'] = empty($url)?str_replace('&','&',JRoute::_('index.php?option='.$option.'&task=viewrulesetarchives')):urldecode($url);
|
|
$url = $jinput->getString('archive_return_url','');
|
|
$urls['archive'] = empty($url)?str_replace('&','&',JRoute::_('index.php?option='.$option.'&task=viewrulesetarchive&archive_filename='.$this->archive_filename)):urldecode($url);
|
|
$url = str_replace('&','&',JRoute::_('index.php?option='.$option.'&task=viewruleset&ruleset_name='.urlencode($this->ruleset_name).'&archive_filename='.urlencode($this->archive_filename)));
|
|
$urls['ruleset'] = $url;
|
|
|
|
}
|
|
|
|
}
|
|
?>
|