Esempio n. 1
0
    /**
     * Display the view
     */
    function display()
    {
        $task = BabioonRequest::getVar('task', 'system');
        $conf = BabioonConfig::getInstance($task);
        $params = $conf->getParamsObj();
        $document =& BabioonFactory::getDocument();
        $document->setTitle(BabioonText::_('Edit Preferences'));
        BabioonHTML::_('behavior.tooltip');
        ?>
	<form action="index.php" method="post" name="adminForm" autocomplete="off">
		<fieldset>
			<div style="float: right">
				<button type="button" onclick="submitbutton('save');window.top.setTimeout('window.parent.document.getElementById(\'sbox-window\').close()', 700);">
					<?php 
        echo BabioonText::_('Save');
        ?>
</button>
				<button type="button" onclick="window.parent.document.getElementById('sbox-window').close();">
					<?php 
        echo BabioonText::_('Cancel');
        ?>
</button>
			</div>
			<div class="configuration" >
				<?php 
        $task = BabioonRequest::getVar('task', '');
        echo BabioonText::_('Config' . $task);
        ?>
			</div>
		</fieldset>

		<fieldset>
			<legend>
				<?php 
        echo BabioonText::_('Configuration');
        ?>
			</legend>
			<?php 
        echo $params->render();
        ?>
		</fieldset>

		<input type="hidden" name="id" value="<?php 
        echo $params->get('id', 0);
        ?>
" />
		<input type="hidden" name="control" value="<?php 
        echo $task;
        ?>
" />

		<input type="hidden" name="section" value="config" />
		<input type="hidden" name="option" value="<?php 
        echo $conf->getComponent();
        ?>
" />
		<input type="hidden" name="task" value="" />
	</form>
<?php 
    }
Esempio n. 2
0
 public static function getParams()
 {
     if (!is_object(self::$params)) {
         jimport('joomla.application.component.helper');
         self::$params = JComponentHelper::getParams(self::getApplication()->get('scope'));
     }
     return self::$params;
 }
Esempio n. 3
0
 function getInstance($type = 'system', $table = null, $component = null)
 {
     if (is_null($component)) {
         $app = BabioonFactory::getApplication();
         $scope = substr($app->scope, 4);
     } else {
         if (strpos($component, 'com_') !== false) {
             $scope = substr($component, 4);
         } else {
             $scope = $component;
         }
     }
     $index = $scope . '_' . $type;
     if (!isset(self::$instances[$index])) {
         if (is_null($table)) {
             $table = '#__' . $scope;
         }
         self::$instances[$index] = new BabioonConfig($type, $table, $scope);
     }
     return self::$instances[$index];
 }