function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $fields['last_modified']['type'] = 'hidden';
     $fields['date_added']['type'] = 'hidden';
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $fields['video_name']['required'] = TRUE;
     $fields['video_path']['required'] = TRUE;
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields($values);
     $CI =& get_instance();
     $CI->load->module_model(BLOG_FOLDER, 'blog_users_model');
     $blog_config = $CI->fuel->blog->config();
     $user_options = $CI->blog_users_model->options_list();
     $user = $this->fuel->auth->user_data();
     $user_value = !empty($values['author_id']) ? $values['author_id'] : $user['id'];
     $author_comment = $fields['author_id']['comment'];
     $fields['author_id'] = array('label' => 'Author', 'type' => 'select', 'options' => $user_options, 'first_option' => 'Select an author...', 'value' => $user_value, 'comment' => $author_comment);
     if (!isset($values['allow_comments'])) {
         $fields['allow_comments']['value'] = $CI->fuel->blog->config('allow_comments') ? 'yes' : 'no';
     }
     if (!empty($blog_config['formatting'])) {
         $blog_config['formatting'] = (array) $blog_config['formatting'];
         if (count($blog_config['formatting']) == 1) {
             $fields['formatting'] = array('type' => 'hidden', 'options' => current($blog_config['formatting']), 'default' => $fields['formatting']['default']);
             if (strtolower($blog_config['formatting'][0]) == 'markdown') {
                 $fields['content']['markdown'] = TRUE;
                 $fields['excerpt']['markdown'] = TRUE;
             }
         } else {
             $fields['formatting'] = array('type' => 'select', 'options' => $blog_config['formatting'], 'default' => $fields['formatting']['default']);
         }
     }
     $fields['title']['style'] = 'width: 500px;';
     $fields['slug']['style'] = 'width: 500px;';
     $fields['content']['style'] = 'width: 680px; height: 400px';
     $fields['excerpt']['style'] = 'width: 680px;';
     $fields['published']['order'] = 10000;
     if (!is_true_val($CI->fuel->blog->config('allow_comments'))) {
         unset($fields['allow_comments']);
     }
     unset($fields['content_filtered']);
     $fields['date_added']['type'] = 'hidden';
     // so it will auto add
     //$fields['date_added']['type'] = 'datetime'; // so it will auto add
     $fields['last_modified']['type'] = 'hidden';
     // so it will auto add
     $fields['slug']['order'] = 2.5;
     // for older versions where the schema order was different
     $fields['main_image']['folder'] = $CI->fuel->blog->config('asset_upload_path');
     $fields['main_image']['img_styles'] = 'float: left; width: 200px;';
     $fields['list_image']['folder'] = $CI->fuel->blog->config('asset_upload_path');
     $fields['list_image']['img_styles'] = 'float: left; width: 100px;';
     $fields['thumbnail_image']['folder'] = $CI->fuel->blog->config('asset_upload_path');
     $fields['thumbnail_image']['img_styles'] = 'float: left; width: 60px;';
     if (empty($fields['post_date']['value'])) {
         $fields['post_date']['value'] = datetime_now();
     }
     $fields['blocks']['sorting'] = TRUE;
     if (!empty($values['id'])) {
         unset($fields['related_posts']['options'][$values['id']]);
     }
     if ($CI->fuel->blog->config('multiple_authors')) {
         unset($fields['author_id']);
     }
     return $fields;
 }
Example #4
0
 public function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     $fields['publish_date']['comment'] = 'If blank, will default to current date/time';
     $fields['publish_date']['value'] = datetime_now();
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->module_model(BLOG_FOLDER, 'blog_users_model');
     $CI->load->module_model(BLOG_FOLDER, 'blog_posts_model');
     $post_title = '';
     $post_options = $CI->blog_posts_model->options_list('id', 'title', array(), 'date_added desc');
     if (empty($post_options)) {
         return lang('blog_error_no_posts_to_comment');
     }
     $fields['post_id'] = array('type' => 'select', 'options' => $post_options, 'label' => 'Post');
     if (!empty($values['id'])) {
         $post = $CI->blog_posts_model->find_by_key($values['post_id']);
         $post_title = $post->title;
         if (!$post->is_published()) {
             add_error(lang('blog_post_is_not_published'));
         }
         $fields['post_id'] = array('type' => 'hidden', 'value' => $post_title, 'displayonly' => TRUE);
         $fields['post_title'] = array('label' => 'Post', 'value' => $post_title, 'order' => 1);
         $fields['post_title']['displayonly'] = TRUE;
         $fields['post_published']['displayonly'] = TRUE;
         $fields['author_email']['displayonly'] = TRUE;
         $fields['author_name']['displayonly'] = TRUE;
         $fields['post_title']['displayonly'] = TRUE;
         $fields['author_website']['displayonly'] = TRUE;
         $fields['ip_host']['displayonly'] = TRUE;
         $fields['date_submitted'] = array('displayonly' => TRUE, 'value' => english_date($values['date_added'], TRUE));
         $ip_host = !empty($values['author_ip']) ? gethostbyaddr($values['author_ip']) . ' (' . $values['author_ip'] . ')' : '';
         $fields['ip_host'] = array('label' => 'IP/Host', 'value' => $ip_host, 'order' => 5, 'displayonly' => TRUE);
         $fields['Reply to this Comment'] = array('type' => 'section');
         $replies = $this->find_all_array(array('parent_id' => $values['id']));
         $reply_arr = array();
         foreach ($replies as $r) {
             $reply_arr[] = $r['content'];
         }
         $fields['replies'] = array('label' => 'Replies', 'displayonly' => TRUE, 'value' => implode('<br /><br />', $reply_arr));
         if ($values['author_id'] == $CI->fuel_auth->user_data('id') or $CI->fuel_auth->is_super_admin()) {
             $fields['reply'] = array('label' => 'Reply', 'type' => 'textarea');
             $notify_options = array('Commentor' => lang('blog_comment_notify_option2'), 'All' => lang('blog_comment_notify_option1'), 'None' => lang('blog_comment_notify_option3'));
             $fields['reply_notify'] = array('label' => 'Notfiy', 'type' => 'enum', 'options' => $notify_options);
         }
         // hidden
         $fields['author_ip'] = array('type' => 'hidden');
     } else {
         $fields['author_ip'] = array('type' => 'hidden', 'value' => $_SERVER['REMOTE_ADDR'], 'label' => 'Author IP Address');
         $fields['is_spam'] = array('type' => 'hidden');
         $fields['date_added']['type'] = 'hidden';
         // so it will auto add
         $fields['last_modified']['type'] = 'hidden';
         // so it will auto add
     }
     // set author to current fuel user
     if (empty($fields['author_id']) and $CI->fuel_auth->user_data('id')) {
         $fields['author_id'] = array('value' => $CI->fuel_auth->user_data('id'));
     }
     $fields['author_id'] = array('type' => 'hidden');
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     foreach ($fields as &$f) {
         $f['displayonly'] = true;
     }
     return $fields;
 }
 function form_fields()
 {
     $fields = parent::form_fields();
     $fields['url']['label'] = 'URL';
     $fields['icon'] = array('type' => 'select', 'options' => $this->get_icons(), 'first_option' => 'Select an icon...', 'required' => TRUE, 'after_html' => '<i id="icon-preview" class=""></i>');
     $fields['color'] = array('type' => 'colorpicker');
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $upload_path = assets_server_path('authors/', 'images');
     $fields['avatar_upload'] = array('type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE);
     $fields['published']['order'] = 1000;
     return $fields;
 }
 function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     $fields['post_date']['comment'] = 'If blank, will default to current date/time';
     $fields['post_date']['value'] = datetime_now();
     $fields['skillset_requirements']['class'] = 'no_editor';
     return $fields;
 }
Example #10
0
 public function form_fields()
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->helper('directory');
     $CI->load->helper('file');
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     //$fields['published']['order'] = 1000;
     $upload_path = ltrim(assets_server_path('i_property/', 'images'), "/");
     $fields['Property_info_image'] = array('type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE, 'xss_clean' => TRUE, 'allowed_types' => 'jpg|jpeg|bmp|png|gif');
     return $fields;
 }
 public function form_fields($values = array(), $related = array())
 {
     $CI =& get_instance();
     $fields = parent::form_fields($values, $related);
     $fields['form_name']['options'] = $CI->fuel->forms->options_list();
     $fields['post']['type'] = 'keyval';
     return $fields;
 }
Example #13
0
 function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     // ******************* ADD CUSTOM FORM STUFF HERE *******************
     $fields['content']['img_folder'] = 'articles/';
     $fields['image']['folder'] = 'images/articles/';
     $fields['thumb_image']['folder'] = 'images/articles/thumbs/';
     return $fields;
 }
Example #14
0
 function form_fields($values = null)
 {
     $fields = parent::form_fields();
     unset($fields['super_admin']);
     // save reference it so we can reorder
     $pwd_field = $fields['password'];
     unset($fields['password']);
     $user_id = NULL;
     if (!empty($values['id'])) {
         $user_id = $values['id'];
     }
     if (!empty($user_id)) {
         $fields['new_password'] = array('type' => 'password', 'size' => 20, 'order' => 5);
     } else {
         $pwd_field['type'] = 'password';
         $pwd_field['size'] = 20;
         $fields['password'] = $pwd_field;
         $fields['password']['order'] = 5;
     }
     $fields['user_name']['order'] = 1;
     $fields['email']['order'] = 2;
     $fields['first_name']['order'] = 3;
     $fields['last_name']['order'] = 4;
     $fields['confirm_password'] = array('type' => 'password', 'size' => 20, 'order' => 6);
     $fields['active']['order'] = 7;
     // get permissions
     $CI =& get_instance();
     $perm_fields = array();
     $user = $CI->fuel_auth->user_data();
     //if (($CI->fuel_auth->is_super_admin() AND ($user['id'] != $user_id)) AND (!empty($values['super_admin']) AND $values['super_admin'] != 'yes'))
     if ($CI->fuel_auth->is_super_admin() and $user['id'] != $user_id or !$CI->fuel_auth->is_super_admin() and $CI->fuel_auth->has_permission('permissions')) {
         $CI->load->module_model(FUEL_FOLDER, 'user_to_permissions_model');
         $selected_perms = $CI->user_to_permissions_model->get_permissions($user_id, FALSE);
         // if (!empty($selected_perms))
         // {
         $fields['Permissions'] = array('type' => 'section', 'order' => 10);
         //			}
         $CI->load->module_model(FUEL_FOLDER, 'permissions_model');
         $perms = $CI->permissions_model->find_all_array(array('active' => 'yes'), 'name asc');
         $order = 11;
         foreach ($perms as $val) {
             $perm_field = 'permissions_' . $val['id'];
             $perm_fields[$perm_field]['type'] = 'checkbox';
             $perm_fields[$perm_field]['value'] = $val['id'];
             $perm_fields[$perm_field]['order'] = $order;
             $perm_fields[$perm_field]['label'] = !empty($val['description']) ? $val['description'] : $val['name'];
             if (!empty($selected_perms[$val['id']])) {
                 $perm_fields[$perm_field]['checked'] = TRUE;
             }
             $order++;
         }
     }
     $fields = array_merge($fields, $perm_fields);
     unset($fields['reset_key']);
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $upload_path = assets_server_path('i_property/', 'images');
     $fields['category']['required'] = TRUE;
     $fields['category_path']['required'] = TRUE;
     $fields['category_icon'] = array('required' => TRUE, 'type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE, 'xss_clean' => TRUE, 'is_image' => TRUE, 'allowed_types' => 'jpg|jpeg|bmp|png|gif');
     $fields['category_mo_icon'] = array('required' => TRUE, 'type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE, 'xss_clean' => TRUE, 'is_image' => TRUE, 'allowed_types' => 'jpg|jpeg|bmp|png|gif');
     return $fields;
 }
Example #16
0
 public function form_fields($values = array(), $related = array())
 {
     $CI =& get_instance();
     $fields = parent::form_fields($values, $related);
     if (is_object($fields) && $fields instanceof Base_model_fields) {
         $fields =& $fields->get_fields();
     }
     $fields[$this->slug_field]['size'] = 100;
     if (isset($fields['title'])) {
         $fields['title']['size'] = 100;
     }
     if (isset($fields['pdf'])) {
         $fields['pdf']['type'] = 'asset';
         $fields['pdf']['folder'] = 'pdf';
         $fields['pdf']['comment'] = 'If the PDF field is filled in AND both the content AND link field are empty, this will be the URL for the post (3rd link priority)';
     }
     if (isset($fields['link'])) {
         $fields['link']['comment'] = 'If the link field is filled out and no content is entered, this will be the URL for the post (2nd link priority)';
     }
     if (isset($fields['content'])) {
         $fields['content']['comment'] = 'If the PDF field is filled in AND the link field is empty, this will be the URL for the post (1st link priority)';
         $fields['content']['img_folder'] = $this->name;
     }
     if (isset($fields['excerpt'])) {
         $fields['excerpt']['img_folder'] = $this->name;
     }
     if (isset($fields['category_id'])) {
         //$fields['category_id']['add_params'] = 'context='.$this->name;
         $fields['category_id']['type'] = 'toggler';
         $fields['category_id']['prefix'] = 'toggle_';
         $fields['category_id']['equalize_key_value'] = FALSE;
         $fields['category_id']['mode'] = 'select';
         $fields['category_id']['module'] = $this->name;
     }
     $possible_image_fields = array('image', 'main_image', 'list_image', 'thumbnail_image');
     foreach ($possible_image_fields as $img_field) {
         if (isset($fields[$img_field])) {
             $fields[$img_field]['folder'] = 'images/' . $this->name;
         }
     }
     if (isset($fields['image'])) {
         $fields['image']['hide_options'] = TRUE;
         $fields['image']['height'] = $this->img_height;
         $fields['image']['width'] = $this->img_width;
         $fields['image']['resize_method'] = 'resize_and_crop';
     }
     // add the context value automatically if creating a new tag
     // if (!empty($fields['tags']))
     // {
     // 	$fields['tags']['add_params'] = 'context='.$this->name;
     // }
     return $fields;
 }
 public function form_fields($values = array(), $related = array())
 {
     $CI =& get_instance();
     $fields = parent::form_fields($values, $related);
     $fields['form_name']['options'] = $CI->fuel->forms->options_list();
     $fields['post']['type'] = 'keyval';
     $fields['form_name']['displayonly'] = TRUE;
     $fields['url']['displayonly'] = TRUE;
     $fields['remote_ip']['displayonly'] = TRUE;
     $fields['post'] = array('type' => 'custom', 'func' => array($this, 'format_post'));
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->model('authors_model');
     $CI->load->model('categories_model');
     $CI->load->model('categories_to_articles_model');
     $category_options = $CI->categories_model->options_list('id', 'name', array('published' => 'yes'), 'name');
     $category_values = !empty($values['id']) ? array_keys($CI->categories_to_articles_model->find_all_array_assoc('category_id', array('article_id' => $values['id'], 'categories.published' => 'yes'))) : array();
     $fields['categories'] = array('label' => 'Categories', 'type' => 'array', 'class' => 'add_edit categories', 'options' => $category_options, 'value' => $category_values, 'mode' => 'multi');
     if ($CI->fuel_auth->has_permission('authors')) {
         $fields['author_id']['class'] = 'add_edit authors';
     }
     return $fields;
 }
 public function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     // general
     $fields['General'] = array('type' => 'fieldset', 'order' => 1, 'class' => 'tab');
     $fields['name']['order'] = 2;
     $fields['slug']['order'] = 3;
     $fields['save_entries']['order'] = 4;
     $fields['published']['order'] = 6;
     // form
     $fields['Form'] = array('type' => 'fieldset', 'order' => 100, 'class' => 'tab');
     $fields['form_display'] = array('type' => 'toggler', 'prefix' => 'toggle_', 'order' => 102, 'options' => array('auto' => 'auto', 'block' => 'block', 'html' => 'html'), 'comment' => 'Select which method you\'d like to use to render the form');
     $block_view_module = !empty($values['block_view_module']) ? $values['block_view_module'] : '';
     $block_view_module_field = array('name' => 'block_view_module', 'type' => 'select', 'options' => $this->fuel->modules->options_list(TRUE), 'first_option' => 'application', 'value' => $block_view_module);
     $module_view = $this->form_builder->create_select($block_view_module_field);
     $fields['block_view']['comment'] = 'The view file used to render the form. If no value is provided, then the form will be automatically generated. More information on the templating syntax and variables that get passed to the HTML and view file can be found in the documentation.';
     $fields['block_view']['after_html'] = ' in the ' . $module_view . ' module';
     $fields['block_view']['order'] = 103;
     $fields['block_view']['class'] = 'toggle toggle_block';
     $fields['form_html'] = array('type' => 'textarea', 'class' => 'toggle toggle_html', 'order' => 104, 'label' => 'Form HTML', 'comment' => 'Insert HTML code for your form. More information on the templating syntax and variables that get passed to the HTML and view file can be found in the documentation.');
     $fields['anti_spam_method'] = array('type' => 'block', 'block_name' => 'antispam', 'order' => 105, 'display_label' => FALSE, 'label' => 'Anti SPAM method', 'module' => FORMS_FOLDER);
     $fields['submit_button_text']['order'] = 106;
     $fields['reset_button_text']['order'] = 107;
     // fields
     $fields['Fields'] = array('type' => 'fieldset', 'order' => 200, 'class' => 'tab');
     $fields['inputs'] = array('order' => 201, 'display_label' => FALSE, 'type' => 'template', 'title_field' => 'label', 'fields' => array('section' => array('type' => 'section', 'value' => '__title__'), 'name' => array('required' => TRUE, 'comment' => 'The input field name (not to be confused with the field label).'), 'label' => array('comment' => 'If left blank, one will be added for you based on the above name value.'), 'field' => array('label' => 'Field type', 'type' => 'block', 'group' => 'Forms')), 'class' => 'repeatable', 'add_extra' => FALSE, 'repeatable' => TRUE, 'value' => array(array('name' => 'name', 'label' => 'Name', 'field' => array('block_name' => 'text'), 'required' => 1), array('name' => 'email', 'label' => 'Email', 'field' => array('block_name' => 'email'), 'required' => 1)));
     // fields
     $yes_no_options = array('yes' => 'yes', 'no' => 'no');
     $fields['Javascript'] = array('type' => 'fieldset', 'order' => 300, 'class' => 'tab');
     $fields['javascript_info'] = array('type' => 'copy', 'order' => 301, 'value' => 'Learn more about the jquery plugin used for javascript validation at <a href="http://jqueryvalidation.org/validate" target="blank">jqueryvalidation.org/validate</a>');
     $fields['javascript_submit'] = array('type' => 'enum', 'options' => $yes_no_options, 'order' => 302, 'comment' => 'Will submit the form via an AJAX post');
     $fields['javascript_validate'] = array('type' => 'enum', 'options' => $yes_no_options, 'order' => 303, 'comment' => 'Will run javascript validation before submission. More can be found here: http://jqueryvalidation.org/validate');
     $fields['javascript_waiting_message'] = array('order' => 305, 'value' => 'Sending...', 'comment' => 'The message to display while the form is being processed.');
     // after post
     $fields['After Submit'] = array('type' => 'fieldset', 'order' => 400, 'class' => 'tab');
     $fields['form_action'] = array('order' => 401, 'comment' => 'This field is irrevelant if the view contains the form tag and action. If no action is provided, the form will submit to itself.');
     $fields['after_submit_text']['order'] = 402;
     $fields['email_recipients']['order'] = 403;
     $fields['email_cc'] = array('label' => 'CC recipients', 'order' => 404);
     $fields['email_bcc'] = array('label' => 'BCC recipients', 'order' => 405);
     $fields['email_subject']['order'] = 406;
     $fields['email_message'] = array('type' => 'textarea', 'order' => 407, 'class' => 'no_editor', 'style' => 50);
     $fields['return_url'] = array('label' => 'Return URL', 'order' => 408);
     // remove unused
     unset($fields['block_view_module']);
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->module_model(FUEL_FOLDER, 'users_model');
     $CI->load->module_library(BLOG_FOLDER, 'fuel_blog');
     $options = $CI->users_model->options_list();
     $upload_image_path = assets_server_path($CI->fuel_blog->settings('asset_upload_path'));
     $fields['fuel_user_id'] = array('label' => 'User', 'type' => 'select', 'options' => $options);
     // put all project images into a projects suboflder.
     $fields['avatar_image_upload']['upload_path'] = assets_server_path($CI->fuel_blog->settings('asset_upload_path'));
     // fix the preview by adding projects in front of the image path since we are saving it in a subfolder
     if (!empty($values['avatar_image'])) {
         $fields['avatar_image_upload']['before_html'] = '<img src="' . assets_path($CI->fuel_blog->settings('asset_upload_path') . $values['avatar_image']) . '" style="float: right;"/>';
     }
     return $fields;
 }
Example #21
0
 function form_fields($values = array(), $related_fields = array())
 {
     $fields = parent::form_fields($values, $related_fields);
     $CI =& get_instance();
     $CI->load->module_model(FUEL_FOLDER, 'fuel_users_model');
     $CI->load->module_library(BLOG_FOLDER, 'fuel_blog');
     //use only fuel users not already chosen
     $where = !empty($values['fuel_user_id']) ? array('fuel_user_id !=' => $values['fuel_user_id']) : array();
     $already_used = array_keys($this->options_list('fuel_user_id', 'display_name', $where));
     if (!empty($already_used)) {
         $CI->fuel_users_model->db()->where_not_in('id', $already_used);
     }
     $options = $CI->fuel_users_model->options_list();
     $upload_image_path = assets_server_path($CI->fuel->blog->settings('asset_upload_path'));
     $fields['fuel_user_id'] = array('label' => 'User', 'type' => 'select', 'options' => $options, 'module' => 'users');
     return $fields;
 }
Example #22
0
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->module_library(BLOG_FOLDER, 'fuel_blog');
     $CI->load->module_model(BLOG_FOLDER, 'blog_users_model');
     $CI->load->module_model(BLOG_FOLDER, 'blog_categories_model');
     $CI->load->module_model(BLOG_FOLDER, 'blog_posts_to_categories_model');
     $blog_config = $CI->config->item('blog');
     $category_options = $CI->blog_categories_model->options_list('id', 'name', array('published' => 'yes'), 'name');
     $category_values = !empty($values['id']) ? array_keys($CI->blog_posts_to_categories_model->find_all_array_assoc('category_id', array('post_id' => $values['id'], $this->_tables['blog_categories'] . '.published' => 'yes'))) : array();
     $fields['categories'] = array('label' => 'Categories', 'type' => 'array', 'options' => $category_options, 'class' => 'add_edit blog/categories combo', 'value' => $category_values, 'mode' => 'multi');
     $user_options = $CI->blog_users_model->options_list();
     $user = $this->fuel_auth->user_data();
     $user_value = !empty($values['author_id']) ? $values['author_id'] : $user['id'];
     $author_comment = $fields['author_id']['comment'];
     $fields['author_id'] = array('label' => 'Author', 'type' => 'select', 'options' => $user_options, 'first_option' => 'Select an author...', 'value' => $user_value, 'comment' => $author_comment);
     if (!isset($values['allow_comments'])) {
         $fields['allow_comments']['value'] = $CI->fuel_blog->settings('allow_comments') ? 'yes' : 'no';
     }
     if (!empty($blog_config['formatting'])) {
         $blog_config['formatting'] = (array) $blog_config['formatting'];
         if (count($blog_config['formatting']) == 1) {
             $fields['formatting'] = array('type' => 'hidden', 'options' => current($blog_config['formatting']), 'default' => $fields['formatting']['default']);
         } else {
             $fields['formatting'] = array('type' => 'select', 'options' => $blog_config['formatting'], 'default' => $fields['formatting']['default']);
         }
     }
     $fields['published']['order'] = 10000;
     if (!is_true_val($CI->fuel_blog->settings('allow_comments'))) {
         unset($fields['allow_comments']);
     }
     $fields['upload_images'] = array('type' => 'file', 'class' => 'multifile', 'order' => 6, 'upload_path' => assets_server_path($CI->fuel_blog->settings('asset_upload_path')), 'comment' => 'Upload images to be used with your blog posts');
     unset($fields['content_filtered']);
     //$fields['date_added']['type'] = 'hidden'; // so it will auto add
     $fields['date_added']['type'] = 'datetime';
     // so it will auto add
     $fields['last_modified']['type'] = 'hidden';
     // so it will auto add
     $fields['permalink']['order'] = 2;
     // for older versions where the schema order was different
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $fields['username']['type'] = 'hidden';
     $fields['password']['type'] = 'hidden';
     $fields['new_password_key']['type'] = 'hidden';
     $fields['new_password_requested']['type'] = 'hidden';
     $fields['new_email']['type'] = 'hidden';
     $fields['new_email_key']['type'] = 'hidden';
     $fields['last_ip']['type'] = 'hidden';
     $fields['last_login']['type'] = 'hidden';
     $fields['created']['type'] = 'hidden';
     $fields['oldpassword']['type'] = 'hidden';
     $fields['modified']['type'] = 'hidden';
     $fields['displayname']['required'] = TRUE;
     $fields['phone']['required'] = TRUE;
     $fields['email']['required'] = TRUE;
     $fields['country_id']['required'] = TRUE;
     $fields['activated']['required'] = TRUE;
     $fields['banned']['required'] = TRUE;
     $fields['ban_reason']['required'] = FALSE;
     $fields['prop_listing_limit']['required'] = TRUE;
     return $fields;
 }
Example #24
0
	function form_fields($values = array())
	{
		$fields = parent::form_fields();
		$CI =& get_instance();
		// navigation group
		if (empty($CI->navigation_groups_model)){
			$CI->load->module_model(FUEL_FOLDER, 'navigation_groups_model');
		}
		$CI->load->helper('array');
		
		$group_options = options_list($CI->navigation_groups_model->find_all_array());
		$group_values = array_keys($group_options);
		$group_value = (!empty($group_values)) ? $group_values[0] : 1;

		$fields['group_id'] = array(
		'type' => 'select', 
		'options' => $group_options,
		'class' => 'add_edit navigation_group', 
		'comment' => 'The grouping of items you want to associate this navigation item to'
		);
		
		if (count($group_options) == 0)
		{
			$fields['group_id']['displayonly'] = TRUE;
		}

		if (empty($CI->pages_model))
		{
			$CI->load->module_model(FUEL_FOLDER, 'pages_model');
		}
		
		$this->load->helper('array');
		
		$parent_group = (!empty($values['group_id'])) ? $values['group_id'] : $group_value;
		$where['group_id'] = $parent_group;
		if (!empty($values['id']))
		{
			$where['id !='] = $values['id'];
			$where['parent_id !='] = $values['id'];
		}
		$parent_options = $this->options_list('id', 'nav_key', $where);
		$fields['parent_id']['label'] = lang('navigation_model_parent_id');
		$fields['parent_id']['type'] = 'select';
		$fields['parent_id']['options'] = $parent_options;
		$fields['parent_id']['first_option'] = array('0' => 'None');
		
		$yes = lang('form_enum_option_yes');
		$no = lang('form_enum_option_no');
		$fields['hidden']['options'] = array('yes' => $yes, 'no' => $no);
		
		return $fields;
	}
 function form_fields()
 {
     $fields = parent::form_fields();
     return $fields;
 }
 /**
  * Creates the form_fields array to be used with Form_builder
  *
  * @access	public
  * @param	array	an array of values to pass to the form fields
  * @param	array	related field information
  * @return	array
  */
 public function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     $fields['parent_id'] = array('type' => 'select', 'model' => 'fuel_categories', 'first_option' => lang('label_select_one'));
     // magically sets the options list view to remove the current category
     if (!empty($values['id'])) {
         $this->db->where(array('id != ' => $values['id']));
     }
     $fields['language'] = array('type' => 'select', 'options' => $this->fuel->language->options(), 'value' => $this->fuel->language->default_option(), 'hide_if_one' => TRUE, 'first_option' => lang('label_select_one'));
     return $fields;
 }
 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $fields['value']['class'] = 'markitup';
     return $fields;
 }
 /**
  * User form fields
  *
  * @access	public
  * @param	array Values of the form fields (optional)
  * @param	array An array of related fields. This has been deprecated in favor of using has_many and belongs to relationships (deprecated)
  * @return	array An array to be used with the Form_builder class
  */
 public function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     $other_perms_options = array('create', 'edit', 'publish', 'delete', 'export');
     if (empty($values['id'])) {
         $values = $other_perms_options;
         array_pop($values);
         $fields['other_perms'] = array('type' => 'multi', 'options' => array_combine($other_perms_options, $other_perms_options), 'value' => $values);
     }
     return $fields;
 }
 /**
  * Add FUEL specific changes to the form_fields method
  *
  * @access	public
  * @param	array Values of the form fields (optional)
  * @param	array An array of related fields. This has been deprecated in favor of using has_many and belongs to relationships (deprecated)
  * @return	array An array to be used with the Form_builder class
  */
 public function form_fields($values = array(), $related = array())
 {
     $CI =& get_instance();
     $fields = parent::form_fields($values, $related);
     //$fields['value']['value'] = (!empty($values['value'])) ? $this->cast($values['value'], $values['type']) : '';
     if (isset($values['page_id'])) {
         $page = $CI->fuel->pages->find($values['page_id']);
         if (isset($page->id)) {
             $layout = $this->fuel->layouts->get($page->layout);
             // grab values from entire set of layout vars to be used with merging (e.g. {page_id})
             $page_vars = $this->find_all_by_page_id($values['page_id']);
             $values = array_merge($page_vars, $values);
             $layout->set_field_values($values);
             $layout_fields = $layout->fields();
             if (isset($layout_fields[$values['name']])) {
                 $fields['value'] = $layout_fields[$values['name']];
                 $fields['value']['name'] = 'value';
             }
         }
     }
     // not needed due to on_before_clean
     unset($fields['type']);
     return $fields;
 }
 /**
  * Site variable form fields array
  *
  * @access	public
  * @param	array Values of the form fields (optional)
  * @param	array An array of related fields. This has been deprecated in favor of using has_many and belongs to relationships (deprecated)
  * @return	array An array to be used with the Form_builder class
  */
 public function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     $fields['value']['class'] = 'markitup';
     return $fields;
 }