/**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // ภาษาที่ต้องการ
         $language = self::$request->get('language', Language::name())->toString();
         if (preg_match('/^[a-z]{2,2}$/', $language)) {
             // maintenance detail
             $template = ROOT_PATH . DATA_FOLDER . 'maintenance.' . $language . '.php';
             if (is_file($template)) {
                 $template = trim(preg_replace('/<\\?php exit([\\(\\);])?\\?>/', '', file_get_contents($template)));
             } else {
                 $template = '<p style="padding: 20px; text-align: center; font-weight: bold;">Website Temporarily Closed for Maintenance, Please try again in a few minutes.<br>ปิดปรับปรุงเว็บไซต์ชั่วคราวเพื่อบำรุงรักษา กรุณาลองใหม่ในอีกสักครู่</p>';
             }
             // แสดงผล
             $section = Html::create('section');
             // breadcrumbs
             $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
             $ul = $breadcrumbs->add('ul');
             $ul->appendChild('<li><span class="icon-settings">{LNG_Site settings}</span></li>');
             $ul->appendChild('<li><span>{LNG_Maintenance Mode}</span></li>');
             $section->add('header', array('innerHTML' => '<h1 class="icon-write">' . $this->title() . '</h1>'));
             // แสดงฟอร์ม
             $section->appendChild(createClass('Index\\Maintenance\\View')->render($language, $template));
             return $section->render();
         }
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * module=mailserver
  *
  * @param object $config
  * @return string
  */
 public function render($config)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/mailserver/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_General}'));
     // noreply_email
     $fieldset->add('text', array('id' => 'noreply_email', 'labelClass' => 'g-input icon-email', 'itemClass' => 'item', 'label' => '{LNG_noreply email}', 'comment' => '{LNG_Email addresses for sender and do not reply such as no-reply@domain.tld}', 'maxlength' => 255, 'value' => isset($config->noreply_email) ? $config->noreply_email : self::$cfg->noreply_email));
     // email_charset
     $fieldset->add('text', array('id' => 'email_charset', 'labelClass' => 'g-input icon-language', 'itemClass' => 'item', 'label' => '{LNG_Email encoding}', 'comment' => '{LNG_Specify the language code of the email, as utf-8}', 'value' => isset($config->email_charset) ? $config->email_charset : self::$cfg->email_charset));
     // email_use_phpMailer
     $fieldset->add('select', array('id' => 'email_use_phpMailer', 'labelClass' => 'g-input icon-clock', 'itemClass' => 'item', 'label' => '{LNG_Mail program}', 'comment' => '{LNG_Set the application for send an email}', 'options' => Language::get('MAIL_PROGRAMS'), 'value' => isset($config->email_use_phpMailer) ? $config->email_use_phpMailer : self::$cfg->email_use_phpMailer));
     // ตั้งค่า mail server
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Mail Server Settings}'));
     // email_Host
     $fieldset->add('text', array('id' => 'email_Host', 'labelClass' => 'g-input icon-world', 'itemClass' => 'item', 'label' => '{LNG_Mail server}', 'comment' => '{LNG_The name of the mail server as localhost or smtp.gmail.com (To change the settings of your email is the default. To remove this box entirely.)}', 'value' => isset($config->email_Host) ? $config->email_Host : self::$cfg->email_Host));
     // email_Port
     $fieldset->add('number', array('id' => 'email_Port', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_Port}', 'comment' => '{LNG_Mail server port number (default is 25, for GMail used 465, 587 for DirectAdmin).}', 'value' => isset($config->email_Port) ? $config->email_Port : self::$cfg->email_Port));
     // email_SMTPAuth
     $fieldset->add('select', array('id' => 'email_SMTPAuth', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_Authentication require}', 'comment' => '{LNG_How to define user authentication for mail servers. If you enable it, you must configure below correctly.}', 'options' => Language::get('BOOLEANS'), 'value' => isset($config->email_SMTPAuth) ? $config->email_SMTPAuth : self::$cfg->email_SMTPAuth));
     // email_SMTPSecure
     $fieldset->add('select', array('id' => 'email_SMTPSecure', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_SSL support}', 'comment' => '{LNG_Enable SSL encryption for sending email}', 'options' => Language::get('SMTPSECURIES'), 'value' => isset($config->email_SMTPSecure) ? $config->email_SMTPSecure : self::$cfg->email_SMTPSecure));
     // email_Username
     $fieldset->add('text', array('id' => 'email_Username', 'labelClass' => 'g-input icon-user', 'itemClass' => 'item', 'label' => '{LNG_Username}', 'comment' => '{LNG_Username for the mail server. (To change, enter a new value.)}', 'value' => isset($config->email_Username) ? $config->email_Username : self::$cfg->email_Username));
     // email_Password
     $fieldset->add('text', array('id' => 'email_Password', 'labelClass' => 'g-input icon-password', 'itemClass' => 'item', 'label' => '{LNG_Password}', 'comment' => '{LNG_Password of the mail server. (To change the fill.)}'));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Save}'));
     $form->script('initMailserver();');
     return $form->render();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // รายการที่ต้องการ
         $index = \Index\Mailwrite\Model::getIndex(self::$request->get('id')->toInt());
         // สร้างหรือแก้ไข
         $title = Language::get(empty($index->id) ? 'Create' : 'Edit');
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-settings">{LNG_Site settings}</span></li>');
         $ul->appendChild('<li><a href="{BACKURL?module=mailtemplate&id=0}">{LNG_Email template}</a></li>');
         $ul->appendChild('<li><span>' . $title . '</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-write">' . $title . ' ' . $index->name . '</h1>'));
         if ($index) {
             // แสดงฟอร์ม
             $section->appendChild(createClass('Index\\Mailwrite\\View')->render($index));
             return $section->render();
         }
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * module=skin
  *
  * @param object $config
  * @return string
  */
 public function render($config)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/skin/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Website display settings}'));
     // logo
     if (isset($config->logo) && is_file(ROOT_PATH . DATA_FOLDER . 'image/' . $config->logo)) {
         $img = $config->logo == 'logo.swf' ? WEB_URL . 'admin/skin/' . self::$cfg->skin . '/img/swf.png' : WEB_URL . DATA_FOLDER . 'image/' . $config->logo;
     } else {
         $img = WEB_URL . 'skin/img/blank.gif';
     }
     $fieldset->add('file', array('id' => 'logo', 'labelClass' => 'g-input icon-upload', 'itemClass' => 'item', 'label' => '{LNG_Logo}', 'comment' => '{LNG_Images or flash files on the website header (header) accepted jpg gif png files and swf}', 'dataPreview' => 'logoImage', 'previewSrc' => $img));
     // delete_logo
     $fieldset->add('checkbox', array('id' => 'delete_logo', 'itemClass' => 'subitem', 'label' => '{LNG_remove this photo}', 'value' => 1));
     // bg_image
     $img = isset($config->bg_image) && is_file(ROOT_PATH . DATA_FOLDER . 'image/' . $config->bg_image) ? WEB_URL . DATA_FOLDER . 'image/' . $config->bg_image : WEB_URL . 'skin/img/blank.gif';
     $fieldset->add('file', array('id' => 'bg_image', 'labelClass' => 'g-input icon-upload', 'itemClass' => 'item', 'label' => '{LNG_Background image}', 'comment' => '{LNG_Background picture of the site (body)}', 'dataPreview' => 'bgImage', 'previewSrc' => $img));
     // delete_bg_image
     $fieldset->add('checkbox', array('id' => 'delete_bg_image', 'itemClass' => 'subitem', 'label' => '{LNG_remove this photo}', 'value' => 1));
     // bg_color
     $fieldset->add('color', array('id' => 'bg_color', 'labelClass' => 'g-input icon-color', 'itemClass' => 'item', 'label' => '{LNG_Background color}', 'comment' => '{LNG_Background color of the site (body), eg #FFFFFF}', 'value' => isset($config->bg_color) ? $config->bg_color : ''));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Save}'));
     return $form->render();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // ภาษาที่ต้องการ
         $language = self::$request->get('language', Language::name())->toString();
         if (preg_match('/^[a-z]{2,2}$/', $language)) {
             // intro detail
             $template = ROOT_PATH . DATA_FOLDER . 'intro.' . $language . '.php';
             if (is_file($template)) {
                 $template = trim(preg_replace('/<\\?php exit([\\(\\);])?\\?>/', '', file_get_contents($template)));
             } else {
                 $template = '<p style="padding: 20px; text-align: center; font-weight: bold;"><a href="index.php">Welcome<br>ยินดีต้อนรับ</a></p>';
             }
             // แสดงผล
             $section = Html::create('section');
             // breadcrumbs
             $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
             $ul = $breadcrumbs->add('ul');
             $ul->appendChild('<li><span class="icon-settings">{LNG_Site settings}</span></li>');
             $ul->appendChild('<li><span>{LNG_Intro Page}</span></li>');
             $section->add('header', array('innerHTML' => '<h1 class="icon-write">' . $this->title() . '</h1>'));
             // แสดงฟอร์ม
             $section->appendChild(createClass('Index\\Intro\\View')->render($language, $template));
             return $section->render();
         }
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * แสดงผล
  */
 public function render(Request $request)
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // โมดูลที่ต้องการติดตั้ง
         $module = $request->get('m')->filter('a-z');
         $widget = $request->get('w')->filter('a-z');
         $this->module = $module !== '' ? $module : $widget;
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         if ($module !== '') {
             $ul->appendChild('<li><span class="icon-modules">{LNG_Module}</span></li>');
             $type = 'module';
         } elseif ($widget !== '') {
             $ul->appendChild('<li><span class="icon-widgets">{LNG_Widgets}</span></li>');
             $type = 'widget';
         } else {
             // 404.html
             return \Index\Error\Controller::page404();
         }
         $ul->appendChild('<li><span>{LNG_Install}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-inbox">' . $this->title() . '</h1>'));
         // แสดงฟอร์ม
         $section->appendChild(createClass('Index\\Install\\View')->render($type, $this->module));
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
Beispiel #7
0
 /**
  * แสดงผล
  */
 public function render()
 {
     // form login
     $form = Html::create('form', array('id' => 'login_frm', 'class' => 'login', 'autocomplete' => 'off', 'gform' => false));
     // h1
     $form->add('h1', array('class' => 'icon-customer', 'innerHTML' => Language::get('Administrator Area')));
     // message
     if (isset(Login::$login_message)) {
         $form->add('p', array('class' => empty(Login::$login_input) ? 'message' : 'error', 'innerHTML' => Login::$login_message));
     }
     // fieldset
     $fieldset = $form->add('fieldset');
     // username
     $fieldset->add('text', array('id' => 'login_username', 'labelClass' => 'g-input icon-user', 'placeholder' => Language::get('Username'), 'accesskey' => 'e', 'maxlength' => 255, 'value' => isset(Login::$text_username) ? Login::$text_username : ''));
     // password
     $fieldset->add('password', array('id' => 'login_password', 'labelClass' => 'g-input icon-password', 'placeholder' => Language::get('Password'), 'value' => isset(Login::$text_password) ? Login::$text_password : ''));
     // input-groups (div สำหรับจัดกลุ่ม input)
     $group = $fieldset->add('groups');
     // a
     $group->add('a', array('href' => self::$request->getUri()->withParams(array('action' => 'forgot'), true), 'class' => 'td', 'title' => Language::get('Request new password'), 'innerHTML' => '' . Language::get('Forgot') . ' ?'));
     // checkbox
     $group->add('checkbox', array('id' => 'login_remember', 'checked' => self::$request->cookie('login_remember')->toBoolean(), 'value' => 1, 'label' => Language::get('Remember me'), 'labelClass' => 'td right'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large wide', 'value' => Language::get('Sign In')));
     // คืนค่า form
     return $form->render();
 }
 public function render()
 {
     // form
     $form = Html::create('form', array('id' => 'forgot_frm', 'class' => 'login', 'autocomplete' => 'off', 'ajax' => false, 'action' => '?action=forgot'));
     // h1
     $form->add('h1', array('class' => 'icon-password', 'innerHTML' => '{LNG_Request new password}'));
     // message
     if (!empty(Login::$login_message)) {
         $form->add('p', array('class' => empty(Login::$login_input) ? 'message' : 'error', 'innerHTML' => Login::$login_message));
     }
     // fieldset
     $fieldset = $form->add('fieldset');
     // email
     $fieldset->add('email', array('id' => 'login_username', 'labelClass' => 'g-input icon-email', 'placeholder' => '{LNG_Email}', 'value' => isset(Login::$text_username) ? Login::$text_username : '', 'autofocus', 'required', 'accesskey' => 'e', 'maxlength' => 255, 'comment' => '{LNG_New password will be sent to the email address registered. If you do not remember or do not receive emails. Please contact your system administrator (Please check in the Junk Box)}'));
     // input-groups (div สำหรับจัดกลุ่ม input)
     $group = $fieldset->add('groups');
     // a
     $group->add('a', array('href' => self::$request->getUri()->withParams(array('action' => 'login'), true), 'class' => 'td', 'title' => '{LNG_Administrator Area}', 'innerHTML' => '{LNG_Sign In} ?'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large wide', 'value' => '{LNG_Get new password}'));
     $fieldset->add('hidden', array('id' => 'action', 'value' => 'forgot'));
     // template
     $template = Template::create('', '', 'login');
     $template->add(array('/{FORM}/' => $form->render()));
     return $template->render();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-modules">{LNG_Menus} &amp; {LNG_Web pages}</span></li>');
         $ul->appendChild('<li><a href="{BACKURL?module=mods&id=0}">{LNG_installed module}</a></li>');
         $ul->appendChild('<li><span>{LNG_Create}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-new">' . $this->title() . '</h1>'));
         // owner
         $modules = array();
         foreach (Gcms::$install_owners as $owner => $item) {
             if (file_exists(ROOT_PATH . 'modules/' . $owner . '/controllers/admin/init.php')) {
                 $class = ucfirst($owner) . '\\Admin\\Init\\Controller';
                 if (method_exists($class, 'description')) {
                     // get module description
                     $description = $class::description();
                     if (!empty($description)) {
                         $modules[$owner] = $description . ' [' . $owner . ']';
                     }
                 }
             }
         }
         // แสดงฟอร์ม
         $section->appendChild(createClass('Index\\Addmodule\\View')->render($modules));
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * module=meta
  *
  * @param object $config
  * @return string
  */
 public function render($config)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/meta/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('titleClass' => 'icon-google', 'title' => '{LNG_Google}'));
     // google_site_verification
     $fieldset->add('text', array('id' => 'google_site_verification', 'labelClass' => 'g-input icon-edit', 'itemClass' => 'item', 'label' => '{LNG_Site verification code}', 'comment' => '{LNG_&lt;meta name="google-site-verification" content="<em>xxxxxxxxxx</em>" /&gt;}', 'value' => isset($config->google_site_verification) ? $config->google_site_verification : ''));
     // google_profile
     $fieldset->add('text', array('id' => 'google_profile', 'labelClass' => 'g-input icon-edit', 'itemClass' => 'item', 'label' => '{LNG_Google page ID}', 'comment' => '{LNG_https://plus.google.com/<em>xxxxxxxxxx</em>/}', 'value' => isset($config->google_profile) ? $config->google_profile : ''));
     $fieldset = $form->add('fieldset', array('titleClass' => 'icon-bing', 'title' => '{LNG_Bing}'));
     // msvalidate
     $fieldset->add('text', array('id' => 'msvalidate', 'labelClass' => 'g-input icon-edit', 'itemClass' => 'item', 'label' => '{LNG_Site verification code}', 'comment' => '{LNG_&lt;meta name="msvalidate.01" content="<em>xxxxxxxxxx</em>" /&gt;}', 'value' => isset($config->msvalidate) ? $config->msvalidate : ''));
     $fieldset = $form->add('fieldset', array('titleClass' => 'icon-facebook', 'title' => '{LNG_Facebook}'));
     // facebook_appId
     $fieldset->add('text', array('id' => 'facebook_appId', 'labelClass' => 'g-input icon-edit', 'itemClass' => 'item', 'label' => '{LNG_App ID}', 'value' => isset($config->facebook_appId) ? $config->facebook_appId : ''));
     // facebook_photo
     $img = is_file(ROOT_PATH . DATA_FOLDER . 'image/facebook_photo.jpg') ? WEB_URL . DATA_FOLDER . 'image/facebook_photo.jpg' : WEB_URL . 'skin/img/blank.gif';
     $fieldset->add('file', array('id' => 'facebook_photo', 'labelClass' => 'g-input icon-upload', 'itemClass' => 'item', 'label' => '{LNG_Browse file}', 'comment' => '{LNG_Select an image file size 200x200 pixel types jpg only, for posting to your Facebook wall. On a shared or a subscription through Facebook.}', 'dataPreview' => 'fbImage', 'previewSrc' => $img));
     // delete_facebook_photo
     $fieldset->add('checkbox', array('id' => 'delete_facebook_photo', 'itemClass' => 'subitem', 'label' => '{LNG_remove this photo}', 'value' => 1));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Save}'));
     return $form->render();
 }
 /**
  * แสดงผล
  */
 public function render(Request $request)
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // รายการที่ต้องการ
         $index = \Index\Menuwrite\Model::getMenu(self::$request->get('id')->toInt());
         if ($index) {
             // สร้างหรือแก้ไข
             // แสดงผล
             $section = Html::create('section');
             // breadcrumbs
             $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
             $ul = $breadcrumbs->add('ul');
             $ul->appendChild('<li><span class="icon-modules">{LNG_Menus} &amp; {LNG_Web pages}</span></li>');
             $ul->appendChild('<li><a href="{BACKURL?module=pages&id=0}">{LNG_Menus}</a></li>');
             $ul->appendChild('<li><span>{LNG_' . (empty($index->id) ? 'Create' : 'Edit') . '}</span></li>');
             $section->add('header', array('innerHTML' => '<h1 class="icon-write">' . $this->title() . '</h1>'));
             if ($index) {
                 // แสดงฟอร์ม
                 $section->appendChild(createClass('Index\\Menuwrite\\View')->render($index));
                 return $section->render();
             }
         }
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * แสดงผล
  */
 public function render($login)
 {
     // send email form
     $form = Html::create('form', array('id' => 'write_frm', 'class' => 'setup_frm', 'action' => 'index.php/index/model/sendmail/save', 'onsubmit' => 'doFormSubmit', 'token' => true, 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Details of} {LNG_Email}'));
     // reciever
     $reciever = self::$request->get('to')->topic();
     $fieldset->add('text', array('id' => 'reciever', 'itemClass' => 'item', 'labelClass' => 'g-input icon-email-sent', 'label' => '{LNG_Reciever}', 'comment' => '{LNG_Recipient&#39;s Email Address Many can be found Each separated by, (comma).}', 'autofocus', 'value' => $reciever));
     // email_from
     $datas = array($login['email'] => $login['email']);
     if (Login::isAdmin() && empty($login['fb'])) {
         $datas[self::$cfg->noreply_email] = self::$cfg->noreply_email;
         foreach (\Index\Sendmail\Model::findAdmin(self::$request) as $item) {
             $datas[$item] = $item;
         }
     }
     $fieldset->add('select', array('id' => 'from', 'itemClass' => 'item', 'labelClass' => 'g-input icon-email', 'label' => '{LNG_Sender}', 'options' => $datas));
     // subject
     $fieldset->add('text', array('id' => 'subject', 'itemClass' => 'item', 'labelClass' => 'g-input icon-edit', 'label' => '{LNG_Subject}', 'comment' => '' . '{LNG_Please fill in} {LNG_Subject}'));
     // detail
     $fieldset->add('ckeditor', array('id' => 'detail', 'itemClass' => 'item', 'height' => 300, 'language' => Language::name(), 'toolbar' => 'Email', 'label' => '{LNG_Detail}', 'value' => Template::load('', '', 'mailtemplate')));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Send message}'));
     return $form->render();
 }
 /**
  * module=menuwrite
  *
  * @param object $menu
  * @return string
  */
 public function render($menu)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/menuwrite/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Menu details}'));
     $groups = $fieldset->add('groups-table', array('label' => '{LNG_Language}', 'id' => 'language', 'comment' => '{LNG_Select the language of this item (Select the first Is present in every language)}'));
     // language
     $groups->add('select', array('id' => 'language', 'labelClass' => 'g-input icon-language', 'itemClass' => 'width', 'options' => ArrayTool::replace(array('' => '{LNG_all languages}'), Language::installedLanguage()), 'value' => empty($menu->id) ? '' : $menu->language));
     $groups->add('a', array('id' => 'copy_menu', 'class' => 'button icon-copy copy', 'title' => '{LNG_Copy this item to the selected language}'));
     // menu_text
     $fieldset->add('text', array('id' => 'menu_text', 'labelClass' => 'g-input icon-menus', 'itemClass' => 'item', 'label' => '{LNG_Text}', 'comment' => '{LNG_Text displayed on the menu}', 'maxlength' => 100, 'value' => $menu->menu_text));
     // menu_tooltip
     $fieldset->add('text', array('id' => 'menu_tooltip', 'labelClass' => 'g-input icon-edit', 'itemClass' => 'item', 'label' => '{LNG_Tooltip}', 'comment' => '{LNG_Message when mouse over the menu}', 'maxlength' => 100, 'value' => $menu->menu_tooltip));
     // accesskey
     $fieldset->add('text', array('id' => 'accesskey', 'labelClass' => 'g-input icon-keyboard', 'itemClass' => 'item', 'label' => '{LNG_Accesskey}', 'comment' => '{LNG_Enter lowercase English letters or numbers to be used as a shortcut to this menu. (Sub-menus do not support the shortcut menu. Do not duplicate keys of the system shortcut)}', 'value' => $menu->accesskey));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Installation and position of the menu}'));
     // alias
     $fieldset->add('text', array('id' => 'alias', 'labelClass' => 'g-input icon-edit', 'itemClass' => 'item', 'label' => '{LNG_Alias}', 'comment' => '{LNG_The name of the menu (the default is the name of the module is installed)}', 'value' => $menu->alias));
     // parent
     $fieldset->add('select', array('id' => 'parent', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_Menu position}', 'comment' => '{LNG_Select the menu position. The menu will be displayed on the website at the selected position. (Based on templates you are using)}', 'options' => Language::find('MENU_PARENTS', array('MAINMENU' => 'Main menu')), 'value' => $menu->parent));
     // type
     if ($menu->menu_order == 1) {
         $m = 0;
     } elseif ($menu->level == 0) {
         $m = 1;
     } elseif ($menu->level == 1) {
         $m = 2;
     } else {
         $m = 3;
     }
     $fieldset->add('select', array('id' => 'type', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_Menu type}', 'comment' => '{LNG_Select the type of menu}', 'options' => Language::get('MENU_TYPES'), 'value' => $m));
     // menu_order
     $fieldset->add('select', array('id' => 'menu_order', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_Menu order}', 'size' => 8, 'comment' => '{LNG_The sequence of the desired menu. The menu will be displayed next from the selected item}'));
     // published
     $fieldset->add('select', array('id' => 'published', 'labelClass' => 'g-input icon-published1', 'itemClass' => 'item', 'label' => '{LNG_Status}', 'comment' => '{LNG_Publish this item}', 'options' => Language::get('MENU_PUBLISHEDS'), 'value' => $menu->published));
     $fieldset = $form->add('fieldset', array('id' => 'menu_action', 'title' => '{LNG_Action when click on menu}'));
     // action
     if ($menu->menu_url != '') {
         $m = 2;
     } elseif ($menu->index_id == 0) {
         $m = 0;
     } else {
         $m = 1;
     }
     $fieldset->add('select', array('id' => 'action', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_When choosing the menu}', 'comment' => '{LNG_Choose how to proceed. When you click on the menu}', 'options' => Language::get('MENU_ACTIONS'), 'value' => $m));
     // index_id
     $fieldset->add('select', array('id' => 'index_id', 'labelClass' => 'g-input icon-modules', 'itemClass' => 'item action 1', 'label' => '{LNG_installed module}', 'comment' => '{LNG_Choose the page you want to open when you click a menu item from a list of web pages or modules already installed}', 'optgroup' => \Index\Menuwrite\Model::getModules(), 'value' => $menu->owner . '_' . $menu->index_id));
     // menu_url
     $fieldset->add('text', array('id' => 'menu_url', 'labelClass' => 'g-input icon-world', 'itemClass' => 'item action 2', 'label' => '{LNG_URL}', 'comment' => '{LNG_Links for this item, which will open this page when click on it}', 'value' => str_replace(array('{', '}'), array('&#x007B;', '&#x007D;'), $menu->menu_url)));
     // menu_target
     $fieldset->add('select', array('id' => 'menu_target', 'labelClass' => 'g-input icon-forward', 'itemClass' => 'item action 1 2', 'label' => '{LNG_The opening page of links}', 'comment' => '{LNG_Determine how to turn the page when a link is clicked}', 'options' => Language::get('MENU_TARGET'), 'value' => $menu->menu_target));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Save}'));
     // id
     $fieldset->add('hidden', array('id' => 'id', 'value' => $menu->id));
     $form->script('initMenuwrite();');
     return $form->render();
 }
 /**
  * ฟอร์ม import
  *
  * @return string
  */
 public function import()
 {
     $form = Html::create('form', array('id' => 'import_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/database/import', 'onsubmit' => 'doFormSubmit', 'confirmsubmit' => 'doCustomConfirm("{LNG_Do you want to import the database?}")', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('titleClass' => 'icon-import', 'title' => '{LNG_Import data from databases or to recover data from a previously backed up}'));
     $fieldset->add('file', array('id' => 'import_file', 'labelClass' => 'g-input icon-upload', 'itemClass' => 'item', 'label' => '{LNG_Select a file to import (less than :size)}', 'comment' => '{LNG_Browse the database file (<em>:dbname.sql</em>) that you back it up from this system only.}'));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Import}'));
     $form->add('aside', array('class' => 'warning', 'innerHTML' => '{LNG_<strong>Warning</strong> : Import database will replace your database with data from uploaded file. Therefore, you should make sure that the database file of GCMS. (unsupported database version 3 or lower.) If you are unsure. Please back up this database again before any action}'));
     return $form->render();
 }
 /**
  * module=addmodule
  *
  * @param array $modules
  * @return string
  */
 public function render($modules)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'action' => 'index.php', 'method' => 'get'));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Create a new module from the module installed, according to usage}'));
     $fieldset->add('select', array('id' => 'owner', 'labelClass' => 'g-input icon-modules', 'itemClass' => 'item', 'label' => '{LNG_installed module}', 'options' => $modules));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Create}'));
     // module
     $fieldset->add('hidden', array('id' => 'module', 'value' => 'pagewrite'));
     return $form->render();
 }
 /**
  * module=install
  *
  * @param string $type module หรือ widget
  * @param string $module โมดูลที่ติดตั้ง
  * @return object
  */
 public function render($type, $module)
 {
     $div = Html::create('div', array('class' => 'setup_frm', 'id' => 'install'));
     if ($type === 'module' && empty(Gcms::$install_modules[$module]) || $type === 'widget') {
         $div->add('aside', array('class' => 'tip', 'innerHTML' => Language::get('Module or an extension has not been installed correctly the first time. Please click on the button "Install" below to complete installation before.')));
         $div2 = $div->add('div', array('class' => 'padding-right-bottom-left'));
         $div2->add('a', array('class' => 'button ok large', 'id' => 'install_btn', 'innerHTML' => '<span class=icon-valid>' . Language::get('Install') . '</span>'));
         if ($type === 'module') {
             $div->script("callInstall('" . rawurlencode(ucfirst($module) . '\\Admin\\Install\\Model') . "')");
         } elseif ($type === 'widget') {
             $div->script("callInstall('" . rawurlencode('Widgets\\' . ucfirst($module) . '\\Models\\Install') . "')");
         }
     } else {
         $div->add('aside', array('class' => 'error', 'innerHTML' => Language::get('Can not install this module. Because this module is already installed. If you want to install this module, you will need to rename installed module to a different name. (This module is to use this name only).')));
     }
     return $div->render();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if ($login = Login::isAdmin()) {
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-email">{LNG_Mailbox}</span></li>');
         $ul->appendChild('<li><span>{LNG_Email send}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-email-sent">' . $this->title() . '</h1>'));
         // แสดงฟอร์ม
         $section->appendChild(createClass('Index\\Sendmail\\View')->render($login));
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><a class="icon-user" href="index.php?module=member">{LNG_Users}</a></li>');
         $ul->appendChild('<li><span>{LNG_Register}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-register">' . $this->title() . '</h1>'));
         // แสดงฟอร์ม
         $section->appendChild(createClass('Index\\Register\\View')->render());
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-tools">{LNG_Tools}</span></li>');
         $ul->appendChild('<li><span>{LNG_Language}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-language">' . $this->title() . '</h1>'));
         // แสดงตาราง
         $section->appendChild(createClass('Index\\Language\\View')->render());
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * module=maintenance
  *
  * @param string $language
  * @param string $template
  * @return string
  */
 public function render($language, $template)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/maintenance/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_The page will appear on your site is in maintenance mode}'));
     // maintenance_mode
     $fieldset->add('select', array('id' => 'maintenance_mode', 'labelClass' => 'g-input icon-config', 'itemClass' => 'item', 'label' => '{LNG_Settings}', 'options' => Language::get('BOOLEANS'), 'value' => isset(self::$cfg->maintenance_mode) ? self::$cfg->maintenance_mode : 0));
     $div = $fieldset->add('groups-table', array('label' => '{LNG_Language}'));
     // language
     $div->add('select', array('id' => 'language', 'labelClass' => 'g-input icon-language', 'itemClass' => 'width', 'options' => Language::installedLanguage(), 'value' => $language));
     $div->add('button', array('id' => 'btn_go', 'itemClass' => 'width', 'class' => 'button go', 'value' => '{LNG_Go}'));
     // detail
     $fieldset->add('ckeditor', array('id' => 'detail', 'itemClass' => 'item', 'height' => 300, 'language' => Language::name(), 'toolbar' => 'Document', 'label' => '{LNG_Detail}', 'value' => $template, 'upload' => true));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Save}'));
     $form->script('doChangeLanguage("btn_go", "index.php?module=maintenance");');
     return $form->render();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-home">{LNG_Home}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-dashboard">' . $this->title() . '</h1>'));
         // แสดงฟอร์ม
         $section->appendChild(createClass('Index\\Dashboard\\View')->render());
         return $section->render();
     } else {
         // 404.html
         return \Index\Error\Controller::page404();
     }
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // register form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/updateprofile/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Register}'));
     // email
     $fieldset->add('email', array('id' => 'register_email', 'itemClass' => 'item', 'labelClass' => 'g-input icon-email', 'label' => '{LNG_Email}', 'comment' => '{LNG_The system will send the registration information to this e-mail. Please use real email address}', 'maxlength' => 255, 'validator' => array('keyup,change', 'checkEmail', 'index.php/index/model/checker/email')));
     $groups = $fieldset->add('groups');
     // password
     $groups->add('password', array('id' => 'register_password', 'itemClass' => 'width50', 'labelClass' => 'g-input icon-password', 'label' => '{LNG_Password}', 'comment' => '{LNG_Passwords must be at least four characters}', 'maxlength' => 20, 'validator' => array('keyup,change', 'checkPassword')));
     // repassword
     $groups->add('password', array('id' => 'register_repassword', 'itemClass' => 'width50', 'labelClass' => 'g-input icon-password', 'label' => '{LNG_Repassword}', 'comment' => '{LNG_Enter your password again}', 'maxlength' => 20, 'validator' => array('keyup,change', 'checkPassword')));
     $fieldset->add('select', array('id' => 'register_status', 'itemClass' => 'item', 'label' => '{LNG_Member status}', 'labelClass' => 'g-input icon-star0', 'options' => self::$cfg->member_status));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button save large', 'value' => '{LNG_Register}'));
     $fieldset->add('hidden', array('id' => 'register_id', 'value' => 0));
     return $form->render();
 }
 /**
  * แสดงผล
  */
 public function render(Request $request)
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-modules">{LNG_Menus} &amp; {LNG_Web pages}</span></li>');
         $ul->appendChild('<li><span>{LNG_installed module}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-modules">' . $this->title() . '</h1>'));
         // แสดงตาราง
         $section->appendChild(createClass('Index\\Mods\\View')->render());
         return $section->render();
     } else {
         // 404.html
         return \Index\Error\Controller::page404();
     }
 }
 /**
  * module=languageedit
  *
  * @return string
  */
 public function render(\Index\Languageedit\Controller $controller)
 {
     // form แก้ไข
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'onsubmit' => 'doFormSubmit', 'action' => 'index.php/index/model/languageedit/save', 'ajax' => true));
     // fieldset
     $fieldset = $form->add('fieldset', array('title' => '{LNG_' . ($controller->id > -1 ? 'Edit' : 'Create') . '} ' . htmlspecialchars($controller->language['key'])));
     $fieldset->add('select', array('id' => 'write_type', 'labelClass' => 'g-input icon-config', 'label' => '{LNG_Type}', 'itemClass' => 'item', 'options' => array('php' => 'php', 'js' => 'js'), 'value' => $controller->type));
     // topic
     $fieldset->add('text', array('id' => 'write_topic', 'labelClass' => 'g-input icon-edit', 'label' => '{LNG_Key}', 'itemClass' => 'item', 'autofocus', 'value' => $controller->language['key']));
     // table
     $table = new DataTable(array('datas' => $controller->languages, 'onRow' => array($this, 'onRow'), 'border' => true, 'responsive' => true, 'showCaption' => false, 'pmButton' => true, 'headers' => array('key' => array('text' => '{LNG_Key}'))));
     $div = $fieldset->add('div', array('class' => 'item', 'innerHTML' => $table->render()));
     $div->add('div', array('class' => 'comment', 'innerHTML' => '{LNG_No need to enter text in English (en) or fill in the two matches}'));
     // fieldset
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button save large', 'value' => '{LNG_Save}'));
     // id
     $fieldset->add('hidden', array('id' => 'write_id', 'value' => $controller->id));
     return $form->render();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-settings">{LNG_Site settings}</span></li>');
         $ul->appendChild('<li><span>{LNG_Other}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-config">' . $this->title() . '</h1>'));
         // โหลด config
         $config = Config::load(ROOT_PATH . 'settings/config.php');
         // แสดงฟอร์ม
         $section->appendChild(createClass('Index\\Other\\View')->render($config));
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * module=memberstatus
  *
  * @return string
  */
 public function render()
 {
     $section = Html::create('div', array('class' => 'subtitle', 'innerHTML' => '{LNG_Status of membership, the first item (0) means end users and 1 represents the administrator. (The first two items are the items necessary), you can modify the ability of each member of the modules again.}'));
     $list = $section->add('ol', array('class' => 'editinplace_list', 'id' => 'config_status'));
     foreach (self::$cfg->member_status as $s => $item) {
         $row = $list->add('li', array('id' => 'config_status_' . $s));
         if ($s > 1) {
             $row->add('span', array('id' => 'config_status_delete_' . $s, 'class' => 'icon-delete', 'title' => '{LNG_Delete}'));
         } else {
             $row->add('span');
         }
         $row->add('span', array('id' => 'config_status_color_' . $s, 'title' => self::$cfg->color_status[$s]));
         $row->add('span', array('id' => 'config_status_name_' . $s, 'innerHTML' => $item, 'title' => '{LNG_click to edit}'));
     }
     $div = $section->add('div', array('class' => 'submit'));
     $a = $div->add('a', array('class' => 'button add large', 'id' => 'config_status_add'));
     $a->add('span', array('class' => 'icon-plus', 'innerHTML' => '{LNG_Add New}' . ' ' . '{LNG_Member status}'));
     $section->script('initEditInplace("config_status", "memberstatus");');
     $section->script('$E("config_status_color_0").focus();');
     return $section->render();
 }
 /**
  * module=mailwrite
  *
  * @param object $index
  * @return string
  */
 public function render($index)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/mailwrite/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Details of} {LNG_Email}'));
     // from_email
     $fieldset->add('text', array('id' => 'from_email', 'labelClass' => 'g-input icon-email', 'itemClass' => 'item', 'label' => '{LNG_Sender}', 'comment' => '{LNG_E-mail address for replies. If you do not want a response, please leave blank.}', 'maxlength' => 255, 'value' => $index->from_email));
     // copy_to
     $fieldset->add('text', array('id' => 'copy_to', 'labelClass' => 'g-input icon-cc', 'itemClass' => 'item', 'label' => '{LNG_Copy to}', 'comment' => '{LNG_More email addresses to send a copy of the email. Separate each item with comma (,)}', 'value' => $index->copy_to));
     // subject
     $fieldset->add('text', array('id' => 'subject', 'labelClass' => 'g-input icon-edit', 'itemClass' => 'item', 'label' => '{LNG_Subject}', 'title' => '{LNG_Please fill in} {LNG_Subject}', 'maxlength' => 64, 'value' => $index->subject));
     // language
     $fieldset->add('select', array('id' => 'language', 'labelClass' => 'g-input icon-language', 'itemClass' => 'item', 'label' => '{LNG_Language}', 'comment' => '{LNG_The system will e-mail the selected language. If you do not use the default language.}', 'options' => Language::installedLanguage(), 'value' => $index->language));
     // detail
     $fieldset->add('ckeditor', array('id' => 'detail', 'itemClass' => 'item', 'height' => 300, 'language' => Language::name(), 'toolbar' => 'Document', 'upload' => true, 'label' => '{LNG_Detail}', 'value' => $index->detail));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Save}'));
     // id
     $fieldset->add('hidden', array('id' => 'id', 'value' => $index->id));
     return $form->render();
 }
 /**
  * module=languageadd
  *
  * @param string $id
  * @return string
  */
 public function render($id)
 {
     // form
     $form = Html::create('form', array('id' => 'setup_frm', 'class' => 'setup_frm', 'autocomplete' => 'off', 'action' => 'index.php/index/model/languageadd/save', 'onsubmit' => 'doFormSubmit', 'ajax' => true));
     $fieldset = $form->add('fieldset', array('title' => '{LNG_Details of} {LNG_Language}'));
     // language_name
     $fieldset->add('text', array('id' => 'language_name', 'labelClass' => 'g-input icon-language', 'itemClass' => 'item', 'label' => '{LNG_Language}', 'comment' => '{LNG_Language name English lowercase two letters}', 'maxlength' => 2, 'value' => $id));
     if (empty($id)) {
         // copy
         $fieldset->add('select', array('id' => 'lang_copy', 'labelClass' => 'g-input icon-copy', 'itemClass' => 'item', 'label' => '{LNG_Copy}', 'comment' => '{LNG_Copy language from the installation}', 'options' => Language::installedLanguage()));
     }
     // lang_icon
     $img = is_file(ROOT_PATH . "language/{$id}.gif") ? WEB_URL . "language/{$id}.gif" : "../skin/img/blank.gif";
     $fieldset->add('file', array('id' => 'lang_icon', 'labelClass' => 'g-input icon-upload', 'itemClass' => 'item', 'label' => '{LNG_Icon}', 'comment' => '{LNG_Image upload types :type only, should be prepared to have the same size}', 'dataPreview' => 'icoImage', 'previewSrc' => $img));
     $fieldset = $form->add('fieldset', array('class' => 'submit'));
     // submit
     $fieldset->add('submit', array('class' => 'button ok large', 'value' => '{LNG_Save}'));
     // language
     $fieldset->add('hidden', array('id' => 'language', 'value' => $id));
     Gcms::$view->setContents(array('/:type/' => 'gif'), false);
     return $form->render();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-tools">{LNG_Tools}</span></li>');
         $ul->appendChild('<li><span>' . $this->title() . '</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-world">' . $this->title() . '</h1>'));
         $div = $section->add('div', array('class' => 'setup_frm'));
         $div = $div->add('div', array('class' => 'item'));
         $div->appendChild('<div id="debug_layer"></div>');
         $div->appendChild('<div class="submit right"><a id="debug_clear" class="button large red">{LNG_Clear}</a></div>');
         $section->script('showDebug();');
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }
 /**
  * แสดงผล
  */
 public function render()
 {
     // แอดมิน
     if (Login::isAdmin()) {
         // แสดงผล
         $section = Html::create('section');
         // breadcrumbs
         $breadcrumbs = $section->add('div', array('class' => 'breadcrumbs'));
         $ul = $breadcrumbs->add('ul');
         $ul->appendChild('<li><span class="icon-tools">{LNG_Tools}</span></li>');
         $ul->appendChild('<li><span>{LNG_Database}</span></li>');
         $section->add('header', array('innerHTML' => '<h1 class="icon-database">' . $this->title() . '</h1>'));
         $div = $section->add('div', array('class' => 'setup_frm'));
         // แสดงฟอร์ม
         $view = new \Index\Database\View();
         $div->appendChild($view->export());
         $div->appendChild($view->import());
         return $section->render();
     }
     // 404.html
     return \Index\Error\Controller::page404();
 }