<h3>Master Data Riwayat Pangkat</h3>
<?php 
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
$asset = new CMS_Asset();
foreach ($css_files as $file) {
    $asset->add_css($file);
}
echo $asset->compile_css();
foreach ($js_files as $file) {
    $asset->add_js($file);
}
echo $asset->compile_js();
echo $output;
Exemplo n.º 2
0
    <head>
        <meta charset="utf-8">
        <title><?php 
echo $template['title'];
?>
</title>
        <?php 
echo $template['metadata'];
?>
        <link rel="icon" href="{{ site_favicon }}">
        <!-- Le styles -->
        <?php 
echo $template['css'];
$asset = new CMS_Asset();
if ($__is_bootstrap_cdn_connected) {
    $asset->add_css('//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css');
} else {
    $asset->add_cms_css('bootstrap/css/bootstrap.min.css');
}
$asset->add_themes_css('bootstrap.min.css', '{{ used_theme }}', 'default');
$asset->add_themes_css('style.css', '{{ used_theme }}', 'default');
echo $asset->compile_css();
?>
        <!-- Le fav and touch icons -->
        <link rel="shortcut icon" href="{{ site_favicon }}">
        <style type="text/css">{{ widget_name:section_custom_style }}</style>
    </head>
    <body>
        <?php 
echo $template['js'];
if ($__is_bootstrap_cdn_connected) {
 public function index()
 {
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // initialize groceryCRUD
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud = $this->new_crud();
     // this is just for code completion
     if (FALSE) {
         $crud = new Extended_Grocery_CRUD();
     }
     // check state & get primary_key
     $state = $crud->getState();
     $state = $crud->getState();
     $state_info = $crud->getStateInfo();
     $primary_key = isset($state_info->primary_key) ? $state_info->primary_key : NULL;
     switch ($state) {
         case 'unknown':
             break;
         case 'list':
             break;
         case 'add':
             break;
         case 'edit':
             break;
         case 'delete':
             break;
         case 'insert':
             break;
         case 'update':
             break;
         case 'ajax_list':
             break;
         case 'ajax_list_info':
             break;
         case 'insert_validation':
             break;
         case 'update_validation':
             break;
         case 'upload_file':
             break;
         case 'delete_file':
             break;
         case 'ajax_relation':
             break;
         case 'ajax_relation_n_n':
             break;
         case 'success':
             break;
         case 'export':
             break;
         case 'print':
             break;
     }
     // unset things
     $crud->unset_jquery();
     $crud->unset_read();
     // $crud->unset_add();
     // $crud->unset_edit();
     // $crud->unset_list();
     // $crud->unset_back_to_list();
     // $crud->unset_print();
     // $crud->unset_export();
     // set model
     // $crud->set_model($this->cms_module_path().'/grocerycrud_main_language_model');
     // adjust groceryCRUD's language to No-CMS's language
     $crud->set_language($this->cms_language());
     // table name
     $crud->set_table(cms_table_name('main_language'));
     // set subject
     $crud->set_subject('Language');
     // displayed columns on list
     $crud->columns('name', 'code', 'iso_code', 'translations');
     // displayed columns on edit operation
     $crud->edit_fields('name', 'code', 'iso_code', 'translations');
     // displayed columns on add operation
     $crud->add_fields('name', 'code', 'iso_code', 'translations');
     // caption of each columns
     $crud->display_as('name', 'Name');
     $crud->display_as('iso_code', 'ISO Code');
     $crud->display_as('translations', 'Translations');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put required field validation codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/required_fields)
     // eg:
     //      $crud->required_fields( $field1, $field2, $field3, ... );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->required_fields('name', 'code');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put required field validation codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/unique_fields)
     // eg:
     //      $crud->unique_fields( $field1, $field2, $field3, ... );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->unique_fields('name', 'code', 'iso_code');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put field validation codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_rules)
     // eg:
     //      $crud->set_rules( $field_name , $caption, $filter );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put set relation (lookup) codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation)
     // eg:
     //      $crud->set_relation( $field_name , $related_table, $related_title_field , $where , $order_by );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put set relation_n_n (detail many to many) codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n)
     // eg:
     //      $crud->set_relation_n_n( $field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table,
     //          $primary_key_alias_to_selection_table , $title_field_selection_table, $priority_field_relation );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put custom field type here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/field_type)
     // eg:
     //      $crud->field_type( $field_name , $field_type, $value  );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put callback here
     // (documentation: httm://www.grocerycrud.com/documentation/options_functions)
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->callback_before_insert(array($this, '_before_insert'));
     $crud->callback_before_update(array($this, '_before_update'));
     $crud->callback_before_delete(array($this, '_before_delete'));
     $crud->callback_after_insert(array($this, '_after_insert'));
     $crud->callback_after_update(array($this, '_after_update'));
     $crud->callback_after_delete(array($this, '_after_delete'));
     $crud->callback_column('translations', array($this, '_callback_column_translations'));
     $crud->callback_field('translations', array($this, '_callback_field_translations'));
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put custom error message here
     // (documentation: httm://www.grocerycrud.com/documentation/set_lang_string)
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // $crud->set_lang_string('delete_error_message', 'Cannot delete the record');
     // $crud->set_lang_string('update_error',         'Cannot edit the record'  );
     // $crud->set_lang_string('insert_error',         'Cannot add the record'   );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // render
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $output = $crud->render();
     // prepare css & js, add them to config
     $config = array();
     $asset = new CMS_Asset();
     foreach ($output->css_files as $file) {
         $asset->add_css($file);
     }
     $config['css'] = $asset->compile_css();
     foreach ($output->js_files as $file) {
         $asset->add_js($file);
     }
     $config['js'] = $asset->compile_js();
     // show the view
     $this->view($this->cms_module_path() . '/language/manage_main_language_view', $output, $this->cms_complete_navigation_name('main_language_management'), $config);
 }
Exemplo n.º 4
0
 public function config()
 {
     $this->cms_guard_page('main_config_management');
     $crud = $this->new_crud();
     $crud->unset_jquery();
     $crud->set_table(cms_table_name('main_config'));
     $crud->set_subject($this->cms_lang('Configuration'));
     $crud->unique_fields('config_name');
     $crud->unset_read();
     $crud->unset_delete();
     $crud->columns('config_name', 'value');
     $crud->edit_fields('config_name', 'value', 'description');
     $crud->add_fields('config_name', 'value', 'description');
     $crud->display_as('config_name', 'Configuration Key')->display_as('value', 'Configuration Value')->display_as('description', 'Description');
     $crud->unset_texteditor('description');
     $crud->unset_texteditor('value');
     $operation = $crud->getState();
     if ($operation == 'edit' || $operation == 'update' || $operation == 'update_validation') {
         $crud->field_type('config_name', 'readonly');
         $crud->field_type('description', 'readonly');
     } else {
         if ($operation == 'add' || $operation == 'insert' || $operation == 'insert_validation') {
             //$crud->set_rules('config_name', 'Configuration Key', 'required');
             $crud->required_fields('config_name');
         }
     }
     $crud->callback_after_insert(array($this, 'after_insert_config'));
     $crud->callback_after_update(array($this, 'after_update_config'));
     $crud->callback_before_delete(array($this, 'before_delete_config'));
     $crud->set_language($this->cms_language());
     $output = $crud->render();
     // prepare css & js, add them to config
     $config = array();
     $asset = new CMS_Asset();
     foreach ($output->css_files as $file) {
         $asset->add_css($file);
     }
     $config['css'] = $asset->compile_css();
     foreach ($output->js_files as $file) {
         $asset->add_js($file);
     }
     $config['js'] = $asset->compile_js();
     // show the view
     $this->view('main/main_config', $output, 'main_config_management', $config);
 }
Exemplo n.º 5
0
 public function index()
 {
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // initialize groceryCRUD
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud = $this->new_crud();
     $crud->unset_jquery();
     $crud->unset_print();
     $crud->unset_export();
     // set model
     // $crud->set_model($this->cms_module_path().'/grocerycrud_category_model');
     // adjust groceryCRUD's language to No-CMS's language
     $crud->set_language($this->cms_language());
     // table name
     $crud->set_table($this->cms_complete_table_name('category'));
     // set subject
     $crud->set_subject('Category');
     // displayed columns on list
     $crud->columns('category_name', 'description', 'articles');
     // displayed columns on edit operation
     $crud->edit_fields('category_name', 'description', 'articles');
     // displayed columns on add operation
     $crud->add_fields('category_name', 'description', 'articles');
     // required field
     $crud->required_fields('category_name');
     $crud->unique_fields('category_name');
     $crud->unset_read();
     // caption of each columns
     $crud->display_as('category_name', 'Category Name');
     $crud->display_as('description', 'Description');
     $crud->display_as('articles', 'Articles');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put set relation (lookup) codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation)
     // eg:
     // 		$crud->set_relation( $field_name , $related_table, $related_title_field , $where , $order_by );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put set relation_n_n (detail many to many) codes here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n)
     // eg:
     // 		$crud->set_relation_n_n( $field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table,
     // 			$primary_key_alias_to_selection_table , $title_field_selection_table, $priority_field_relation );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->set_relation_n_n('articles', $this->cms_complete_table_name('category_article'), $this->cms_complete_table_name('article'), 'category_id', 'article_id', 'article_title', NULL);
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put custom field type here
     // (documentation: http://www.grocerycrud.com/documentation/options_functions/field_type)
     // eg:
     // 		$crud->field_type( $field_name , $field_type, $value  );
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->unset_texteditor('description');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // HINT: Put callback here
     // (documentation: httm://www.grocerycrud.com/documentation/options_functions)
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud->callback_before_insert(array($this, 'before_insert'));
     $crud->callback_before_update(array($this, 'before_update'));
     $crud->callback_before_delete(array($this, 'before_delete'));
     $crud->callback_after_insert(array($this, 'after_insert'));
     $crud->callback_after_update(array($this, 'after_update'));
     $crud->callback_after_delete(array($this, 'after_delete'));
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // render
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $output = $crud->render();
     // prepare css & js, add them to config
     $config = array();
     $asset = new CMS_Asset();
     foreach ($output->css_files as $file) {
         $asset->add_css($file);
     }
     $config['css'] = $asset->compile_css();
     foreach ($output->js_files as $file) {
         $asset->add_js($file);
     }
     $config['js'] = $asset->compile_js();
     // show the view
     $this->view($this->cms_module_path() . '/manage_category_view', $output, $this->cms_complete_navigation_name('manage_category'), $config);
 }
Exemplo n.º 6
0
 public function video()
 {
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // initialize groceryCRUD
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $crud = $this->new_crud();
     $crud->unset_edit();
     $crud->unset_jquery();
     $crud->unset_print();
     $crud->unset_export();
     // adjust groceryCRUD's language to No-CMS's language
     $crud->set_language($this->cms_language());
     // table name
     $crud->set_table($this->cms_complete_table_name('video'));
     // set subject
     $crud->set_subject('Video');
     // displayed columns on list
     $crud->columns('nama', 'link');
     // displayed columns on add operation
     $crud->add_fields('nama');
     $crud->required_fields('nama');
     $crud->unset_read();
     // caption of each columns
     $crud->display_as('nama', 'File Video');
     $crud->callback_after_delete(array($this, 'after_delete'));
     $crud->callback_column('nama', array($this, 'callback_column_nama'));
     $crud->callback_column('link', array($this, 'callback_column_link'));
     $crud->set_field_upload('nama', 'modules/blog/assets/uploads/video');
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // render
     //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $output = $crud->render();
     // prepare css & js, add them to config
     $config = array();
     $asset = new CMS_Asset();
     foreach ($output->css_files as $file) {
         $asset->add_css($file);
     }
     $config['css'] = $asset->compile_css();
     foreach ($output->js_files as $file) {
         $asset->add_js($file);
     }
     $config['js'] = $asset->compile_js();
     // show the view
     $this->view($this->cms_module_path() . '/manage_video_view', $output, $this->cms_complete_navigation_name('manage_video'), $config);
 }