예제 #1
0
 /**
  * PHP5 constructor
  * @param  string  $pageContent
  * @global integer
  * @access public
  */
 function __construct($pageContent)
 {
     global $_LANGID;
     $this->pageContent = $pageContent;
     $this->langId = $_LANGID;
     $this->_objTpl = new \Cx\Core\Html\Sigma('.');
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
     $this->_objTpl->setErrorHandling(PEAR_ERROR_DIE);
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     parent::__construct();
 }
 /**
  * Loads and saves general settings
  *
  * @access  private
  * @global  array               $_ARRAYLANG
  * @global  ADONewConnection    $objDatabase
  */
 private function settingsGeneral()
 {
     global $objDatabase, $_ARRAYLANG;
     if (isset($_POST['settings_general'])) {
         $error = false;
         if (isset($_POST['default_listing'])) {
             $query = "UPDATE " . DBPREFIX . "module_memberdir_settings\n                          SET setvalue = '" . contrexx_addslashes($_POST['default_listing']) . "'\n                          WHERE setname = 'default_listing'";
             if (!$objDatabase->Execute($query)) {
                 $error = true;
             }
         }
         if (isset($_POST['max_width'])) {
             $query = "UPDATE " . DBPREFIX . "module_memberdir_settings\n                          SET setvalue = '" . contrexx_addslashes($_POST['max_width']) . "'\n                          WHERE setname = 'max_width'";
             if (!$objDatabase->Execute($query)) {
                 $error = true;
             }
         }
         if (isset($_POST['max_height'])) {
             $query = "UPDATE " . DBPREFIX . "module_memberdir_settings\n                          SET setvalue = '" . contrexx_addslashes($_POST['max_height']) . "'\n                          WHERE setname = 'max_height'";
             if (!$objDatabase->Execute($query)) {
                 $error = true;
             }
         }
         if ($error) {
             $this->statusMessage = $_ARRAYLANG['TXT_DATABASE_WRITE_ERROR'];
         } else {
             $this->okMessage = $_ARRAYLANG['TXT_DATABASE_SUCESSFUL'];
         }
     }
     parent::__construct();
     $this->_objTpl->addBlockfile('MEMBERDIR_SETTINGS_CONTENT', 'settings_content', 'module_memberdir_settings_general.html');
     $this->pageTitle = $_ARRAYLANG['TXT_SETTINGS'];
     $this->_objTpl->setVariable(array("TXT_SETTINGS" => $_ARRAYLANG['TXT_SETTINGS'], "TXT_SETTINGS_DEFAULT_LISTING" => $_ARRAYLANG['TXT_SETTINGS_DEFAULT_LISTING'], "TXT_SAVE" => $_ARRAYLANG['TXT_SAVE'], "TXT_YES" => $_ARRAYLANG['TXT_YES'], "TXT_NO" => $_ARRAYLANG['TXT_NO'], "TXT_SETTINGS_IMAGE_MAX_HEIGHT" => $_ARRAYLANG['TXT_SETTINGS_IMAGE_MAX_HEIGHT'], "TXT_SETTINGS_IMAGE_MAX_WIDTH" => $_ARRAYLANG['TXT_SETTINGS_IMAGE_MAX_WIDTH'], "MAX_HEIGHT" => $this->options['max_height'], "MAX_WIDTH" => $this->options['max_width']));
     $selected = "selected=\"selected\"";
     $this->_objTpl->setVariable(array("SETTINGS_DEFAULT_LISTING" => $this->options['default_listing'], "YES_SELECTED" => $this->options['default_listing'] == 1 ? $selected : "", "NO_SELECTED" => $this->options['default_listing'] == 0 ? $selected : ""));
     $this->_objTpl->parse('settings_content');
 }