checkbox() public static method

public static checkbox ( $name, $value = 1, $checked = false, $attributes = [] )
Example #1
0
 /**
  * Displays a single category checkbox.
  */
 public static function display_category_checkbox($category, $selected_categories, $form_field, $enable_parents = FALSE)
 {
     $html = '';
     $cid = $category->id;
     // Get locale
     $l = Kohana::config('locale.language.0');
     $category_title = Category_Lang_Model::category_title($cid, $l);
     //$category_title = $category->category_title;
     $category_color = $category->category_color;
     // Category is selected.
     $category_checked = in_array($cid, $selected_categories);
     // Visible Child Count
     $vis_child_count = 0;
     foreach ($category->children as $child) {
         $child_visible = $child->category_visible;
         if ($child_visible) {
             // Increment Visible Child count
             ++$vis_child_count;
         }
     }
     $disabled = "";
     if (!$enable_parents and $category->children->count() > 0 and $vis_child_count > 0) {
         $disabled = " disabled=\"disabled\"";
     }
     $html .= form::checkbox($form_field . '[]', $cid, $category_checked, ' class="check-box"' . $disabled);
     $html .= $category_title;
     return $html;
 }
Example #2
0
 private function postLine()
 {
     $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
     switch ($this->rs->post_status) {
         case 1:
             $img_status = sprintf($img, __('published'), 'check-on.png');
             break;
         case 0:
             $img_status = sprintf($img, __('unpublished'), 'check-off.png');
             break;
         case -1:
             $img_status = sprintf($img, __('scheduled'), 'scheduled.png');
             break;
         case -2:
             $img_status = sprintf($img, __('pending'), 'check-wrn.png');
             break;
     }
     $protected = '';
     if ($this->rs->post_password) {
         $protected = sprintf($img, __('protected'), 'locker.png');
     }
     $selected = '';
     if ($this->rs->post_selected) {
         $selected = sprintf($img, __('selected'), 'selected.png');
     }
     $attach = '';
     $nb_media = $this->rs->countMedia();
     if ($nb_media > 0) {
         $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments');
         $attach = sprintf($img, sprintf($attach_str, $nb_media), 'attach.png');
     }
     $res = '<tr class="line' . ($this->rs->post_status != 1 ? ' offline' : '') . '"' . ' id="p' . $this->rs->post_id . '">';
     $res .= '<td class="nowrap">' . form::checkbox(array('entries[]'), $this->rs->post_id, '', '', '', !$this->rs->isEditable()) . '</td>' . '<td class="maximal"><a href="' . $this->core->getPostAdminURL($this->rs->post_type, $this->rs->post_id) . '">' . html::escapeHTML($this->rs->post_title) . '</a></td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '</td>' . '<td class="nowrap">' . $this->rs->user_id . '</td>' . '<td class="nowrap">' . $this->rs->nb_comment . '</td>' . '<td class="nowrap">' . $this->rs->nb_trackback . '</td>' . '<td class="nowrap status">' . $img_status . ' ' . $selected . ' ' . $protected . ' ' . $attach . '</td>' . '</tr>';
     return $res;
 }
Example #3
0
 public function index($page = 1)
 {
     $db = new Database();
     // You can assign anything variable to a view by using standard OOP
     // methods. In my welcome view, the $title variable will be assigned
     // the value I give it here.
     $this->template->title = 'Welcome to YAG demo!';
     $grid = Grid::factory()->set('display_head', true)->set('display_foot', true)->set('display_body', true)->set('table_attributes', array('id' => 'demo_table_1', 'width' => '100%'));
     $grid->CheckboxField('id')->set('title', 'ID')->set('checked', array(2, 3, 4, 6, 9))->set('sortable', true)->set('foot', form::checkbox('checkall', 'yes', false, "onclick=\"check_all('id[]');\"") . form::dropdown('action', array('edit' => 'Edit', 'delete' => 'Delete'), 'edit') . form::submit('submit', 'OK'))->set('extra', array("onclick" => "checkbox_check('id[]')"));
     $grid->TextField('id')->set('title', 'ID')->set('sortable', true);
     $grid->TextField('text')->set('title', 'Text')->set('sortable', true);
     $grid->DateField('date')->set('title', 'Date')->set('format', 'Y-m-d')->set('sortable', true);
     $grid->ActionField()->set('title', 'Action')->add_action('edit', 'id', 'Edit', 'http://www.path.to/my/controller')->add_action('delete', 'id', 'Delete');
     $offset = (int) ($page - 1) * 10;
     $offset = $offset < 0 ? 0 : $offset;
     $order_field = 'id';
     $order_direction = 'asc';
     if ($this->input->get('order_by') and $grid->field_exists($order_field, true)) {
         $order_field = $this->input->get('order_by');
     }
     if ($this->input->get('order_direction') and in_array(strtoupper($this->input->get('order_direction')), array('ASC', 'DESC'))) {
         $order_direction = strtoupper($this->input->get('order_direction'));
     }
     $data = $db->select($grid->get_fields(true))->from('demotable')->limit(10)->offset($offset)->orderby($order_field, $order_direction)->get();
     $count = $db->query('SELECT FOUND_ROWS() AS rows;')->current();
     $this->pagination = new Pagination(array('total_items' => $count->rows, 'items_per_page' => 10));
     $grid->set('extra_row_foot', '<td colspan="' . count($grid->fields) . '">' . $this->pagination->render() . '</td>');
     $grid->set('data', $data);
     $html = $grid->render();
     // Get Javascript for checkbox gimmicks
     $this->template->checkall_js = $grid->render_js('checkall');
     $this->template->content = $html;
 }
Example #4
0
 public function input($name, array $attr = NULL)
 {
     $inputs = array();
     foreach ($this->choices as $value => $label) {
         $inputs[] = form::checkbox("{$name}[]", $value, in_array($value, $this->value)) . ' ' . $label;
     }
     return $inputs;
 }
Example #5
0
 public static function CheckboxGroup($name, $checks, $check_checked = null, $styles = null)
 {
     $ret = null;
     foreach ($checks as $value => $label) {
         $ret .= "<p>" . form::checkbox("{$name}[{$value}]", TRUE, @$check_checked[$value]) . "{$label}</p>";
     }
     return $ret;
 }
 public function __toString()
 {
     $field = $this->field_name;
     $choices = $this->args->choices;
     $checks[$this->field_value] = $this->field_value;
     $check = $this->field_value == 1 ? TRUE : FALSE;
     return form::checkbox($field, '1', $check) . '<span>' . $this->args->verbose . '</span>';
 }
Example #7
0
 private function buildForm()
 {
     $options = array('method' => "POST", 'enctype' => "multipart/form-data", 'action' => '/blog/formular/add', 'width' => '400px');
     $form = new \form('testing', $options);
     $form->label('checkbox');
     $form->checkbox('checkbox test', 'testcheckbox', 'check', '');
     $form->checkbox('checkbox test2', 'testcheckbox', 'check2', true);
     $form->label('radio');
     $form->radio('radio test', 'testradio', 'radio', '');
     $form->radio('radio test 2', 'testradio', 'radio2', true);
     $form->label('textarea');
     $form->text('textarea', ' ', ['error' => $this->error['textarea']]);
     $form->select('autos', ['a' => 'audi', 'b' => 'vw', 'c' => 'toyota'], 'b', ['label' => 'auto select']);
     $form->text('username', '', ['placeholder' => 'username', 'label' => 'Username', 'error' => $this->error['username']]);
     $form->password('password', '', ['label' => 'Password', 'error' => $this->error['password']]);
     $form->button('senden', ['type' => 'submit']);
     return $form;
 }
 /**
  * getcheckboxes -returns html code for selected entries
  * 			as a table containing entries checkboxes
  *
  * @access public
  *
  * @return string the html code for checkboxes
  */
 public function getCheckboxes()
 {
     $ret = '<table class="posts-list"><tr>' . '<th colspan="2">' . __('Author') . '</th><th>' . __('Title') . '</th>' . '</tr>';
     foreach ($this->entries as $id => $title) {
         $ret .= '<tr><td class="minimal">' . form::checkbox(array($this->field_entries . '[]'), $id, true, '', '') . '</td>' . '<td>' . $title['author'] . '</td><td>' . $title['title'] . '</td></tr>';
     }
     $ret .= '</table>';
     return $ret;
 }
Example #9
0
 /**
  * Displays a single category checkbox.
  */
 public static function display_category_checkbox($category, $selected_categories, $form_field)
 {
     $html = '';
     $cid = $category->id;
     $category_title = $category->category_title;
     $category_color = $category->category_color;
     // Category is selected.
     $category_checked = in_array($cid, $selected_categories);
     $html .= form::checkbox($form_field . '[]', $cid, $category_checked, ' class="check-box"');
     $html .= $category_title;
     return $html;
 }
function parse_array($arr)
{
    foreach ($arr as $key => $value) {
        $db = DB::select()->from('categories')->where('id', '=', $key)->execute();
        echo '<ul><li>';
        echo '<b>Название:</b> ' . form::input('name[]', $db[0]['name'], array('onkeyup' => 'translit(\'name[]\', \'url[]\');')) . form::hidden('cid[]', $db[0]['id']) . '&nbsp;';
        echo '<b>URL:</b> ' . form::input('url[]', $db[0]['url']) . '&nbsp;';
        echo '<b>Удалить?</b> ' . form::checkbox('delete[]', $db[0]['id']);
        echo '</li>';
        if (is_array($value)) {
            parse_array($value);
        }
        echo '</ul>';
    }
}
Example #11
0
 /**
  * Displays a single category checkbox.
  */
 private static function display_category_checkbox($category, $selected_categories, $form_field, $enable_parents = FALSE)
 {
     $html = '';
     $cid = $category['category_id'];
     // Category is selected.
     $category_checked = in_array($cid, $selected_categories);
     $disabled = "";
     if (!$enable_parents and count($category['children']) > 0) {
         $disabled = " disabled=\"disabled\"";
     }
     $html .= "<label>";
     $html .= form::checkbox($form_field . '[]', $cid, $category_checked, ' class="check-box"' . $disabled);
     $html .= $category['category_title'];
     $html .= "</label>";
     return $html;
 }
Example #12
0
 /**
  * Displays a single category checkbox.
  */
 public static function display_category_checkbox($category, $selected_categories, $form_field)
 {
     $html = '';
     $cid = $category->id;
     $category_title = $category->category_title;
     $category_color = $category->category_color;
     // Category is selected.
     $category_checked = in_array($cid, $selected_categories);
     $disabled = "";
     if ($category->children->count() > 0) {
         $disabled = " disabled=\"disabled\"";
     }
     $html .= form::checkbox($form_field . '[]', $cid, $category_checked, ' class="check-box"' . $disabled);
     $html .= $category_title;
     return $html;
 }
Example #13
0
 private function postLine($count, $checked)
 {
     $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
     $sts_class = '';
     switch ($this->rs->post_status) {
         case 1:
             $img_status = sprintf($img, __('Published'), 'check-on.png');
             $sts_class = 'sts-online';
             break;
         case 0:
             $img_status = sprintf($img, __('Unpublished'), 'check-off.png');
             $sts_class = 'sts-offline';
             break;
         case -1:
             $img_status = sprintf($img, __('Scheduled'), 'scheduled.png');
             $sts_class = 'sts-scheduled';
             break;
         case -2:
             $img_status = sprintf($img, __('Pending'), 'check-wrn.png');
             $sts_class = 'sts-pending';
             break;
     }
     $protected = '';
     if ($this->rs->post_password) {
         $protected = sprintf($img, __('Protected'), 'locker.png');
     }
     $selected = '';
     if ($this->rs->post_selected) {
         $selected = sprintf($img, __('Hidden'), 'hidden.png');
     }
     $attach = '';
     $nb_media = $this->rs->countMedia();
     if ($nb_media > 0) {
         $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments');
         $attach = sprintf($img, sprintf($attach_str, $nb_media), 'attach.png');
     }
     $res = '<tr class="line ' . ($this->rs->post_status != 1 ? 'offline ' : '') . $sts_class . '"' . ' id="p' . $this->rs->post_id . '">';
     $cols = array('position' => '<td class="nowrap handle minimal">' . form::field(array('order[' . $this->rs->post_id . ']'), 2, 3, $count + 1, 'position', '', false, 'title="' . sprintf(__('position of %s'), html::escapeHTML($this->rs->post_title)) . '"') . '</td>', 'check' => '<td class="nowrap">' . form::checkbox(array('entries[]'), $this->rs->post_id, $checked, '', '', !$this->rs->isEditable(), 'title="' . __('Select this page') . '"') . '</td>', 'title' => '<td class="maximal" scope="row"><a href="' . $this->core->getPostAdminURL($this->rs->post_type, $this->rs->post_id) . '">' . html::escapeHTML($this->rs->post_title) . '</a></td>', 'date' => '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '</td>', 'author' => '<td class="nowrap">' . $this->rs->user_id . '</td>', 'comments' => '<td class="nowrap count">' . $this->rs->nb_comment . '</td>', 'trackbacks' => '<td class="nowrap count">' . $this->rs->nb_trackback . '</td>', 'status' => '<td class="nowrap status">' . $img_status . ' ' . $selected . ' ' . $protected . ' ' . $attach . '</td>');
     $cols = new ArrayObject($cols);
     $this->core->callBehavior('adminPagesListValue', $this->core, $this->rs, $cols);
     $res .= implode(iterator_to_array($cols));
     $res .= '</tr>';
     return $res;
 }
 function getPositionCheckbox($model, $id = NULL, $type = 'house')
 {
     import("ORG.Util.Form");
     // 载入推荐位
     $positions = $this->table(array(C('DB_PREFIX') . "model_type" => "type", C('DB_PREFIX') . "position" => "pos"))->where("type.id = pos.typeid and type.module = '%s'", $model)->order("pos.listorder desc")->field('pos.*')->select();
     $position_array = array_translate($positions);
     if (!empty($id)) {
         // 获取选中推荐位
         $posids = D('PositionData')->where(array('type' => $type, 'module' => $model, 'id' => $id))->group("posid")->field('posid')->select();
     }
     $position_data_ids = array();
     foreach ($posids as $key => $pos) {
         $position_data_ids[] = $pos['posid'];
     }
     $posids = implode(',', $position_data_ids);
     $posidstr = form::checkbox($position_array, $posids, "name='info[posids][]'", '', 125);
     // END 推荐位载入
     return $posidstr;
 }
 public function getHtmlField($aPostedData)
 {
     $return = '';
     switch ($this->type) {
         # Champ texte
         default:
         case 1:
             $return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<label for="' . $this->html_id . '"' . ($this->status == 2 ? ' class="required" title="' . __('c_c_required_field') . '"' : '') . '>' . html::escapeHTML($this->title) . '</label>' . form::text($this->html_id, 60, 255, $aPostedData[$this->id]) . '</p>';
             break;
             # Zone de texte
         # Zone de texte
         case 2:
             $return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<label for="' . $this->html_id . '"' . ($this->status == 2 ? ' class="required" title="' . __('c_c_required_field') . '"' : '') . '>' . html::escapeHTML($this->title) . '</label>' . form::textarea($this->html_id, 58, 10, $aPostedData[$this->id]) . '</p>';
             break;
             # Menu déroulant
         # Menu déroulant
         case 3:
             $values = array_filter((array) unserialize($this->value));
             $return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<label for="' . $this->html_id . '"' . ($this->status == 2 ? ' class="required" title="' . __('c_c_required_field') . '"' : '') . '>' . html::escapeHTML($this->title) . '</label>' . form::select($this->html_id, array_flip($values), $aPostedData[$this->id]) . '</p>';
             break;
             # Boutons radio
         # Boutons radio
         case 4:
             $values = array_filter((array) unserialize($this->value));
             $str = '';
             foreach ($values as $k => $v) {
                 $str .= '<li><label>' . form::radio(array($this->html_id, $this->html_id . '_' . $k), $k, $k == $aPostedData[$this->id]) . html::escapeHTML($v) . '</label></li>';
             }
             $return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<span class="fake-label">' . html::escapeHTML($this->title) . '</span></p>' . '<ul class="checklist">' . $str . '</ul>';
             break;
             # Cases à cocher
         # Cases à cocher
         case 5:
             $values = array_filter((array) unserialize($this->value));
             $str = '';
             foreach ($values as $k => $v) {
                 $str .= '<li><label>' . form::checkbox(array($this->html_id . '[' . $k . ']', $this->html_id . '_' . $k), $k, in_array($k, $aPostedData[$this->id])) . html::escapeHTML($v) . '</label></li>';
             }
             $return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<span class="fake-label">' . html::escapeHTML($this->title) . '</span></p>' . '<ul class="checklist">' . $str . '</ul>';
             break;
     }
     return $return;
 }
Example #16
0
 public static function pingsForm(&$post)
 {
     $core =& $GLOBALS['core'];
     if (!$core->blog->settings->pings_active) {
         return;
     }
     $pings_uris = @unserialize($core->blog->settings->pings_uris);
     if (empty($pings_uris) || !is_array($pings_uris)) {
         return;
     }
     if (!empty($_POST['pings_do']) && is_array($_POST['pings_do'])) {
         $pings_do = $_POST['pings_do'];
     } else {
         $pings_do = array();
     }
     echo '<h3 class="ping-services">' . __('Pings:') . '</h3>';
     foreach ($pings_uris as $k => $v) {
         echo '<p class="ping-services"><label class="classic">' . form::checkbox(array('pings_do[]'), html::escapeHTML($v), in_array($v, $pings_do)) . ' ' . html::escapeHTML($k) . '</label></p>';
     }
 }
Example #17
0
 public function login()
 {
     if ($this->a2->logged_in()) {
         //cannot create new accounts when a user is logged in
         return $this->index();
     }
     $post = Validation::factory($_POST)->pre_filter('trim')->add_rules('username', 'required', 'length[4,127]')->add_rules('password', 'required');
     if ($post->validate()) {
         if ($this->a1->login($post['username'], $post['password'], isset($_POST['remember']) ? (bool) $_POST['remember'] : FALSE)) {
             url::redirect('a2demo/index');
         }
     }
     //show form
     echo form::open();
     echo 'username:'******'username') . '<br>';
     echo 'password:'******'password') . '<br>';
     echo 'remember me:' . form::checkbox('remember', TRUE) . '<br>';
     echo form::submit(array('value' => 'login'));
     echo form::close();
 }
Example #18
0
 /**
  * Displays a single category checkbox.
  */
 public static function display_category_checkbox($category, $selected_categories, $form_field, $enable_parents = FALSE)
 {
     $html = '';
     $cid = $category->id;
     // Get locale
     $l = Kohana::config('locale.language.0');
     $translated_title = Category_Lang_Model::category_title($cid, $l);
     $category_title = $translated_title ? $translated_title : $category->category_title;
     //$category_title = $category->category_title;
     $category_color = $category->category_color;
     // Category is selected.
     $category_checked = in_array($cid, $selected_categories);
     $disabled = "";
     if (!$enable_parents and $category->children->count() > 0) {
         $disabled = " disabled=\"disabled\"";
     }
     $html .= form::checkbox($form_field . '[]', $cid, $category_checked, ' class="check-box"' . $disabled);
     $html .= $category_title;
     return $html;
 }
Example #19
0
File: a2demo.php Project: sars/rp
 public function action_login()
 {
     if ($this->user) {
         //cannot create new accounts when a user is logged in
         return $this->action_index();
     }
     $post = Validate::factory($_POST)->filter(TRUE, 'trim')->rule('username', 'not_empty')->rule('username', 'min_length', array(4))->rule('username', 'max_length', array(127))->rule('password', 'not_empty');
     if ($post->check()) {
         if ($this->a1->login($post['username'], $post['password'], isset($_POST['remember']) ? (bool) $_POST['remember'] : FALSE)) {
             $this->request->redirect('a2demo/index');
         }
     }
     //show form
     echo form::open();
     echo 'username:'******'username') . '<br>';
     echo 'password:'******'password') . '<br>';
     echo 'remember me:' . form::checkbox('remember', TRUE) . '<br>';
     echo form::submit('login', 'login');
     echo form::close();
     echo Kohana::debug($post->errors());
 }
Example #20
0
 /**
  * Add a many to many select list
  * @developer Brandon Hansen
  * @date Oct 27, 2010
  */
 public static function many_to_many($primary_model, $secondary_models, $property, $display_field_name = 'name', $type = 'inline')
 {
     $return = '';
     $return .= form::hidden($property, 'NULL');
     if ($type == 'table') {
         $return .= '<table >';
     }
     foreach ($secondary_models as $secondary_model) {
         if ($type == 'table') {
             $return .= '<tr><td>';
         }
         $return .= form::checkbox($property . '[]', $secondary_model->id, in_array($secondary_model->id, $primary_model->{$property}->primary_key_array()));
         $return .= $secondary_model->{$display_field_name};
         if ($type == 'table') {
             $return .= '</td></tr>';
         }
     }
     if ($type == 'table') {
         $return .= '</table>';
     }
     return $return;
 }
Example #21
0
 public function render()
 {
     // Import base data
     $base_data = $this->data;
     // Make it an array
     $base_data['name'] .= '[]';
     // Newline
     $nl = "\n";
     $checklist = '<ul class="' . arr::remove('class', $base_data) . '">' . $nl;
     foreach (arr::remove('options', $base_data) as $val => $opt) {
         // New set of input data
         $data = $base_data;
         // Get the title and checked status
         list($title, $checked) = $opt;
         // Set the name, value, and checked status
         $data['value'] = $val;
         $data['checked'] = $checked;
         $checklist .= '<li><label>' . form::checkbox($data) . ' ' . html::purify($title) . '</label></li>' . $nl;
     }
     $checklist .= '</ul>';
     return $checklist;
 }
Example #22
0
 public function render(&$render_variables, $errors = array())
 {
     // Load base template and attributes
     $result = parent::render($render_variables, $errors);
     // Discover the type
     switch ($this->type) {
         case 'input':
             $result['template']->element = form::input($result['attributes'], $this->value);
             break;
         case 'password':
             $result['template']->element = form::password($result['attributes'], $this->value);
             break;
         case 'submit':
             $result['template']->element = form::submit($result['attributes'], $this->value);
             $render_variables['submit'] = TRUE;
             break;
         case 'radio':
             $result['template']->element = form::radio($result['attributes'], $this->value);
             break;
         case 'checkbox':
             $result['attributes']['value'] = $this->value;
             if ($this->value = Input::instance()->post($this->name)) {
                 $result['template']->element = form::checkbox($result['attributes'], $this->value, TRUE);
             } else {
                 $result['template']->element = form::checkbox($result['attributes'], $this->value);
             }
             break;
         case 'hidden':
             $result['template']->element = form::hidden($this->name, $this->value);
             break;
         case 'file':
             $result['template']->element = form::upload($result['attributes'], $this->value);
             $render_variables['enctype'] = 'multipart/form-data';
             break;
     }
     // Return the resulting output
     return (string) $result['template']->render();
 }
Example #23
0
 public static function pingsFormItems($main, $sidebar, $post)
 {
     $core =& $GLOBALS['core'];
     if (!$core->blog->settings->pings->pings_active) {
         return;
     }
     $pings_uris = @unserialize($core->blog->settings->pings->pings_uris);
     if (empty($pings_uris) || !is_array($pings_uris)) {
         return;
     }
     if (!empty($_POST['pings_do']) && is_array($_POST['pings_do'])) {
         $pings_do = $_POST['pings_do'];
     } else {
         $pings_do = array();
     }
     $item = '<h5 class="ping-services">' . __('Pings') . '</h5>';
     $i = 0;
     foreach ($pings_uris as $k => $v) {
         $item .= '<p class="ping-services"><label for="pings_do-' . $i . '" class="classic">' . form::checkbox(array('pings_do[]', 'pings_do-' . $i), html::escapeHTML($v), in_array($v, $pings_do), 'check-ping-services') . ' ' . html::escapeHTML($k) . '</label></p>';
         $i++;
     }
     $sidebar['options-box']['items']['pings'] = $item;
 }
Example #24
0
        echo '<p>' . __('No detail') . '</p>';
    } else {
        echo '<ul>';
        foreach ($file->media_meta as $k => $v) {
            if ((string) $v) {
                echo '<li><strong>' . $k . ':</strong> ' . html::escapeHTML($v) . '</li>';
            }
        }
        echo '</ul>';
    }
}
if ($file->editable && $core_media_writable) {
    if ($file->media_type == 'image') {
        echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Update thumbnails') . '</legend>' . '<p>' . __('This will create or update thumbnails for this image.') . '</p>' . '<p><input type="submit" name="thumbs" value="' . __('update thumbnails') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    }
    if ($file->type == 'application/zip') {
        $inflate_combo = array(__('Extract in a new directory') => 'new', __('Extract in current directory') => 'current');
        echo '<form class="clear" id="file-unzip" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Extract archive') . '</legend>' . '<ul>' . '<li><strong>' . __('Extract in a new directory') . '</strong> : ' . __('This will extract archive in a new directory that should not exists yet.') . '</li>' . '<li><strong>' . __('Extract in current directory') . '</strong> : ' . __('This will extract archive in current directory and will overwrite existing files or directory.') . '</li>' . '</ul>' . '<p><label class="classic">' . __('Extract mode:') . ' ' . form::select('inflate_mode', $inflate_combo, 'new') . '</label> ' . '<input type="submit" name="unzip" value="' . __('c_c_action_extract') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    }
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post">' . '<fieldset><legend>' . __('Change media properties') . '</legend>' . '<p class="field"><label>' . __('File name:') . '</label>' . form::text('media_file', 30, 255, html::escapeHTML($file->basename)) . '</p>' . '<p class="field"><label>' . __('File title:') . '</label>' . form::text('media_title', 30, 255, html::escapeHTML($file->media_title)) . '</p>' . '<p class="field"><label>' . __('File date:') . '</label>' . form::text('media_dt', 16, 16, html::escapeHTML($file->media_dtstr)) . '</p>' . '<p class="field"><label class="classic">' . form::checkbox('media_private', 1, $file->media_priv) . ' ' . __('Private') . '</label></p>' . '<p class="field"><label>' . __('New directory:') . '</label>' . form::select('media_path', $dirs_combo, dirname($file->relname)) . '</p>' . '<p><input type="submit" value="' . __('c_c_action_save') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
    echo '<form class="clear" action="' . html::escapeURL($page_url) . '" method="post" enctype="multipart/form-data">' . '<fieldset><legend>' . __('Change file') . '</legend>' . '<div>' . form::hidden(array('MAX_FILE_SIZE'), OKT_MAX_UPLOAD_SIZE) . '</div>' . '<p class="field"><label for="upfile">' . __('Choose a file:') . '</label>' . '<input type="file" id="upfile" name="upfile" size="35" /></p>' . '<p class="note">' . sprintf(__('c_c_maximum_file_size_%s'), util::l10nFileSize(OKT_MAX_UPLOAD_SIZE)) . '</p>' . '<p><input type="submit" value="' . __('c_c_action_send') . '" />' . form::hidden(array('id'), $id) . adminPage::formtoken() . '</p>' . '</fieldset></form>';
}
echo '</div>';
echo '</div>';
echo '</div>';
# Pied-de-page
if ($popup) {
    require OKT_ADMIN_FOOTER_SIMPLE_FILE;
} else {
    require OKT_ADMIN_FOOTER_FILE;
}
Example #25
0
 /**
  * User preferences form.
  *
  * This add options for superadmin user
  * to show or not expired taks.
  *
  * @param	$args	<b>object</b>	dcCore instance or record
  */
 public static function adminDashboardOptionsForm($core)
 {
     $core->auth->user_prefs->addWorkspace('maintenance');
     echo '<div class="fieldset">' . '<h4>' . __('Maintenance') . '</h4>' . '<p><label for="maintenance_dashboard_icon" class="classic">' . form::checkbox('maintenance_dashboard_icon', 1, $core->auth->user_prefs->maintenance->dashboard_icon) . __('Display overdue tasks counter on maintenance dashboard icon') . '</label></p>' . '<p><label for="maintenance_dashboard_item" class="classic">' . form::checkbox('maintenance_dashboard_item', 1, $core->auth->user_prefs->maintenance->dashboard_item) . __('Display overdue tasks list on dashboard items') . '</label></p>' . '</div>';
 }
<?php

echo form::checkbox(array('id' => $o->form->get_form_name() . '-' . $o->rp('name'), 'name' => $o->rp('name'), 'checked' => $o->rp('cval'), 'value' => $o->rp('row')->postvalue, 'class' => $o->rp('row')->class));
echo $o->get_error($o->rp('name'));
         if ($cnt % 2 == 0) {
             $html .= "<tr>";
         }
         $html .= "<td>";
         $set_default = FALSE;
         if (!empty($multi_defaults)) {
             foreach ($multi_defaults as $key => $def) {
                 $set_default = trim($option) == trim($def);
                 if ($set_default) {
                     break;
                 }
             }
         }
         $option = trim($option);
         $html .= "<span class=\"custom-field-option\">";
         $html .= form::checkbox("custom_field[" . $field_id . '-' . $cnt . ']', $option, $set_default, $id_name);
         $html .= form::label("custom_field[" . $field_id . ']', " " . $option);
         $html .= "</span>";
         $html .= "</td>";
         if ($cnt % 2 == 1 or $cnt == count($options) - 1) {
             $html .= "</tr>";
         }
         $cnt++;
     }
     // XXX Hack to deal with required checkboxes that are submitted with nothing checked
     $html .= "</table>";
     $html .= form::hidden("custom_field[" . $field_id . "-BLANKHACK]", '', $id_name);
     break;
 case 7:
     $ddoptions = array();
     // Semi-hack to deal with dropdown boxes receiving a range like 0-100
Example #28
0
					<div class="tab_form_item">
						<strong><?php 
echo Kohana::lang('ui_main.description');
?>
:</strong><br />
						<?php 
print form::input('description', '', ' class="text long"');
?>
					</div>
					<div style="clear:both;"></div>
					<div class="tab_form_item">
					<?php 
$i = 0;
foreach ($permissions as $permission => $permission_desc) {
    echo "<div style=\"width:200px;float:left;margin-bottom:3px;\">";
    echo form::checkbox($permission, '1');
    echo form::label($permission, $permission_desc);
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    echo "</div>";
    $i++;
}
?>
					</div>
					<div style="clear:both;"></div>
					<div class="tab_form_item">
						&nbsp;<br />
						<input type="image" src="<?php 
echo url::base();
?>
media/img/admin/btn-save-settings.gif" class="save-rep-btn" />
					</div>
Example #29
0
print form::checkbox('data_point[]', '4', TRUE);
echo Kohana::lang('ui_main.reports');
?>
 <?php 
echo Kohana::lang('ui_main.awaiting_verification');
?>
</td>
                                        <td><?php 
print form::checkbox('data_include[]', '4', TRUE);
echo Kohana::lang('ui_main.include_latitude');
?>
</td>
                                </tr>
                                <tr>
                                        <td><?php 
print form::checkbox('data_include[]', '5', TRUE);
echo Kohana::lang('ui_main.include_longitude');
?>
</td>
                                </tr>
				<tr>
					<td colspan="2">
						<div class="date-box">
							<h4><?php 
echo Kohana::lang('ui_admin.from_date');
?>
: <span><?php 
echo Kohana::lang('ui_main.date_format');
?>
</span></h4>
							<?php 
Example #30
0
?>
:</th>
    <td class="y-bg">
		<?php 
echo form::checkbox($admin_data, $checkadmin4, 'name="checkadmin4[]"', '', 120);
?>
	</td>
  </tr>
  <tr>
    <th><B><?php 
echo L('nocheck_users');
?>
</B>:</th>
    <td class="y-bg">
		<?php 
echo form::checkbox($admin_data, $nocheck_users, 'name="nocheck_users[]"', '', 120);
?>
	</td>
  </tr>
  <tr>
    <th><?php 
echo L('checkstatus_flag');
?>
:</th>
    <td class="y-bg">
		<input type="radio" name="info[flag]" value="1" <?php 
if ($flag) {
    echo 'checked';
}
?>
> 是