defined('_VALID_MOS') or die('Restricted access');
if (!$acl->acl_check('administration', 'config', 'users', $my->usertype)) {
    mosRedirect('index2.php?', _NOT_AUTH);
}
require_once $mainframe->getPath('class');
require_once $mainframe->getPath('admin_html');
switch ($task) {
    case 'apply':
    case 'save':
        saveconfig($task);
        break;
    case 'cancel':
        mosRedirect('index2.php');
        break;
    default:
        showconfig($option);
        break;
}
/**
 * Show the configuration edit form
 * @param string The URL option
 */
function showconfig($option)
{
    global $database, $mosConfig_absolute_path, $mosConfig_editor;
    $row = new mosConfig();
    $row->bindGlobals();
    // compile list of the languages
    $langs = array();
    $menuitems = array();
    $lists = array();
Example #2
0
            if (isset($GLOBALS[$v])) {
                $this->{$k} = $GLOBALS[$v];
            } else {
                $this->{$k} = "";
            }
        }
    }
}
require_once './components/com_config/admin.config.html.php';
$confightml = new HTML_config();
switch ($task) {
    case 'save':
        saveconfig();
        break;
    default:
        showconfig($confightml, $database, $option);
        break;
}
function showconfig($confightml, &$database, $option)
{
    global $database, $mosConfig_absolute_path, $adminLanguage;
    $row = new mosConfig();
    $row->bindGlobals();
    // compile list of the languages
    $langs = array();
    $alangs = array();
    $menuitems = array();
    if ($handle = opendir("{$mosConfig_absolute_path}/language/")) {
        $i = 0;
        while (false !== ($file = readdir($handle))) {
            if (!strcasecmp(substr($file, -4), ".php") && $file != "." && $file != ".." && strcasecmp(substr($file, -11), ".ignore.php") && strcasecmp(substr($file, 0, 6), "admin_")) {
    }
    $app->close();
}
// TODO: transform into JController-based controller
switch ($task) {
    case 'apply':
        saveconfig($task);
        break;
    case 'cancel':
        $app->redirect('index.php');
        break;
    case 'update':
        update();
        break;
    default:
        showconfig();
        break;
}
function showconfig()
{
    $isJoomla15 = substr(JVERSION, 0, 3) == '1.5';
    /** @var array $MobileJoomla_Settings */
    include JPATH_ADMINISTRATOR . '/components/com_mobilejoomla/config.php';
    include_once JPATH_ADMINISTRATOR . '/components/com_mobilejoomla/classes/jhtmlmjconfig.php';
    $app = JFactory::getApplication();
    if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_mobilejoomla/config.php')) {
        $app->enqueueMessage(JText::_('COM_MJ__CONFIG_MISSING'), 'error');
    } elseif (!is_writable(JPATH_ADMINISTRATOR . '/components/com_mobilejoomla/config.php')) {
        $app->enqueueMessage(JText::_('COM_MJ__CONFIG_UNWRITEABLE'), 'warning');
    }
    $db = JFactory::getDBO();