Beispiel #1
0
$smarty->assign("T_APPEARANCE_MAIN_FORM", $appearanceMainForm->toArray());
$appearanceLogoForm = new Html_QuickForm("appearance_logo_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=appearance&tab=logo", "", null, true);
$appearanceLogoForm->registerRule('checkParameter', 'callback', 'eF_checkParameter');
try {
    $file = new EfrontFile($configuration['site_logo']);
    $appearanceLogoForm->addElement("static", "formelement", '<img src = "' . G_DEFAULTTHEMEURL . 'images/logo/' . $file['name'] . '" alt = "' . _SITELOGO . '" title = "' . _SITELOGO . '"/>');
} catch (Exception $e) {
}
$appearanceLogoForm->addElement('file', 'site_logo', _UPLOADSITELOGO);
$appearanceLogoForm->addElement("static", "", _EACHFILESIZEMUSTBESMALLERTHAN . ' <b>' . FileSystemTree::getUploadMaxSize() . '</b> ' . _KB);
//Don't show normalization if GD isn't set.
if (extension_loaded('gd') || extension_loaded('gd2')) {
    $smarty->assign("T_GD_LOADED", true);
    $appearanceLogoForm->addElement("text", "logo_max_width", _LOGOWIDTH, 'size = "5"');
    $appearanceLogoForm->addElement("text", "logo_max_height", _LOGOHEIGHT, 'size = "5"');
    $appearanceLogoForm->addRule('logo_max_width', _LOGODIMENSIONSMUSTBEPOSITIVE, 'callback', create_function('$a', 'return ($a > 0);'));
    $appearanceLogoForm->addRule('logo_max_height', _LOGODIMENSIONSMUSTBEPOSITIVE, 'callback', create_function('$a', 'return ($a > 0);'));
    $appearanceLogoForm->addElement("advcheckbox", "normalize_dimensions", _NORMALIZEDIMENSIONS, null, 'class = "inputCheckBox"', array(0, 1));
    $appearanceLogoForm->setDefaults(array('normalize_dimensions' => 1));
}
$appearanceLogoForm->addElement("select", "use_logo", _USELOGO, array(0 => _DEFAULTLOGO, 1 => _SITELOGO, 2 => _THEMELOGO));
$appearanceLogoForm->setMaxFileSize(FileSystemTree::getUploadMaxSize() * 1024);
try {
    // Get current dimensions
    list($width, $height) = getimagesize($GLOBALS['logoFile']['path']);
    $appearanceLogoForm->setDefaults(array('logo_max_width' => $width, 'logo_max_height' => $height));
} catch (EfrontFileException $e) {
    $appearanceLogoForm->setDefaults(array('logo_max_width' => 200, 'logo_max_height' => 150));
}
$appearanceLogoForm->setDefaults($GLOBALS['configuration']);
if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') {
Beispiel #2
0
}
$smarty->assign("T_GENERAL_SMTP_FORM", $generalSMTPForm->toArray());
$generalPHPForm = new Html_QuickForm("general_php_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=system_config&op=general&tab=php", "", null, true);
$generalPHPForm->registerRule('checkParameter', 'callback', 'eF_checkParameter');
$generalPHPForm->addElement("static", "sidenote", 'M');
$generalPHPForm->addElement("text", "memory_limit", _MEMORYLIMIT, 'class = "inputText" style = "width:35px"');
$generalPHPForm->addElement("static", "sidenote", _SECONDS);
$generalPHPForm->addElement("text", "max_execution_time", _MAXEXECUTIONTIME, 'class = "inputText" style = "width:35px"');
$generalPHPForm->addElement("static", "", _LEAVEBLANKTOUSEPHPINI);
$generalPHPForm->addElement("advcheckbox", "gz_handler", _GZHANDLER, null, 'class = "inputCheckBox"', array(0, 1));
$generalPHPForm->addElement("advcheckbox", "compress_tests", _COMPRESSTESTS, null, 'class = "inputCheckBox"', array(0, 1));
$generalPHPForm->addElement("text", "max_file_size", _MAXFILESIZE, 'class = "inputText"');
$generalPHPForm->addElement("static", "", _MAXFILEISAFFECTEDANDIS . ' <b>' . FileSystemTree::getUploadMaxSize() . '</b> ' . _KB);
$generalPHPForm->addElement("text", "debug_mode", _DEBUGMODE, null, 'class = "inputText"');
$generalPHPForm->addElement("static", "", _COMMASEPARATEDLISTOFUSERSOR1FORALL);
$generalPHPForm->addRule('memory_limit', _INVALIDFIELDDATA, 'checkParameter', 'id');
$generalPHPForm->addRule('max_execution_time', _INVALIDFIELDDATA, 'checkParameter', 'id');
$generalPHPForm->addRule('max_file_size', _INVALIDFIELDDATA, 'checkParameter', 'id');
$generalPHPForm->addRule('max_file_size', _INVALIDFIELDDATAFORFIELD . ': "' . _MAXFILESIZE . '"', 'numeric', null, 'client');
$generalPHPForm->setDefaults($GLOBALS['configuration']);
isset($configuration['memory_limit']) ? $generalPHPForm->setDefaults(array('memory_limit' => $configuration['memory_limit'])) : $generalPHPForm->setDefaults(array('memory_limit' => (int) ini_get('memory_limit')));
isset($configuration['max_execution_time']) ? $generalPHPForm->setDefaults(array('max_execution_time' => $configuration['max_execution_time'])) : $generalPHPForm->setDefaults(array('max_execution_time' => ini_get('max_execution_time')));
isset($configuration['gz_handler']) ? $generalPHPForm->setDefaults(array('gz_handler' => $configuration['gz_handler'])) : $generalPHPForm->setDefaults(array('gz_handler' => ''));
//		isset($configuration['display_errors'])   ? $generalPHPForm -> setDefaults(array('display_errors'	 => $configuration['display_errors']))	 : $generalPHPForm -> setDefaults(array('display_errors'	 => ini_get('display_errors')));
if ($GLOBALS['configuration']['version_hosted']) {
    $generalPHPForm->freeze(array('memory_limit', 'max_execution_time'));
}
if (isset($currentUser->coreAccess['configuration']) && $currentUser->coreAccess['configuration'] != 'change') {
    $generalPHPForm->freeze();
} else {
    $generalPHPForm->addElement("submit", "submit", _SAVE, 'class = "flatButton"');