コード例 #1
0
 /**
  * ตารางโมดูลที่ติดตั้งแล้ว
  *
  * @return string
  */
 public function render()
 {
     // Uri
     $uri = self::$request->getUri();
     $table = new DataTable(array('model' => 'Index\\Mods\\Model', 'defaultFilters' => array(array('I.index', 1)), 'onRow' => array($this, 'onRow'), 'hideColumns' => array('module_id', 'id'), 'action' => 'index.php/index/model/mods/action', 'actionCallback' => 'indexActionCallback', 'headers' => array('topic' => array('text' => '{LNG_Topic}'), 'published' => array('text' => '{LNG_Status}', 'class' => 'center'), 'language' => array('text' => '{LNG_Language}', 'class' => 'center'), 'module' => array('text' => '{LNG_module name}'), 'owner' => array('text' => ' '), 'last_update' => array('text' => '{LNG_Last updated}', 'class' => 'center'), 'visited' => array('text' => '{LNG_Preview}', 'class' => 'center')), 'cols' => array('published' => array('class' => 'center'), 'language' => array('class' => 'center'), 'last_update' => array('class' => 'center'), 'visited' => array('class' => 'visited')), 'buttons' => array('edit' => array('class' => 'icon-edit button green', 'href' => $uri->createBackUri(array('module' => 'pagewrite', 'id' => ':id')), 'text' => '{LNG_Edit}'), 'delete' => array('class' => 'icon-delete button red', 'id' => ':id', 'text' => '{LNG_Delete}')), 'addNew' => array('class' => 'button green icon-plus', 'href' => $uri->createBackUri(array('module' => 'addmodule', 'id' => '0')), 'text' => '{LNG_Add New} {LNG_Module}')));
     return $table->render();
 }
コード例 #2
0
 /**
  * module=pages
  *
  * @return string
  */
 public function render()
 {
     $this->publisheds = Language::get('PUBLISHEDS');
     // Uri
     $uri = self::$request->getUri();
     // ตาราง
     $table = new DataTable(array('model' => 'Index\\Pages\\Model', 'perPage' => self::$request->cookie('pages_perPage', 30)->toInt(), 'defaultFilters' => array(array('M.owner', 'index')), 'onRow' => array($this, 'onRow'), 'hideColumns' => array('module_id', 'id', 'owner'), 'action' => 'index.php/index/model/pages/action', 'actionCallback' => 'indexActionCallback', 'actionConfirm' => 'confirmAction', 'searchColumns' => array('topic', 'module', 'detail'), 'headers' => array('topic' => array('text' => '{LNG_Topic}'), 'published' => array('text' => '{LNG_Status}', 'class' => 'center'), 'language' => array('text' => '{LNG_Language}', 'class' => 'center'), 'module' => array('text' => '{LNG_module name}', 'class' => 'center'), 'last_update' => array('text' => '{LNG_Last updated}', 'class' => 'center'), 'visited' => array('text' => '{LNG_Preview}', 'class' => 'center')), 'cols' => array('published' => array('class' => 'center'), 'language' => array('class' => 'center'), 'module' => array('class' => 'center'), 'last_update' => array('class' => 'center'), 'visited' => array('class' => 'visited')), 'buttons' => array('edit' => array('class' => 'icon-edit button green', 'href' => $uri->createBackUri(array('module' => 'pagewrite', 'id' => ':id')), 'text' => '{LNG_Edit}'), 'delete' => array('class' => 'icon-delete button red', 'id' => ':id', 'text' => '{LNG_Delete}')), 'addNew' => array('class' => 'button green icon-plus', 'href' => $uri->createBackUri(array('module' => 'pagewrite', 'id' => '0')), 'text' => '{LNG_Add New} {LNG_Page}')));
     // save cookie
     setcookie('pages_perPage', $table->perPage, time() + 3600 * 24 * 365, '/');
     return $table->render();
 }
コード例 #3
0
 /**
  * module=menus
  *
  * @return string
  */
 public function render()
 {
     // menu ที่เลือก default คือ MAINMENU
     $parent = self::$request->get('parent')->toString();
     $installed_menus = Language::find('MENU_PARENTS', array('MAINMENU' => 'Main menu'));
     $menus = array_keys($installed_menus);
     $parent = in_array($parent, $menus) ? $parent : reset($menus);
     $this->toplvl = -1;
     // Uri
     $uri = self::$request->getUri();
     // ตารางรายการเมนู
     $table = new DataTable(array('model' => 'Index\\Menus\\Model', 'onRow' => array($this, 'onRow'), 'hideColumns' => array('id', 'index_id', 'level', 'menu_url', 'ilanguage'), 'dragColumn' => 4, 'action' => 'index.php/index/model/menus/action', 'actionCallback' => 'indexActionCallback', 'actionConfirm' => 'confirmAction', 'headers' => array('menu_text' => array('text' => '{LNG_Menu}'), 'move_left' => array('text' => ''), 'move_right' => array('text' => ''), 'alias' => array('text' => '{LNG_Alias}'), 'published' => array('text' => '{LNG_Status}', 'class' => 'center'), 'language' => array('text' => '{LNG_Language}', 'class' => 'center'), 'menu_tooltip' => array('text' => '{LNG_Tooltip}'), 'accesskey' => array('text' => '{LNG_Accesskey}', 'class' => 'center'), 'module' => array('text' => '{LNG_Link}/{LNG_Module}')), 'cols' => array('published' => array('class' => 'center'), 'language' => array('class' => 'center'), 'accesskey' => array('class' => 'center')), 'buttons' => array('edit' => array('class' => 'icon-edit button green', 'href' => $uri->createBackUri(array('module' => 'menuwrite', 'id' => ':id')), 'text' => '{LNG_Edit}'), 'delete' => array('class' => 'icon-delete button red', 'id' => ':id', 'text' => '{LNG_Delete}')), 'addNew' => array('class' => 'button green icon-plus', 'href' => $uri->createBackUri(array('module' => 'menuwrite', 'id' => '0')), 'text' => '{LNG_Add New} {LNG_Menu}'), 'filters' => array('parent' => array('name' => 'parent', 'text' => '{LNG_Choose}', 'options' => $installed_menus, 'value' => $parent))));
     return $table->render();
 }
コード例 #4
0
 /**
  * ตารางรายชื่อสมาชิก
  *
  * @return string
  */
 public function render()
 {
     $this->sexes = Language::get('SEXES');
     // สถานะสมาชิก
     $change_member_status = array();
     $member_status = array(-1 => '{LNG_all items}');
     foreach (self::$cfg->member_status as $key => $value) {
         $member_status[$key] = $value;
         $change_member_status[$key] = '{LNG_Change member status to} ' . $value;
     }
     // ตารางสมาชิก
     $table = new DataTable(array('model' => 'Index\\Member\\Model', 'perPage' => self::$request->cookie('member_perPage', 30)->toInt(), 'sort' => self::$request->cookie('member_sort', 'id desc')->toString(), 'onRow' => array($this, 'onRow'), 'hideColumns' => array('visited', 'status', 'admin_access', 'activatecode', 'website', 'fb'), 'searchColumns' => array('fname', 'lname', 'displayname', 'email'), 'action' => 'index.php/index/model/member/action', 'actions' => array(array('id' => 'action', 'class' => 'ok', 'text' => '{LNG_With selected}', 'options' => array('accept' => '{LNG_Accept membership}', 'activate' => '{LNG_Send confirmation email}', 'sendpassword' => '{LNG_Get new password}', 'ban' => '{LNG_Suspended}', 'unban' => '{LNG_Cancel suspension}', 'delete' => '{LNG_Delete}')), array('id' => 'status', 'class' => 'ok', 'text' => '{LNG_With selected}', 'options' => $change_member_status)), 'filters' => array('status' => array('name' => 'status', 'default' => -1, 'text' => '{LNG_Member status}', 'options' => $member_status, 'value' => self::$request->get('status', -1)->toInt())), 'fields' => array('id', 'ban', 'email', 'displayname', 'CONCAT_WS(" ", `pname`,`fname`,`lname`) name', 'phone1', 'sex', 'website', 'create_date', 'lastvisited', 'visited', 'status', 'admin_access', 'activatecode', 'fb'), 'headers' => array('id' => array('text' => '{LNG_ID}', 'sort' => 'id'), 'ban' => array('text' => ''), 'email' => array('text' => '{LNG_Email}', 'sort' => 'email'), 'displayname' => array('text' => '{LNG_Displayname}', 'sort' => 'displayname'), 'name' => array('text' => '{LNG_Name} {LNG_Surname}', 'sort' => 'name'), 'phone1' => array('text' => '{LNG_Phone}'), 'sex' => array('text' => '{LNG_Sex}', 'class' => 'center'), 'website' => array('text' => '{LNG_Website}'), 'create_date' => array('text' => '{LNG_Created}', 'class' => 'center'), 'lastvisited' => array('text' => '{LNG_Last login} ({LNG_times})', 'class' => 'center')), 'cols' => array('sex' => array('class' => 'center'), 'ban' => array('class' => 'center'), 'create_date' => array('class' => 'center'), 'lastvisited' => array('class' => 'center')), 'buttons' => array(array('class' => 'icon-edit button green', 'href' => self::$request->getUri()->createBackUri(array('module' => 'editprofile', 'id' => ':id')), 'text' => '{LNG_Edit}'))));
     // save cookie
     setcookie('member_perPage', $table->perPage, time() + 3600 * 24 * 365, '/');
     setcookie('member_sort', $table->sort, time() + 3600 * 24 * 365, '/');
     return $table->render();
 }
コード例 #5
0
 /**
  * ตารางภาษา
  *
  * @return string
  */
 public function render()
 {
     // ชนิดของภาษาที่เลือก php,js
     $type = self::$request->get('type')->toString();
     $type = $type == 'js' ? 'js' : 'php';
     // โหลดภาษา
     $datas = Language::installed($type);
     $installed_language = Language::installedLanguage();
     // Uri
     $uri = self::$request->getUri();
     // ตารางภาษา
     $table = new DataTable(array('datas' => $datas, 'onRow' => array($this, 'onRow'), 'perPage' => max(10, self::$request->cookie('language_perPage', 30)->toInt()), 'sort' => self::$request->cookie('language_sort', 'key')->toString(), 'searchColumns' => array_merge(array('key'), $installed_language), 'headers' => array('id' => array('text' => '{LNG_ID}', 'sort' => 'id'), 'key' => array('text' => '{LNG_Key}', 'sort' => 'key')), 'action' => 'index.php/index/model/language/action?type=' . $type, 'actionCallback' => 'doFormSubmit', 'actionConfirm' => 'confirmAction', 'actions' => array(array('id' => 'action', 'class' => 'ok', 'text' => '{LNG_With selected}', 'options' => array('delete' => '{LNG_Delete}')), array('class' => 'button add icon-plus', 'href' => $uri->createBackUri(array('module' => 'languageedit', 'id' => null, 'type' => $type)), 'text' => '{LNG_Add New}')), 'buttons' => array(array('class' => 'icon-edit button green', 'href' => $uri->createBackUri(array('module' => 'languageedit', 'id' => ':id', 'type' => $type)), 'text' => '{LNG_Edit}')), 'filters' => array('type' => array('name' => 'type', 'text' => '{LNG_Type}', 'options' => array('php' => 'php', 'js' => 'js'), 'value' => $type))));
     foreach ($installed_language as $lng) {
         $table->headers[$lng]['sort'] = $lng;
     }
     // save cookie
     setcookie('language_perPage', $table->perPage, time() + 3600 * 24 * 365, '/');
     setcookie('language_sort', $table->sort, time() + 3600 * 24 * 365, '/');
     return $table->render();
 }
コード例 #6
0
 /**
  * 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();
 }
コード例 #7
0
 public function render($date)
 {
     $table = new DataTable(array('datas' => \Index\Report\Model::get($date), 'headers' => array('time' => array('text' => '{LNG_Time}', 'sort' => 'time'), 'ip' => array('text' => '{LNG_IP}', 'sort' => 'ip'), 'count' => array('text' => '{LNG_Count}', 'class' => 'center', 'sort' => 'count'), 'referer' => array('text' => '{LNG_Referer}', 'sort' => 'referer'), 'agent' => array('text' => '{LNG_User Agent}', 'class' => 'tablet', 'sort' => 'agent')), 'cols' => array('count' => array('class' => 'center'), 'agent' => array('class' => 'tablet'))));
     return $table->render();
 }
コード例 #8
0
 /**
  * ตารางแม่แบบอีเมล์
  *
  * @return string
  */
 public function render()
 {
     // ตารางแม่แบบอีเมล์
     $table = new DataTable(array('model' => 'Index\\Mailtemplate\\Model', 'hideColumns' => array('id', 'email_id', 'subject'), 'onRow' => array($this, 'onRow'), 'onCreateButton' => array($this, 'onCreateButton'), 'headers' => array('name' => array('text' => '{LNG_Name}'), 'language' => array('text' => '{LNG_Language}', 'class' => 'center'), 'module' => array('text' => '{LNG_Module}', 'class' => 'center')), 'cols' => array('language' => array('class' => 'center'), 'module' => array('class' => 'center')), 'action' => 'index.php/index/model/mailtemplate/action', 'actionConfirm' => 'confirmAction', 'buttons' => array('edit' => array('class' => 'icon-edit button green', 'href' => self::$request->getUri()->withParams(array('module' => 'mailwrite', 'id' => ':id'), true), 'text' => '{LNG_Edit}'), 'delete' => array('class' => 'icon-delete button red', 'id' => ':id', 'text' => '{LNG_Delete}'))));
     return $table->render();
 }