ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç themes.php000064400000004003152266765400006554 0ustar00load->view('backend/grid_index');?> menus.php000064400000050326152266765400006427 0ustar00

'.$sub_title.'' : ''?>

TAUTAN

HALAMAN

KATEGORI TULISAN

KATEGORI FILE

MODUL

$value) { echo '
'; echo ''; echo '
'; } ?>
Themes.php000064400000013725152270513130006511 0ustar00load->model('m_themes'); $this->pk = M_themes::$pk; $this->table = M_themes::$table; } /** * Index * @return Void */ public function index() { $this->vars['title'] = 'Tema'; $this->vars['appearance'] = $this->vars['themes'] = TRUE; $this->vars['content'] = 'appearance/themes'; $this->load->view('backend/index', $this->vars); } /** * Pagination * @return Object */ public function pagination() { if ($this->input->is_ajax_request()) { $keyword = trim($this->input->post('keyword', true)); $page_number = _toInteger($this->input->post('page_number', true)); $limit = _toInteger($this->input->post('per_page', true)); $offset = ($page_number * $limit); $query = $this->m_themes->get_where($keyword, 'rows', $limit, $offset); $total_rows = $this->m_themes->get_where($keyword); $total_page = $limit > 0 ? ceil(_toInteger($total_rows) / _toInteger($limit)) : 1; $this->vars['total_page'] = _toInteger($total_page); $this->vars['total_rows'] = _toInteger($total_rows); $this->vars['rows'] = $query->result(); $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } // /** * Save | Update * @return Object */ public function save() { if ($this->input->is_ajax_request()) { $id = _toInteger($this->input->post('id', true)); if ($this->validation()) { $dataset = $this->dataset(); $dataset[(_isNaturalNumber( $id ) ? 'updated_by' : 'created_by')] = __session('user_id'); if (!_isNaturalNumber( $id )) $dataset['created_at'] = date('Y-m-d H:i:s'); $query = $this->model->upsert($id, $this->table, $dataset); $this->vars['status'] = $query ? 'success' : 'error'; $this->vars['message'] = $query ? 'Data Anda berhasil disimpan.' : 'Terjadi kesalahan dalam menyimpan data'; if ($this->vars['status'] == 'success' && $dataset['is_active'] == 'true') { $this->m_themes->deactivate_themes($id); } } else { $this->vars['status'] = 'error'; $this->vars['message'] = validation_errors(); } $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Dataset * @return Array */ private function dataset() { return [ 'theme_name' => $this->input->post('theme_name', true), 'theme_folder' => trim(strtolower($this->input->post('theme_folder', true))), 'theme_author' => $this->input->post('theme_author', true), 'is_active' => $this->input->post('is_active', true) ]; } /** * Validation Form * @return Boolean */ private function validation() { $this->load->library('form_validation'); $val = $this->form_validation; $val->set_rules('theme_name', 'Theme Name', 'trim|required'); $val->set_rules('theme_folder', 'Theme Folder', 'trim|required'); $val->set_rules('theme_author', 'Author', 'trim|required'); $val->set_error_delimiters('
⋅ ', '
'); return $val->run(); } /** * Upload * @return Void */ public function upload() { if ($this->input->is_ajax_request()) { $id = _toInteger($this->input->post('id', true)); if (_isNaturalNumber( $id )) { $query = $this->model->RowObject($this->pk, $id, $this->table); $config['upload_path'] = './views/themes/'; $config['allowed_types'] = 'zip'; $config['max_size'] = 0; $config['encrypt_name'] = false; $this->load->library('upload', $config); if ( ! $this->upload->do_upload('file')) { $this->vars['status'] = 'error'; $this->vars['message'] = $this->upload->display_errors(); } else { $file = $this->upload->data(); if ($query->theme_folder == $file['raw_name']) { $zip = new ZipArchive; if ($zip->open(VIEWPATH . 'themes/' . $file['file_name'])) { $zip->extractTo(VIEWPATH . 'themes/'); $zip->close(); // chmod Theme Folder $this->chmod_themes('./views/themes/'.$file['raw_name']); $this->vars['status'] = 'success'; $this->vars['message'] = 'extracted'; } else { $this->vars['status'] = 'error'; $this->vars['message'] = 'not_extracted'; } } else { $this->vars['status'] = 'warning'; $this->vars['message'] = 'Nama file yang diupload tidak sama dengan "'. $query->theme_folder.'"'; } // Delete ZIP File @chmod('./views/themes/' . $file['file_name'], 0777); @unlink('./views/themes/' . $file['file_name']); } } else { $this->vars['status'] = 'error'; $this->vars['message'] = 'ID bukan merupakan tipe angka yang valid !'; } $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * chmod Theme Folder * @param String * @return Void */ private function chmod_themes($path) { @chmod($path, 0777); $dir = new DirectoryIterator($path); foreach ($dir as $item) { @chmod($item->getPathname(), 0777); if ($item->isDir() && !$item->isDot()) { $this->chmod_themes($item->getPathname()); } } } } Menus.php000064400000027161152270513130006352 0ustar00load->model('m_menus'); $this->pk = M_menus::$pk; $this->table = M_menus::$table; } /** * Index * @return Void */ public function index() { $this->vars['title'] = 'Menu'; $this->vars['appearance'] = $this->vars['menus'] = TRUE; $this->vars['content'] = 'appearance/menus'; $this->load->view('backend/index', $this->vars); } /** * Get All Menus * @return Object */ public function get_menus() { if ($this->input->is_ajax_request()) { $query = $this->m_menus->get_menus(); $this->vars['rows'] = $query->result(); $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Get All Pages * @return Object */ public function get_pages() { if ($this->input->is_ajax_request()) { $this->load->model('m_pages'); $query = $this->m_pages->get_pages(); $this->vars['rows'] = $query->result(); $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Get All Post Categories * @return Object */ public function get_post_categories() { if ($this->input->is_ajax_request()) { $this->load->model('m_categories'); $query = $this->m_categories->get_categories('post'); $this->vars['rows'] = $query->result(); $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Get All File Categories * @return Object */ public function get_file_categories() { if ($this->input->is_ajax_request()) { $this->load->model('m_categories'); $query = $this->m_categories->get_categories('file'); $this->vars['rows'] = $query->result(); $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Delete Menus Permanently * @return Object */ public function delete_permanently() { if ($this->input->is_ajax_request()) { $id = _toInteger($this->input->post('id', true)); if (_isNaturalNumber( $id )) { $is_exists = $this->model->is_exists('menu_parent_id', $id, $this->table); if ( ! $is_exists ) { $this->model->delete_permanently($this->pk, $id, $this->table); $this->vars['status'] = $this->model->delete_permanently($this->pk, $id, $this->table) ? 'success' : 'error'; $this->vars['message'] = $this->vars['status'] == 'success' ? 'deleted' : 'not_deleted'; } else { $this->vars['status'] = 'warning'; $this->vars['message'] = '"Parent menu" tidak dapat dihapus. Silahkan hapus terlebih dahulu "child menu"!'; } } else { $this->vars['status'] = 'error'; $this->vars['message'] = 'Not initialize id OR id not a number'; } $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Truncate table menus * @return Object */ public function truncate_table() { if ($this->input->is_ajax_request()) { $this->vars['status'] = $this->model->truncate($this->table) ? 'success' : 'error'; $this->vars['message'] = $this->vars['status'] == 'success' ? 'deleted' : 'not_deleted'; $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Get Nested Menus * @return Object */ public function nested_menus() { if ($this->input->is_ajax_request()) { $query = $this->m_menus->nested_menus(); $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($query, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Save menu position * @return Object */ public function save_menu_position() { if ($this->input->is_ajax_request()) { if (NULL !== $this->input->post('menus')) { $menus = json_decode($this->input->post('menus'), true); $this->m_menus->save_menu_position(0, $menus); } $this->vars['status'] = 'success'; $this->vars['message'] = 'Your data have been saved.'; $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Save Custom Links * @return Object */ public function save_links() { if ($this->input->is_ajax_request()) { $this->db->set('menu_url', ($this->input->post('menu_url', true) && $this->input->post('menu_url', true) != '#') ? prep_url($this->input->post('menu_url', true)) : '#'); $this->db->set('menu_title', $this->input->post('menu_title', true)); $this->db->set('menu_target', $this->input->post('menu_target', true)); $this->db->set('menu_type', 'links'); $this->db->set('created_at', date('Y-m-d H:i:s')); $this->db->set('created_by', __session('user_id')); $this->vars['status'] = $this->db->insert($this->table) ? 'success' : 'error'; $this->vars['message'] = $this->vars['status'] == 'success' ? 'created' : 'not_created'; $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Save Menus From Pages * @return Object */ public function save_pages() { if ($this->input->is_ajax_request()) { $ids = explode(',', $this->input->post('ids')); foreach($ids as $id) { $query = $this->model->RowObject('id', $id, 'posts'); $this->db->set('menu_title', $query->post_title); $this->db->set('menu_url', 'read/' . $id . '/'.$query->post_slug); $this->db->set('menu_type', 'pages'); $this->db->set('menu_target', '_self'); $this->db->set('created_at', date('Y-m-d H:i:s')); $this->db->set('created_by', __session('user_id')); $this->db->insert($this->table); } $this->vars['status'] = 'success'; $this->vars['message'] = 'created'; $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Save Menus From Posts Categories * @return Object */ public function save_post_categories() { if ($this->input->is_ajax_request()) { $ids = explode(',', $this->input->post('ids')); foreach($ids as $id) { $query = $this->model->RowObject('id', $id, 'categories'); $this->db->set('menu_title', $query->category_name); $this->db->set('menu_url', 'kategori/'.$query->category_slug); $this->db->set('menu_type', 'post_categories'); $this->db->set('menu_target', '_self'); $this->db->set('created_at', date('Y-m-d H:i:s')); $this->db->set('created_by', __session('user_id')); $this->db->insert($this->table); } $this->vars['status'] = 'success'; $this->vars['message'] = 'created'; $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Save Menus From File Categories * @return Object */ public function save_file_categories() { if ($this->input->is_ajax_request()) { $ids = explode(',', $this->input->post('ids')); foreach($ids as $id) { $query = $this->model->RowObject('id', $id, 'categories'); $this->db->set('menu_title', $query->category_name); $this->db->set('menu_url', 'download/'.$query->category_slug); $this->db->set('menu_type', 'file_categories'); $this->db->set('menu_target', '_self'); $this->db->set('created_at', date('Y-m-d H:i:s')); $this->db->set('created_by', __session('user_id')); $this->db->insert($this->table); } $this->vars['status'] = 'success'; $this->vars['message'] = 'created'; $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Save Menus From List Modules * @return Object */ public function save_modules() { if ($this->input->is_ajax_request()) { $modules = explode(',', $this->input->post('modules')); foreach($modules as $module) { $this->db->set('menu_title', modules($module)); $this->db->set('menu_url', $module); $this->db->set('menu_type', 'modules'); $this->db->set('menu_target', '_self'); $this->db->set('created_at', date('Y-m-d H:i:s')); $this->db->set('created_by', __session('user_id')); $this->db->insert($this->table); } $this->vars['status'] = 'success'; $this->vars['message'] = 'created'; $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Save | Update * @return Object */ public function save() { if ($this->input->is_ajax_request()) { $id = _toInteger($this->input->post('id', true)); if ($this->validation()) { $dataset = $this->dataset(); $dataset['updated_by'] = __session('user_id'); $this->vars['status'] = $this->model->update($id, $this->table, $dataset) ? 'success' : 'error'; $this->vars['message'] = $this->vars['status'] == 'success' ? 'updated' : 'not_updated'; } else { $this->vars['status'] = 'error'; $this->vars['message'] = validation_errors(); } $this->output ->set_content_type('application/json', 'utf-8') ->set_output(json_encode($this->vars, JSON_HEX_APOS | JSON_HEX_QUOT)) ->_display(); exit; } } /** * Dataset * @return Array */ private function dataset() { $dataset = []; $dataset['menu_title'] = $this->input->post('menu_title', true); $dataset['menu_url'] = $this->input->post('menu_url', true); $dataset['menu_target'] = $this->input->post('menu_target', true); $is_deleted = $this->input->post('is_deleted'); $dataset['is_deleted'] = $is_deleted; if (filter_var((string) $is_deleted, FILTER_VALIDATE_BOOLEAN)) { $dataset['deleted_by'] = __session('user_id'); $dataset['deleted_at'] = date('Y-m-d H:i:s'); } else { $dataset['restored_by'] = __session('user_id'); $dataset['restored_at'] = date('Y-m-d H:i:s'); } return $dataset; } /** * Validation Form * @return Boolean */ private function validation() { $this->load->library('form_validation'); $val = $this->form_validation; $val->set_rules('menu_title', 'Judul Menu', 'trim|required'); $val->set_rules('menu_url', 'URL', 'trim|required'); $val->set_rules('menu_target', 'Target', 'trim|required'); $val->set_rules('is_deleted', 'Aktif ?', 'trim|required|in_list[true,false]'); $val->set_error_delimiters('
⋅ ', '
'); return $val->run(); } }