Exemplo n.º 1
0
 /**
  * Object constructor.
  *
  * Builds the object depending on the Module configuration, given to the object
  * itself as an instance of a ModuleConfig class.
  *
  * @since 5.1
  * @param ModuleConfig $config Configuration object.
  */
 public function __construct(\Innomatic\Module\ModuleConfig $config)
 {
     // Assigns the config and retrieves fully qualified name for value object.
     $this->config = $config;
     $vo_fqcn = $this->config->getValueObjectClass();
     if (!strlen($vo_fqcn)) {
         $vo_fqcn = '\\Innomatic\\Module\\Util\\ModuleEmptyValueObject';
     }
     // Imports value object.
     require_once $vo_fqcn . '.php';
     $vo_class = strpos($vo_fqcn, '/') ? substr($vo_fqcn, strrpos($vo_fqcn, '/') + 1) : $vo_fqcn;
     if (!class_exists($vo_class, true)) {
         throw new ModuleException('Value object class ' . $vo_class . ' does not exists');
     }
     // Instantiates the value object.
     $this->valueObject = new $vo_class();
     // If there are user defined fields, adds them to the value object.
     // This is useful for value objects whose structure is stored in
     // configuration files or determined at runtime.
     $vo_fields = $this->config->getValueObjectFields();
     if (count($vo_fields)) {
         foreach ($vo_fields as $field) {
             $this->valueObject->addField($field);
         }
     }
 }
Exemplo n.º 2
0
function main_page($redrawFrames = FALSE)
{
    Carthag::import('com.solarix.ampoliros.hui.Hui');
    global $gEnv;
    if (!$redrawFrames and is_object($gEnv['root']['db']) and !defined('AMPOLIROS_SETUP_PHASE')) {
        import('com.solarix.ampoliros.module.ModuleConfig');
        $mod_cfg = new ModuleConfig($gEnv['root']['db'], 'ampoliros');
        $amp_logo_disabled = $mod_cfg->GetKey('ampoliros-biglogo-disabled');
    } else {
        $amp_logo_disabled = 0;
    }
    $hui = new Hui($gEnv['root']['db'], true);
    $hui->LoadWidget('page');
    $hui->LoadWidget('vertgroup');
    $hui->LoadWidget('button');
    $page_params['title'] = 'Ampoliros';
    $page_params['border'] = 'false';
    if ($redrawFrames) {
        $page_params['javascript'] = "parent.frames.sum.location.reload()\nparent.frames.header.location.reload()";
    }
    $hui_page = new HuiPage('page', $page_params);
    $hui_vertgroup = new HuiVertGroup('vertgroup', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '100%'));
    $hui_buttons_group = new HuiVertGroup('buttons_group', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '0%'));
    if ($amp_logo_disabled != '1') {
        if ($gEnv['core']['edition'] == AMP_EDITION_ASP) {
            $edition = '_asp';
        } else {
            $edition = '_enterprise';
        }
        if (isset($hui_page->mThemeHandler->mStyle['bigdot' . $edition])) {
            $bigdot_image = $hui_page->mThemeHandler->mStyle['bigdot' . $edition];
        } else {
            $bigdot_image = $hui_page->mThemeHandler->mStyle['bigdot'];
        }
        $hui_button = new HuiButton('button', array('action' => 'http://www.ampoliros.com', 'target' => '_top', 'image' => $bigdot_image, 'highlight' => 'false'));
        $hui_buttons_group->AddChild($hui_button);
    }
    if (!$redrawFrames and is_object($gEnv['root']['db']) and !defined('AMPOLIROS_SETUP_PHASE')) {
        // OEM personalization
        //
        $oem_biglogo_filename = $mod_cfg->GetKey('oem-biglogo-filename');
        $oem_url = $mod_cfg->GetKey('oem-url');
        if ($mod_cfg->GetKey('oem-biglogo-disabled') != '1') {
            if (strlen($oem_biglogo_filename) and file_exists(CGI_PATH . $oem_biglogo_filename)) {
                $oem_button = new HuiButton('oembutton', array('action' => strlen($oem_url) ? $oem_url : 'http://www.ampoliros.com', 'target' => '_top', 'image' => CGI_URL . $oem_biglogo_filename, 'highlight' => 'false'));
                $hui_buttons_group->AddChild($oem_button);
            }
        }
    }
    $hui_vertgroup->AddChild($hui_buttons_group);
    $hui_page->AddChild($hui_vertgroup);
    $hui->AddChild($hui_page);
    $hui->Render();
}
Exemplo n.º 3
0
 public static function create(ModuleConfig $ModuleConfigVO)
 {
     //criando variaveis para facilitar a adaptação
     $nomeDaClasse = $ModuleConfigVO->getModuleName();
     $arrayParametrosVO = $ModuleConfigVO->getArrayParamethers();
     $descricaoDaClasse = $ModuleConfigVO->getModuleDescription();
     $aliasModuleName = $ModuleConfigVO->getEntityName();
     $dataAtual = date("d/m/Y", time());
     $temp_stringVars = "";
     $temp_setFetchHandler = "";
     $temp_setFetchArrayHandler = "";
     $temp_sets = "";
     $temp_remove = "";
     $temp_gets = "";
     $temp_validations = "";
     foreach ($arrayParametrosVO as $ParametroVO) {
         if (FALSE) {
             $ParametroVO = new BaseInfoParametherVO($variableName, $variableType, $quantity, $acceptLocale, $defaultValue, $required, $reciveByDefault, $description, $orderInClass);
         }
         $temp_variable_name = $ParametroVO->getVariableName();
         // ----- DECLARANDO VARIAVEIS
         //concatena a declaração das variaveis da VO criada
         $temp_stringVars .= CreateVOClass::createDeclaredVariable($ParametroVO);
         //---------------------------------------------------- criando script de fetchObject
         $temp_setFetchHandler .= "\$this->" . $temp_variable_name . " = DataHandler::getValueByStdObjectIndex(\$object, \"" . $temp_variable_name . "\");\n\t\t\t";
         if ($ParametroVO->getReciveByDefault()) {
             //---------------------------------------------------- criando script de fetchArray
             $temp_setFetchArrayHandler .= "\$this->" . self::getMethodNameToSet($ParametroVO) . "(DataHandler::getValueByArrayIndex(\$array, \"" . $temp_variable_name . "\"));\n\t\t\t";
         }
         //---------------------------------------------------- criando metodos SET e GET
         // AQUI CRIANDO OS SETS
         $temp_sets .= self::createMethodSet($ParametroVO);
         //quando tem mais do que 1, precisa ter o metodo remove
         //AQUI CRIANDO O REMOVE
         if ($ParametroVO->getQuantity() != 1) {
             //se pode mais de um precisa do metodo remove
             $temp_remove .= self::createRemove($ParametroVO);
         }
         //AQUI CRIANDO O METODO GET (lembrando que ainda estamos dentro de um loop)
         //adicionando comentários
         $temp_gets .= self::createMethodGet($ParametroVO);
         //---------------------------------------------------- criando script de validação
         //antes ve se a variavel quer ser validada
         if ($ParametroVO->getRequired()) {
             //diz ser necessário, então faz a validação dependendo do tipo
             $temp_validations .= self::createScriptValidation($ParametroVO);
         }
     }
     $class_esqueleto = "\n\t/**\n\t * @desc\t\t{$descricaoDaClasse}\n\t * @author \t\tautoClass de Renato Miawaki - reytuty@gmail.com\n\t * @date\t\t{$dataAtual}\n\t */\n\tinclude_once 'library/facil3/core/vo/BaseVO.class.php';\n\tclass {$nomeDaClasse}VO extends BaseVO {\n\t\t//private vars cache de parameter ou link\n\t\t{$temp_stringVars}\n\t\tpublic function __construct(\$arrayFetchPost = NULL){\n\t\t\tparent::_construct(\$arrayFetchPost);\n\t\t\t//o default seria ter o __table como content, caso mude, continua gravando na tabela content,\n\t\t\t//mas links e relacionamentos ficam ligadas a esse alias\n\t\t\t\$this->__table = \"{$aliasModuleName}\";\n\t\t\t//se enviar \$arrayFetchPost é para distrinchar internamente os dados do usuario\n\t\t\tif(\$arrayFetchPost !== NULL){\n\t\t\t\t//enviou array para distrinchar\n\t\t\t\t\$this->setFetchArray(\$arrayFetchPost);\n\t\t\t}\n\t\t}//end construct\n\t\t//setFetchObject\n\t\tpublic function setFetchObject(\$object){\n\t\t\t{$temp_setFetchHandler}\n\t\t}\n\t\t//setFetchArray\n\t\tpublic function setFetchArray(\$array){\n\t\t\t{$temp_setFetchArrayHandler}\n\t\t}\n\t\t//metodos sets\n\t\t{$temp_sets}\n\t\t//metodos remove\n\t\t{$temp_remove}\n\t\t//metodos get\n\t\t{$temp_gets}\n\t\t//validation\n\t\tpublic function validate(){\n\t\t\t\$ReturnResultVO = new ReturnResultVO();\n\t\t\t\$ReturnResultVO->success = TRUE;\n\t\t\t{$temp_validations}\n\t\t\treturn \$ReturnResultVO;\n\t\t}\n\t}";
     return $class_esqueleto;
 }
 public function getInputfields()
 {
     $form = parent::getInputfields();
     $f = $this->modules->get('InputfieldMarkup');
     $f->value = '<h2>Email address pre-registration validation<h2>';
     $form->add($f);
     $f = $this->modules->get('InputfieldText');
     $f->attr('name', 'subject');
     $f->label = $this->_('Subject address validation email');
     $f->required = true;
     $form->add($f);
     $f = $this->modules->get('InputfieldTextarea');
     $f->attr('name', 'content');
     $f->label = $this->_('Content address validation email');
     $f->required = true;
     $form->add($f);
     $f = $this->modules->get('InputfieldRadios');
     $f->label = 'Type of email:';
     $f->value = '1';
     $f->addOption('0', 'Text');
     $f->addOption('1', 'HTML');
     $f->attr('name', 'emailType');
     $form->add($f);
     return $form;
 }
 /**
  * Removes the value object from the storage.
  *
  * @return void
  * @since 5.1
  */
 public function delete($id = false)
 {
     $id = $id != false ? $id : $this->valueObject->getValue($this->config->getIdField());
     if (!$id) {
         return;
     }
     $dar = $this->update('DELETE FROM ' . $this->config->getTable() . ' WHERE ' . $this->config->getIdField() . '=' . $id);
 }
Exemplo n.º 6
0
 /**
  * Set module configuration variable, creating it if required
  *
  * @param  int             $moduleId          the module id
  * @param  string          $variableName      the variable name
  * @param  string          $variableValue     the variable value
  * @param  null            $valueLocale       the locale, or null if not required
  * @param  bool            $createIfNotExists if true, the variable will be created if not already defined
  * @throws \LogicException if variable does not exists and $createIfNotExists is false
  * @return $this;
  */
 public function setConfigValue($moduleId, $variableName, $variableValue, $valueLocale = null, $createIfNotExists = true)
 {
     $configValue = self::create()->filterByModuleId($moduleId)->filterByName($variableName)->findOne();
     if (null === $configValue) {
         if (true === $createIfNotExists) {
             $configValue = new ModuleConfig();
             $configValue->setModuleId($moduleId)->setName($variableName);
         } else {
             throw new \LogicException("Module configuration variable {$variableName} does not exists. Create it first.");
         }
     }
     if (null !== $valueLocale) {
         $configValue->setLocale($valueLocale);
     }
     $configValue->setValue($variableValue)->save();
     return $this;
 }
Exemplo n.º 7
0
function sum_page()
{
    global $gEnv;
    $amp_locale = new Locale('amp_root_menu', AMP_LANG);
    import('com.solarix.ampoliros.module.ModuleConfig');
    $mod_cfg = new ModuleConfig($gEnv['root']['db'], 'ampoliros');
    $hui = new Hui($gEnv['root']['db'], TRUE);
    $hui->LoadWidget('table');
    $hui->LoadWidget('page');
    $hui->LoadWidget('vertgroup');
    $hui->LoadWidget('vertframe');
    $hui->LoadWidget('treemenu');
    $hui_page = new HuiPage('page', array('title' => 'Ampoliros' . (strlen(AMP_HOST) ? ' - ' . AMP_HOST . (strlen(AMP_DOMAIN) ? '.' . AMP_DOMAIN : '') : ''), 'border' => 'false'));
    $hui_page->mArgs['background'] = $hui_page->mThemeHandler->mStyle['menuback'];
    $hui_mainvertgroup = new HuiVertGroup('mainvertgroup');
    $el[1]['groupname'] = 'Ampoliros';
    $cont = 1;
    $query =& $gEnv['root']['db']->Execute('SELECT id FROM sites');
    if ($query->NumRows()) {
        $el[1]['groupelements'][$cont]['name'] = $amp_locale->GetStr('siteadmin');
        $el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['siteaccess'];
        $el[1]['groupelements'][$cont]['action'] = 'admin/';
        $el[1]['groupelements'][$cont]['themesized'] = 'true';
        $cont++;
    }
    $el[1]['groupelements'][$cont]['name'] = $amp_locale->GetStr('rootadmin');
    $el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['rootaccess'];
    $el[1]['groupelements'][$cont]['action'] = 'root/';
    $el[1]['groupelements'][$cont]['themesized'] = 'true';
    if ($mod_cfg->GetKey('ampoliros-link-disabled') != '1') {
        $el[1]['groupelements'][++$cont]['name'] = $amp_locale->GetStr('amphome');
        $el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['ampminilogo'];
        $el[1]['groupelements'][$cont]['action'] = 'http://www.ampoliros.com/';
        $el[1]['groupelements'][$cont]['target'] = 'op';
        $el[1]['groupelements'][$cont]['themesized'] = 'true';
    }
    if ($mod_cfg->GetKey('solarix-link-disabled') != '1') {
        $el[1]['groupelements'][++$cont]['name'] = $amp_locale->GetStr('solarixhome');
        $el[1]['groupelements'][$cont]['image'] = $hui_page->mThemeHandler->mStyle['solarixminilogo'];
        $el[1]['groupelements'][$cont]['action'] = 'http://www.solarix.biz/';
        $el[1]['groupelements'][$cont]['target'] = 'op';
        $el[1]['groupelements'][$cont]['themesized'] = 'true';
    }
    if ($mod_cfg->GetKey('oem-link-disabled') != '1') {
        $oem_link_filename = $mod_cfg->GetKey('oem-link-filename');
        if (strlen($oem_link_filename) and file_exists(CGI_PATH . $oem_link_filename)) {
            $el[1]['groupelements'][++$cont]['name'] = $mod_cfg->GetKey('oem-name');
            $el[1]['groupelements'][$cont]['image'] = CGI_URL . $oem_link_filename;
            $el[1]['groupelements'][$cont]['action'] = $mod_cfg->GetKey('oem-url');
            $el[1]['groupelements'][$cont]['target'] = 'parent';
            $el[1]['groupelements'][$cont]['themesized'] = 'false';
        }
    }
    $hui_vertframe = new HuiVertFrame('vertframe');
    $hui_vertframe->AddChild(new HuiTreeMenu('treemenu', array('elements' => $el, 'width' => '120', 'target' => 'parent', 'allgroupsactive' => 'true')));
    $hui_mainvertgroup->AddChild($hui_vertframe);
    $hui_page->AddChild($hui_mainvertgroup);
    $hui->AddChild($hui_page);
    $hui->Render();
}
Exemplo n.º 8
0
function main_default($eventData)
{
    global $env, $gYaps_locale, $gTitle, $gPage_content;
    $mod_settings = new ModuleConfig($env['ampdb'], 'yaps');
    $gs_exec = $mod_settings->GetKey('gs_exec');
    if (!strlen($gs_exec)) {
        $gs_exec = '/usr/bin/gs';
    }
    $xml_def = '<vertgroup><name>prefs</name><children>
  <form><name>settings</name><args><action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', ''), array('action', 'setsettings', '')))) . '</action></args><children>
    <grid><name>settingsgrid</name><children>
      <label row="0" col="0"><name>gsexec</name><args><label>' . $gYaps_locale->GetStr('gsexec_label') . '</label></args></label>
      <string row="0" col="1"><name>gsexec</name><args><disp>action</disp><value type="encoded">' . urlencode($gs_exec) . '</value><size>20</size></args></string>
    </children></grid>
    <submit><name>submit</name><args><caption>' . $gYaps_locale->GetStr('savesettings_submit') . '</caption></args></submit>
  </children></form>
</children></vertgroup>';
    $gPage_content = new HuiXml('page', array('definition' => $xml_def));
    $gTitle = $gYaps_locale->GetStr('yaps_title');
}
 public function getInputfields()
 {
     $inputfields = parent::getInputfields();
     $f = $this->modules->get('InputfieldText');
     $f->attr('name', 'selector');
     $f->label = 'Selector';
     $f->description = 'This is the JQuery Selector to find the fields where the unselect button should be shown';
     $f->notes = 'Default: ' . $this->selector;
     $f->required = true;
     $inputfields->add($f);
     return $inputfields;
 }
 public function getInputfields()
 {
     $inputfields = parent::getInputfields();
     $f = $this->modules->get('InputfieldInteger');
     $f->attr('name', 'height');
     $f->label = 'Thumbnail height';
     $f->notes = 'Leave one field blank to keep aspect ratio';
     $f->columnWidth = '50%';
     $inputfields->add($f);
     $f = $this->modules->get('InputfieldInteger');
     $f->attr('name', 'width');
     $f->label = 'Thumbnail width';
     $f->notes = 'Leave one field blank to keep aspect ratio';
     $f->columnWidth = '50%';
     $inputfields->add($f);
     return $inputfields;
 }
Exemplo n.º 11
0
require './auth.php';
import('com.solarix.ampoliros.locale.Locale');
import('com.solarix.ampoliros.hui.Hui');
import('com.solarix.ampoliros.module.Module');
$hui = new Hui($gEnv['root']['db']);
$hui->LoadWidget('button');
$hui->LoadWidget('grid');
$hui->LoadWidget('horizframe');
$hui->LoadWidget('horizgroup');
$hui->LoadWidget('image');
$hui->LoadWidget('label');
$hui->LoadWidget('link');
$hui->LoadWidget('page');
$hui->LoadWidget('vertframe');
$hui->LoadWidget('vertgroup');
$mod_cfg = new ModuleConfig($env['ampdb'], 'ampoliros');
$hui_page = new HuiPage('page', array('title' => 'Ampoliros', 'border' => 'false'));
$hui_vertgroup = new HuiVertGroup('vertgroup', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '100%'));
$hui_buttons_group = new HuiVertGroup('buttons_group', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '0%'));
if ($mod_cfg->GetKey('ampoliros-biglogo-disabled') != '1') {
    if ($gEnv['core']['edition'] == AMP_EDITION_ASP) {
        $edition = '_asp';
    } else {
        $edition = '_enterprise';
    }
    if (isset($hui_page->mThemeHandler->mStyle['bigdot' . $edition])) {
        $bigdot_image = $hui_page->mThemeHandler->mStyle['bigdot' . $edition];
    } else {
        $bigdot_image = $hui_page->mThemeHandler->mStyle['bigdot'];
    }
    $hui_button = new HuiButton('button', array('action' => 'http://www.ampoliros.com', 'target' => '_top', 'image' => $bigdot_image, 'highlight' => 'false'));
 /**
  * Configure notifications
  *
  * @return InputfieldWrapper
  *
  */
 public function getInputfields()
 {
     $form = parent::getInputfields();
     $modules = $this->wire('modules');
     $on = $this->_('On');
     $off = $this->_('Off');
     $f = $modules->get('InputfieldRadios');
     $f->attr('name', 'disabled');
     $f->label = __('Notifications status');
     $f->description = __('When turned off, notifications will not be rendered.');
     $f->addOption(0, $on);
     $f->addOption(1, $off);
     $f->optionColumns = 1;
     $f->columnWidth = 33;
     $form->add($f);
     $f = $modules->get('InputfieldRadios');
     $f->attr('name', 'trackEdits');
     $f->label = __('Track page edits?');
     $f->description = __('Notifies users when they try to edit a page that is already being edited.');
     $f->addOption(1, $on);
     $f->addOption(0, $off);
     $f->optionColumns = 1;
     $f->columnWidth = 34;
     $form->add($f);
     $f = $modules->get('InputfieldRadios');
     $f->attr('name', 'reverse');
     $f->label = __('Notification order');
     $f->description = __('Select what order the notifications should display in.');
     $f->addOption(0, __('Newest to oldest'));
     $f->addOption(1, __('Oldest to newest'));
     $f->optionColumns = 1;
     $f->columnWidth = 33;
     $form->add($f);
     $f = $modules->get('InputfieldCheckboxes');
     $f->attr('name', 'activeHooks');
     $f->label = __('Active automatic notification hooks');
     $f->description = __('Whenever one of these events occurs, the system user above will be notified.');
     $f->addOption(0, __('404 page not found'));
     $f->addOption(1, __('User login success and failure'));
     $f->addOption(2, __('User logout'));
     $f->notes = __('These are primarily just examples of notifications for the purpose of demonstration.');
     $f->columnWidth = 50;
     $form->add($f);
     $f = $modules->get('InputfieldName');
     $f->attr('name', 'systemUserName');
     $f->label = __('Name of user that receives system notifications');
     $f->columnWidth = 50;
     $form->add($f);
     $f = $modules->get('InputfieldInteger');
     $f->attr('name', 'updateDelay');
     $f->label = __('Time between updates');
     $f->description = __('How often to check for notification updates (in milliseconds). Example: 5000 means 5 seconds.');
     $f->columnWidth = 50;
     $form->add($f);
     $f = $modules->get('InputfieldText');
     $f->attr('name', 'dateFormat');
     $f->label = __('Date format');
     $f->description = __('Date format used for notifications. Use date() or strftime() format, or "relative" for relative date/time, "rel" for abbreviated date/time.');
     $f->columnWidth = 50;
     $form->add($f);
     $f = $modules->get('InputfieldIcon');
     $f->attr('name', 'iconMessage');
     $f->label = __('Message icon');
     $f->prefixValue = false;
     $form->add($f);
     $f = $modules->get('InputfieldIcon');
     $f->attr('name', 'iconWarning');
     $f->label = __('Warning icon');
     $f->prefixValue = false;
     $form->add($f);
     $f = $modules->get('InputfieldIcon');
     $f->attr('name', 'iconError');
     $f->label = __('Error icon');
     $f->prefixValue = false;
     $form->add($f);
     $f = $modules->get('InputfieldInteger');
     $f->attr('name', 'ghostDelay');
     $f->label = __('Ghost delay');
     $f->description = __('How long ghost messages appear for (in ms).');
     $f->columnWidth = 25;
     $form->add($f);
     $f = $modules->get('InputfieldInteger');
     $f->attr('name', 'ghostDelayError');
     $f->label = __('Ghost error delay');
     $f->description = __('How long ghost errors appear for (in ms).');
     $f->columnWidth = 25;
     $form->add($f);
     $f = $modules->get('InputfieldFloat');
     $f->attr('name', 'ghostOpacity');
     $f->label = __('Ghost full opacity');
     $f->description = __('Full opacity of ghosts (0.1-1.0)');
     $f->columnWidth = 25;
     $form->add($f);
     $f = $modules->get('InputfieldFloat');
     $f->attr('name', 'ghostLimit');
     $f->label = __('Ghost Limit');
     $f->description = __('Show summary ghost if more this.');
     $f->columnWidth = 25;
     $form->add($f);
     $f = $modules->get('InputfieldRadios');
     $f->attr('name', 'ghostFadeSpeed');
     $f->label = __('Ghost fade speed');
     $f->description = __('Speed at which ghosts fade in or out.');
     $f->addOption('', __('Immediate (no fade in/out)'));
     $f->addOption('fast', __('Fast'));
     $f->addOption('normal', __('Normal'));
     $f->addOption('slow', __('Slow'));
     $f->columnWidth = 50;
     $form->add($f);
     $f = $modules->get('InputfieldRadios');
     $f->attr('name', 'ghostPos');
     $f->label = __('Ghost position');
     $f->description = __('What side of the screen ghosts should float on.');
     $f->addOption(self::ghostPosLeft, $this->_('Left'));
     $f->addOption(self::ghostPosRight, $this->_('Right'));
     $f->columnWidth = 50;
     $form->add($f);
     $f = $modules->get('InputfieldRadios');
     $f->attr('name', 'placement');
     $f->label = __('Runtime/single-request notices');
     $f->addOption(self::placementCombined, __('Display as notifications'));
     $f->addOption(self::placementSeparate, __('Leave them alone'));
     $f->columnWidth = 50;
     $form->add($f);
     include_once dirname(__FILE__) . "/Notification.php";
     $this->message('Example runtime message notification');
     $this->message('Example debug message notification', Notification::flagDebug);
     $this->warning('Example runtime warning notification');
     $this->warning('Example debug warning notification', Notification::flagDebug);
     $this->error('Example runtime error notification');
     $this->error('Example debug error notification', Notification::flagDebug);
     return $form;
 }
Exemplo n.º 13
0
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
// $Id: auth.php,v 1.11 2004-07-08 15:04:26 alex Exp $
if (!defined('BASE_AUTH_PHP')) {
    define('BASE_AUTH_PHP', true);
    require 'ampoliros.php';
    $amp = Ampoliros::instance('Ampoliros');
    $amp->setInterface(Ampoliros::INTERFACE_WEB);
    $amp->startRoot();
    if (!defined('AMPOLIROS_SETUP_PHASE')) {
        import('com.solarix.ampoliros.module.ModuleConfig');
        $mod_cfg = new ModuleConfig($gEnv['root']['db'], 'ampoliros');
        if (strlen($mod_cfg->GetKey('hui-root-theme'))) {
            $gEnv['hui']['theme']['name'] = $mod_cfg->GetKey('hui-root-theme');
        }
        unset($mod_cfg);
    }
    import('com.solarix.ampoliros.hui.theme.HuiTheme');
}
Exemplo n.º 14
0
 public function getConfig()
 {
     // Use a static config,
     // so we can easily overwrite it in tests.
     return ModuleConfig::getConfig();
 }
Exemplo n.º 15
0
 public function startSite($siteId, $userId = '')
 {
     $result = false;
     $this->setMode(Ampoliros::MODE_SITE);
     global $env;
     if (isset($GLOBALS['gEnv']['runtime']['site']['init']) and $GLOBALS['gEnv']['runtime']['site']['init'] == true) {
         return;
     }
     // Site id
     //
     $GLOBALS['gEnv']['site']['id'] = $siteId;
     $env['currentsite'] =& $GLOBALS['gEnv']['site']['id'];
     $env['currentsiteid'] =& $env['currentsite'];
     // Site data
     //
     $sitesquery = $GLOBALS['gEnv']['root']['db']->Execute('SELECT * FROM sites WHERE siteid=' . $GLOBALS['gEnv']['root']['db']->Format_Text($siteId));
     if ($sitesquery->NumRows()) {
         $GLOBALS['gEnv']['site']['data'] = $sitesquery->Fields();
         $env['sitedata'] =& $GLOBALS['gEnv']['site']['data'];
         $sitesquery->Free();
         // Check if site is active
         //
         if ($this->getInterface() != Ampoliros::INTERFACE_WEB and $GLOBALS['gEnv']['site']['data']['siteactive'] == $GLOBALS['gEnv']['root']['db']->fmtfalse) {
             $this->abort('Site disabled');
         }
         // Site log
         //
         define('SITE_LOG', SITESTUFF_PATH . $GLOBALS['gEnv']['site']['data']['siteid'] . '/log/site.log');
         $GLOBALS['gEnv']['site']['log'] = SITE_LOG;
         // Current site serial number
         //
         $GLOBALS['gEnv']['site']['serial'] = $GLOBALS['gEnv']['site']['data']['id'];
         $env['currentsiteserial'] = $GLOBALS['gEnv']['site']['serial'];
         // Site database
         //
         $dbargs['dbtype'] = $GLOBALS['gEnv']['site']['data']['sitedbtype'];
         $dbargs['dbname'] = $GLOBALS['gEnv']['site']['data']['sitedbname'];
         $dbargs['dbhost'] = $GLOBALS['gEnv']['site']['data']['sitedbhost'];
         $dbargs['dbport'] = $GLOBALS['gEnv']['site']['data']['sitedbport'];
         $dbargs['dbuser'] = $GLOBALS['gEnv']['site']['data']['sitedbuser'];
         $dbargs['dbpass'] = $GLOBALS['gEnv']['site']['data']['sitedbpassword'];
         $dbargs['dblog'] = $GLOBALS['gEnv']['site']['data']['sitedblog'];
         $GLOBALS['gEnv']['site']['dblog'] =& $GLOBALS['gEnv']['site']['data']['sitedblog'];
         $db_fact = new DBLayerFactory();
         $GLOBALS['gEnv']['site']['db'] = $db_fact->NewDBLayer($dbargs);
         $env['db'] = $GLOBALS['gEnv']['site']['db'];
         if (!$GLOBALS['gEnv']['site']['db']->Connect($dbargs)) {
             if (!defined('MISC_LIBRARY')) {
                 include LIBRARY_PATH . 'misc.library';
             }
             $adloc = new Locale('amp_misc_auth', $GLOBALS['gEnv']['root']['locale']['language']);
             AmpDie($adloc->GetStr('nodb'));
         }
         // Hui theme
         //
         $tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text('sitetheme'));
         $GLOBALS['gEnv']['site']['theme'] = $tmpquery->Fields('val');
         // Site cgi
         //
         if (strlen($GLOBALS['gEnv']['site']['data']['siteurl'])) {
             $tmp = parse_url($GLOBALS['gEnv']['site']['data']['siteurl']);
             $GLOBALS['gEnv']['site']['cgi'] = $tmp['scheme'] . '://' . $tmp['host'] . CGI_URL;
         } else {
             $GLOBALS['gEnv']['site']['cgi'] = CGI_URL;
         }
         $env['sitecgi'] =& $GLOBALS['gEnv']['site']['cgi'];
         unset($tmp);
         // Site country
         //
         $tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text('sitecountry'));
         $GLOBALS['gEnv']['site']['locale']['country'] = strlen($tmpquery->Fields('val')) ? $tmpquery->Fields('val') : AMP_COUNTRY;
         $env['sitecountry'] = $GLOBALS['gEnv']['site']['locale']['country'];
         // Site language
         //
         $tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text('sitelanguage'));
         $GLOBALS['gEnv']['site']['locale']['language'] = strlen($tmpquery->Fields('val')) ? $tmpquery->Fields('val') : AMP_LANG;
         $env['sitelanguage'] = $GLOBALS['gEnv']['site']['locale']['language'];
         // User
         //
         if (!strlen($userId)) {
             $userId = $siteId;
         }
         // User id
         //
         $GLOBALS['gEnv']['user']['id'] = $userId;
         $env['currentuser'] =& $GLOBALS['gEnv']['user']['id'];
         // Hui theme
         //
         $tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val ' . 'FROM sitesettings ' . 'WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text($GLOBALS['gEnv']['user']['id'] . '-theme'));
         $GLOBALS['gEnv']['user']['theme'] = $tmpquery->Fields('val');
         if (!strlen($GLOBALS['gEnv']['user']['theme'])) {
             if (!strlen($GLOBALS['gEnv']['site']['theme'])) {
                 import('com.solarix.ampoliros.module.ModuleConfig');
                 $mod_cfg = new ModuleConfig($GLOBALS['gEnv']['root']['db'], 'ampoliros');
                 if (strlen($mod_cfg->GetKey('hui-root-theme'))) {
                     $GLOBALS['gEnv']['site']['theme'] = $mod_cfg->GetKey('hui-root-theme');
                     if (!strlen($GLOBALS['gEnv']['site']['theme'])) {
                         $GLOBALS['gEnv']['site']['theme'] = $GLOBALS['gEnv']['hui']['theme']['default'];
                     }
                 } else {
                     $GLOBALS['gEnv']['site']['theme'] = $GLOBALS['gEnv']['hui']['theme']['default'];
                 }
                 unset($mod_cfg);
             }
             $GLOBALS['gEnv']['user']['theme'] = $GLOBALS['gEnv']['site']['theme'];
         }
         $GLOBALS['gEnv']['hui']['theme']['name'] = $GLOBALS['gEnv']['user']['theme'];
         // User country
         //
         $tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val FROM sitesettings WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text($GLOBALS['gEnv']['user']['id'] . '-country'));
         $GLOBALS['gEnv']['user']['locale']['country'] = $env[$GLOBALS['gEnv']['user']['id'] . '-country'] = strlen($tmpquery->Fields('val')) ? $tmpquery->Fields('val') : $GLOBALS['gEnv']['site']['locale']['country'];
         $env['currentuser-country'] = $GLOBALS['gEnv']['user']['locale']['country'];
         // User language
         //
         $tmpquery = $GLOBALS['gEnv']['site']['db']->Execute('SELECT val FROM sitesettings WHERE keyname=' . $GLOBALS['gEnv']['site']['db']->Format_Text($GLOBALS['gEnv']['user']['id'] . '-language'));
         $GLOBALS['gEnv']['user']['locale']['language'] = $env[$GLOBALS['gEnv']['user']['id'] . '-language'] = strlen($tmpquery->Fields('val')) ? $tmpquery->Fields('val') : $GLOBALS['gEnv']['site']['locale']['language'];
         $env['currentuser-language'] = $GLOBALS['gEnv']['user']['locale']['language'];
         $env['sitelocale'] = $GLOBALS['gEnv']['user']['locale']['language'];
         // Old one
         $tmpquery = $GLOBALS['gEnv']['root']['db']->Execute('SELECT id,fname,lname,email,groupid FROM users WHERE username='******'gEnv']['root']['db']->Format_Text($GLOBALS['gEnv']['user']['id']));
         // User datas
         //
         $GLOBALS['gEnv']['user']['group'] = $tmpquery->Fields('groupid');
         $GLOBALS['gEnv']['user']['serial'] = $tmpquery->Fields('id');
         $GLOBALS['gEnv']['user']['data']['lname'] = $tmpquery->Fields('lname');
         $GLOBALS['gEnv']['user']['data']['fname'] = $tmpquery->Fields('fname');
         $GLOBALS['gEnv']['user']['data']['email'] = $tmpquery->Fields('email');
         $env['currentusercname'] = $tmpquery->Fields('fname') . ' ' . $tmpquery->Fields('lname');
         $env['currentgroupserial'] = $GLOBALS['gEnv']['user']['group'];
         $env['currentuserserial'] = $GLOBALS['gEnv']['user']['serial'];
         $tmpquery->Free();
         $result = true;
     }
     $GLOBALS['gEnv']['runtime']['site']['init'] = true;
     return $result;
 }
Exemplo n.º 16
0
 /**
  * Get the Inputfields that configure the given module or return null if not configurable
  * 
  * @param string|Module|int $moduleName
  * @param InputfieldWrapper|null $form Optionally specify the form you want Inputfields appended to.
  * @return InputfieldWrapper|null
  * 
  */
 public function ___getModuleConfigInputfields($moduleName, InputfieldWrapper $form = null)
 {
     $moduleName = $this->getModuleClass($moduleName);
     $configurable = $this->isConfigurableModule($moduleName);
     if (!$configurable) {
         return null;
     }
     if (is_null($form)) {
         $form = new InputfieldWrapper();
     }
     $data = $this->modules->getModuleConfigData($moduleName);
     // check for configurable module interface
     $configurableInterface = $this->isConfigurableModule($moduleName, "interface");
     if ($configurableInterface) {
         if (is_int($configurableInterface) && $configurableInterface > 1 && $configurableInterface < 20) {
             // non-static
             /** @var ConfigurableModule $module */
             $module = $this->getModule($moduleName);
             if ($configurableInterface === 2) {
                 // requires no arguments
                 $fields = $module->getModuleConfigInputfields();
             } else {
                 if ($configurableInterface === 3) {
                     // requires $data array
                     $fields = $module->getModuleConfigInputfields($data);
                 } else {
                     if ($configurableInterface === 4) {
                         // requires InputfieldWrapper
                         // we allow for option of no return statement in the method
                         $fields = new InputfieldWrapper();
                         $_fields = $module->getModuleConfigInputfields($fields);
                         if ($_fields instanceof InputfieldWrapper) {
                             $fields = $_fields;
                         }
                         unset($_fields);
                     } else {
                         if ($configurableInterface === 19) {
                             // non-static getModuleConfigArray method
                             $fields = new InputfieldWrapper();
                             $fields->importArray($module->getModuleConfigArray());
                             $fields->populateValues($module);
                         }
                     }
                 }
             }
         } else {
             if ($configurableInterface === 20) {
                 // static getModuleConfigArray method
                 $fields = new InputfieldWrapper();
                 $fields->importArray(call_user_func(array($moduleName, 'getModuleConfigArray')));
                 $fields->populateValues($data);
             } else {
                 if ($configurableInterface) {
                     // static getModuleConfigInputfields method
                     $fields = call_user_func(array($moduleName, 'getModuleConfigInputfields'), $data);
                 }
             }
         }
         if ($fields instanceof InputfieldWrapper) {
             foreach ($fields as $field) {
                 $form->append($field);
             }
         } else {
             if ($fields instanceof Inputfield) {
                 $form->append($fields);
             } else {
                 $this->error("{$moduleName}.getModuleConfigInputfields() did not return InputfieldWrapper");
             }
         }
     }
     // check for file-based config
     $file = $this->isConfigurableModule($moduleName, "file");
     if (!$file || !is_string($file) || !is_file($file)) {
         return $form;
     }
     $config = null;
     include_once $file;
     $configClass = $moduleName . "Config";
     $configModule = null;
     if (class_exists($configClass)) {
         // file contains a ModuleNameConfig class
         $configModule = new $configClass();
     } else {
         if (is_null($config)) {
             include $file;
         }
         // in case of previous include_once
         if (is_array($config)) {
             // file contains a $config array
             $configModule = new ModuleConfig();
             $configModule->add($config);
         }
     }
     if ($configModule && $configModule instanceof ModuleConfig) {
         $defaults = $configModule->getDefaults();
         $data = array_merge($defaults, $data);
         $configModule->setArray($data);
         $fields = $configModule->getInputfields();
         if ($fields instanceof InputfieldWrapper) {
             foreach ($fields as $field) {
                 $form->append($field);
             }
             foreach ($data as $key => $value) {
                 $f = $form->getChildByName($key);
                 if ($f) {
                     $f->attr('value', $value);
                 }
             }
         } else {
             $this->error("{$configModule}.getInputfields() did not return InputfieldWrapper");
         }
     }
     return $form;
 }
Exemplo n.º 17
0
 /**
  * Return all forward configurations for this Action.
  *
  * If there are none, a zero-length array is returned.
  *
  * @return array
  */
 public function findForwardConfigs()
 {
     $temps = array_merge($this->moduleConfig->findForwardConfigs(), $this->forwards);
     return array_values($temps);
 }
 /**
  * Retrieves the list of config input fields
  * Implementation of the ConfigurableModule interface
  *
  * @return InputfieldWrapper
  */
 public function getInputfields()
 {
     $formfields = $this->data['formfields'];
     $unsubscribe = $this->data['unsubscribe'];
     $notifyAdmin = $this->data['notifyAdmin'];
     $noCompare = $this->data['noCompare'];
     $inputfields = parent::getInputfields();
     // select fields
     $field = $this->modules->get('InputfieldAsmSelect');
     $field->description = __('Add all fields which should be attached to the subscription form.') . PHP_EOL . __('You have to add all needed fields to the user template first¹.');
     $field->addOption('', '');
     $field->label = __('Select form fields for subscription');
     $field->attr('name', 'formfields');
     $field->required = true;
     $field->columnWidth = 50;
     foreach (wire('templates')->get('user')->fields as $f) {
         $field->addOption($f->name, $f->name);
     }
     $inputfields->add($field);
     // select name fields
     $field = $this->modules->get('InputfieldAsmSelect');
     $field->description = __('Add the fields which should be used as username.') . PHP_EOL . __('Please save the chosen form fields first to get a list to select from.');
     $field->label = __('Select name fields');
     $field->attr('name', 'namefields');
     $field->columnWidth = 50;
     if (is_array($formfields)) {
         foreach ($formfields as $formfield) {
             $f = wire('fields')->get($formfield);
             $field->addOption($f->name, $f->name);
         }
     }
     $inputfields->add($field);
     // help - how to add fields to the user template
     $help = $this->modules->get('InputfieldMarkup');
     $helpLink = 'https://processwire.com/talk/topic/1156-custom-user-fields/?p=10161';
     $helpContent = '<p><a  target="_blank" href="' . $helpLink . '"><sup>1</sup> How to add fields to the user template?</a></p>';
     $help->value = $helpContent;
     $inputfields->add($help);
     // unsubscribe field
     $field = $this->modules->get('InputfieldCheckbox');
     $field->name = 'unsubscribe';
     $field->label = 'Unsubscribe option';
     $field->description = __('Should the form contain an unsubscribe option?');
     $field->value = 1;
     $field->attr('checked', $unsubscribe ? 'checked' : '');
     $field->columnWidth = 25;
     $inputfields->add($field);
     // noCompare field
     $field = $this->modules->get('InputfieldCheckbox');
     $field->name = 'noCompare';
     $field->label = 'Do not compare E-Mail-Addresses';
     $field->description = __('Do not check whether an E-Mail-Address already exists.');
     $field->value = 1;
     $field->attr('checked', $noCompare ? 'checked' : '');
     $field->columnWidth = 25;
     $inputfields->add($field);
     // mailserver field
     $field = $this->modules->get('InputfieldText');
     $field->name = 'mailfrom';
     $field->label = __('E-Mail From Address');
     $field->description = __('Sender Address');
     $field->columnWidth = 25;
     $inputfields->add($field);
     // periodOfValidity field
     $field = $this->modules->get('InputfieldInteger');
     $field->name = 'periodOfValidity';
     $field->label = __('Period of Validity');
     $field->description = __('Number of days confirmation links are valid.');
     $field->columnWidth = 25;
     $inputfields->add($field);
     // new fieldset containing messages
     $fieldset = $this->modules->get('InputfieldFieldset');
     $fieldset->label = $this->_('E-Mail Messages');
     $fieldset->collapsed = Inputfield::collapsedYes;
     $fieldset->icon = 'send';
     $field = $this->modules->get('InputfieldTextarea');
     $field->name = 'messageSubscribe';
     $field->label = __('Subscribe E-Mail Message');
     $field->description = __('Use %fieldName% as placeholder, for example %email%');
     $field->rows = 8;
     $field->columnWidth = 50;
     $fieldset->add($field);
     $field = $this->modules->get('InputfieldTextarea');
     $field->name = 'messageUnsubscribe';
     $field->label = __('Unsubscribe E-Mail Message');
     $field->description = __('Use %fieldName% as placeholder, for example %email%');
     $field->rows = 8;
     $field->columnWidth = 50;
     $fieldset->add($field);
     $inputfields->add($fieldset);
     // new fieldset containing admin notification
     $fieldset = $this->modules->get('InputfieldFieldset');
     $fieldset->label = $this->_('Notify Admin');
     $fieldset->collapsed = Inputfield::collapsedYes;
     $fieldset->icon = 'comment';
     // notify admin field
     $field = $this->modules->get('InputfieldCheckbox');
     $field->name = 'notifyAdmin';
     $field->label = 'Notify Admin';
     $field->description = __('Should the admin be notified by email?');
     $field->value = 1;
     $field->columnWidth = 50;
     $field->attr('checked', $notifyAdmin ? 'checked' : '');
     $fieldset->add($field);
     // notify admin - mailto field
     $field = $this->modules->get('InputfieldText');
     $field->name = 'notifyAdminMailto';
     $field->label = __('Admin Notification E-Mail');
     $field->description = __('Mailto Address');
     $field->columnWidth = 50;
     $field->showIf = "notifyAdmin=1";
     $fieldset->add($field);
     // notify admin - subscribtion - mailserver field
     $field = $this->modules->get('InputfieldText');
     $field->name = 'notifyAdminSubscribeMailfrom';
     $field->label = __('Subscription - E-Mail From Address');
     $field->description = __('Sender Address');
     $field->columnWidth = 50;
     $field->showIf = "notifyAdmin=1";
     $fieldset->add($field);
     // notify admin - unsubscribtion - mailserver field
     $field = $this->modules->get('InputfieldText');
     $field->name = 'notifyAdminUnsubscribeMailfrom';
     $field->label = __('Unsubscription - E-Mail From Address');
     $field->description = __('Sender Address');
     $field->columnWidth = 50;
     $field->showIf = "notifyAdmin=1";
     $fieldset->add($field);
     // notify admin - subscription - message field
     $field = $this->modules->get('InputfieldTextarea');
     $field->name = 'notifyAdminMessageSubscribe';
     $field->label = __('Subscribe E-Mail Message');
     $field->description = __('Use %fieldName% as placeholder, for example %email%');
     $field->rows = 8;
     $field->columnWidth = 50;
     $field->showIf = "notifyAdmin=1";
     $fieldset->add($field);
     // notify admin - unsubscription - message field
     $field = $this->modules->get('InputfieldTextarea');
     $field->name = 'notifyAdminMessageUnsubscribe';
     $field->label = __('Unsubscribe E-Mail Message');
     $field->description = __('Use %fieldName% as placeholder, for example %email%');
     $field->rows = 8;
     $field->columnWidth = 50;
     $field->showIf = "notifyAdmin=1";
     $fieldset->add($field);
     $inputfields->add($fieldset);
     return $inputfields;
 }
Exemplo n.º 19
0
function main_default($eventData)
{
    global $env, $hui_mainframe, $hui_titlebar, $amp_locale, $pass_disp, $hui_mainstatus;
    $mod_cfg = new ModuleConfig($env['ampdb'], 'ampoliros');
    // OEM
    //
    $oem_frame = new HuiVertFrame('oemframe');
    $oem_vgroup = new HuiVertGroup('oemvgroup', array('width' => '100%'));
    $oem_vgroup->AddChild(new HuiLabel('oemlabel', array('label' => $amp_locale->GetStr('oemframe_label'), 'bold' => 'true')));
    $oem_grid = new HuiGrid('oemgrid', array('rows' => '4', 'cols' => '2'));
    // OEM name
    //
    $oem_grid->AddChild(new HuiLabel('oemname_label', array('label' => $amp_locale->GetStr('oemname_label'))), 0, 0);
    $oem_grid->AddChild(new HuiString('oemname', array('disp' => 'pass', 'size' => '30', 'value' => $mod_cfg->GetKey('oem-name'))), 0, 1);
    // OEM url
    //
    $oem_grid->AddChild(new HuiLabel('oemurl_label', array('label' => $amp_locale->GetStr('oemurl_label'))), 1, 0);
    $oem_grid->AddChild(new HuiString('oemurl', array('disp' => 'pass', 'size' => '30', 'value' => $mod_cfg->GetKey('oem-url'))), 1, 1);
    // OEM big logo
    //
    $oem_grid->AddChild(new HuiLabel('oembiglogo_label', array('label' => $amp_locale->GetStr('oembiglogo_label'))), 2, 0);
    $oem_grid->AddChild(new HuiFile('oembiglogo', array('disp' => 'pass')), 2, 1);
    // OEM link logo
    //
    $oem_grid->AddChild(new HuiLabel('oemlogo_label', array('label' => $amp_locale->GetStr('oemlogo_label'))), 3, 0);
    $oem_grid->AddChild(new HuiFile('oemlinklogo', array('disp' => 'pass')), 3, 1);
    $oem_vgroup->AddChild($oem_grid);
    $oem_vgroup->AddChild(new HuiSubmit('oemsubmit', array('caption' => $amp_locale->GetStr('oem_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'setoem', ''));
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $oem_form = new HuiForm('setoemform', array('action' => $form_events_call->GetEventsCallString()));
    $oem_form->AddChild($oem_vgroup);
    // Enabled icons
    //
    $enable_vgroup = new HuiVertGroup('enablevgroup', array('width' => '100%'));
    $enable_vgroup->AddChild(new HuiLabel('enablelabel', array('label' => $amp_locale->GetStr('enabled_icons_label'), 'bold' => 'true')));
    $enable_grid = new HuiGrid('enablegrid', array('rows' => '5', 'cols' => '2'));
    // Ampoliros site link
    //
    $enable_grid->AddChild(new HuiLabel('ampiconlabel', array('label' => $amp_locale->GetStr('amp_link_enabled_label'))), 0, 1);
    $enable_grid->AddChild(new HuiCheckBox('ampicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('ampoliros-link-disabled') ? 'false' : 'true')), 0, 0);
    // Solarix site link
    //
    $enable_grid->AddChild(new HuiLabel('solarixiconlabel', array('label' => $amp_locale->GetStr('solarix_link_enabled_label'))), 1, 1);
    $enable_grid->AddChild(new HuiCheckBox('solarixicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('solarix-link-disabled') ? 'false' : 'true')), 1, 0);
    // OEM link
    //
    $enable_grid->AddChild(new HuiLabel('oemiconlabel', array('label' => $amp_locale->GetStr('oem_link_enabled_label'))), 2, 1);
    $enable_grid->AddChild(new HuiCheckBox('oemicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('oem-link-disabled') ? 'false' : 'true')), 2, 0);
    // Ampoliros big logo
    //
    $enable_grid->AddChild(new HuiLabel('ampbigiconlabel', array('label' => $amp_locale->GetStr('amp_biglogo_enabled_label'))), 3, 1);
    $enable_grid->AddChild(new HuiCheckBox('ampbigicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('ampoliros-biglogo-disabled') ? 'false' : 'true')), 3, 0);
    // OEM logo
    //
    $enable_grid->AddChild(new HuiLabel('oemiconlabel', array('label' => $amp_locale->GetStr('oem_biglogo_enabled_label'))), 4, 1);
    $enable_grid->AddChild(new HuiCheckBox('oembigicon', array('disp' => 'pass', 'checked' => $mod_cfg->GetKey('oem-biglogo-disabled') ? 'false' : 'true')), 4, 0);
    $enable_vgroup->AddChild($enable_grid);
    $enable_vgroup->AddChild(new HuiSubmit('enablesubmit', array('caption' => $amp_locale->GetStr('enable_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'setenabledicons', ''));
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $enable_form = new HuiForm('setenableform', array('action' => $form_events_call->GetEventsCallString()));
    $enable_form->AddChild($enable_vgroup);
    // Advanced settings
    //
    $advanced_vgroup = new HuiVertGroup('enablevgroup', array('width' => '100%'));
    $advanced_vgroup->AddChild(new HuiLabel('enablelabel', array('label' => $amp_locale->GetStr('advancedsettings_label'), 'bold' => 'true')));
    $advanced_grid = new HuiGrid('enablegrid', array('rows' => '2', 'cols' => '2'));
    // Compressed output buffering
    //
    $advanced_grid->AddChild(new HuiLabel('compressed-ob-label', array('label' => $amp_locale->GetStr('compressed-ob_label'))), 0, 1);
    if (!strlen($compressed_ob)) {
        if (AMP_COMPRESSED_OB) {
            $compressed_ob = 'true';
        } else {
            $compressed_ob = 'false';
        }
    }
    $advanced_grid->AddChild(new HuiCheckBox('compressed-ob', array('disp' => 'pass', 'checked' => $compressed_ob)), 0, 0);
    // HUI code comments
    //
    $advanced_grid->AddChild(new HuiLabel('hui-comments-label', array('label' => $amp_locale->GetStr('hui-comments_label'))), 1, 1);
    if (!strlen($hui_comments)) {
        if (AMP_HUI_COMMENTS) {
            $hui_comments = 'true';
        } else {
            $hui_comments = 'false';
        }
    }
    $advanced_grid->AddChild(new HuiCheckBox('hui-comments', array('disp' => 'pass', 'checked' => $hui_comments)), 1, 0);
    $advanced_vgroup->AddChild($advanced_grid);
    $advanced_vgroup->AddChild(new HuiSubmit('enablesubmit', array('caption' => $amp_locale->GetStr('advanced_submit'))));
    $form_events_call = new HuiEventsCall();
    $form_events_call->AddEvent(new HuiEvent('pass', 'setadvanced', ''));
    $form_events_call->AddEvent(new HuiEvent('main', 'default', ''));
    $advanced_form = new HuiForm('setenableform', array('action' => $form_events_call->GetEventsCallString()));
    $advanced_form->AddChild($advanced_vgroup);
    $tab_headers[0]['label'] = $amp_locale->GetStr('oemframe_label');
    $tab_headers[1]['label'] = $amp_locale->GetStr('enabled_icons_label');
    $tab_headers[2]['label'] = $amp_locale->GetStr('advancedsettings_label');
    $tab = new HuiTab('interface', array('tabactionfunction' => 'interface_tab_action_builder', 'activetab' => isset($eventData['activetab']) ? $eventData['activetab'] : '', 'tabs' => $tab_headers));
    $tab->AddChild($oem_form);
    $tab->AddChild($enable_form);
    $tab->AddChild($advanced_form);
    $hui_mainframe->AddChild($tab);
    $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('default_title');
}