function form($instance) { //get all registered sidebars global $wp_registered_sidebars; $sidebar_options = array(); $default_sidebar = ''; foreach ($wp_registered_sidebars as $registered_sidebar) { $default_sidebar = empty($default_sidebar) ? $registered_sidebar['id'] : $default_sidebar; $sidebar_options[$registered_sidebar['id']] = $registered_sidebar['name']; } $defaults = array('sidebar' => $default_sidebar); $instance = wp_parse_args($instance, $defaults); extract($instance); ?> <p class="description half"> <label for="<?php echo $block_id; ?> _title"> <?php _e("Title (optional)", 'oblivion'); ?> <br/> <?php echo field_input('title', $block_id, $title, $size = 'full'); ?> </label> </p> <p class="description half last"> <label for=""> <?php
function form($instance) { $defaults = array('content' => '', 'tabs' => array(1 => array('title' => __('My New Tab', 'oblivion'), 'content' => __('My tab contents', 'oblivion'))), 'type' => 'tab', 'position' => 'top'); $instance = wp_parse_args($instance, $defaults); extract($instance); $tab_types = array('tab' => __('Tabs', 'oblivion'), 'toggle' => __('Toggles', 'oblivion'), 'accordion' => __('Accordion', 'oblivion')); $tab_position = array('top' => __('Top', 'oblivion'), 'bottom' => __('Bottom', 'oblivion'), 'left' => __('Left', 'oblivion'), 'right' => __('Right', 'oblivion')); ?> <div class="description cf"> <p class="description"> <label for="<?php echo $this->get_field_id('title'); ?> "> <?php _e("Title (optional)", 'oblivion'); ?> <?php echo field_input('title', $block_id, $title, $size = 'full'); ?> </label> </p> <ul id="sortable-list-<?php echo $block_id; ?> " class="sortable-list" rel="<?php echo $block_id; ?> "> <?php $tabs = is_array($tabs) ? $tabs : $defaults['tabs']; $count = 1; foreach ($tabs as $tab) { $this->tab($tab, $count); $count++; } ?> </ul> <p></p> <a href="#" rel="tab" class="sortable-add-new button"><?php _e("Add New", 'oblivion'); ?> </a> <p></p> </div> <p class="description"> <label for="<?php echo $this->get_field_id('type'); ?> "> <?php _e("Tabs style", 'oblivion'); ?> <br/>
$block_options = array('name' => __('Clear', 'oblivion'), 'size' => __('span12', 'oblivion'), 'marg' => ''); //create the block parent::__construct('clear_block', $block_options); } function form($instance) { $defaults = array('horizontal_line' => 'none', 'line_color' => '#cccccc', 'pattern' => '1', 'height' => '1', 'marg' => ''); $line_options = array('none' => __('None', 'oblivion'), 'single' => __('Single', 'oblivion'), 'double' => __('Double', 'oblivion')); $instance = wp_parse_args($instance, $defaults); extract($instance); $line_color = isset($line_color) ? $line_color : '#cccccc'; ?> <p class="description note"> <?php _e('Use this block to clear the floats between two or more separate blocks vertically.', 'oblivion'); ?> </p> <p class="description fourth"> <label for="<?php echo $this->get_field_id('line_color'); ?> "> <?php _e('Pick a horizontal line', 'oblivion'); ?> <br/> <?php echo field_select('horizontal_line', $block_id, $line_options, $horizontal_line, $block_id); ?> </label> </p> <div class="description fourth"> <label for="<?php echo $this->get_field_id('height'); ?> "> <?php _e('Height (optional)', 'oblivion'); ?> <br/> <?php echo field_input('height', $block_id, $height, 'min', 'number'); ?> px </label> </div> <div class="description half last"> <label for="<?php echo $this->get_field_id('line_color');
function form($instance) { $defaults = array('content' => '', 'type' => 'note', 'style' => ''); $instance = wp_parse_args($instance, $defaults); extract($instance); $type_options = array('default' => __('Standard', 'oblivion'), 'info' => __('Info', 'oblivion'), 'note' => __('Notification', 'oblivion'), 'warn' => __('Warning', 'oblivion'), 'tips' => __('Tips', 'oblivion')); ?> <p class="description"> <label for="<?php echo $this->get_field_id('title'); ?> "> <?php _e("Title (optional)", 'oblivion'); ?> <br/> <?php echo field_input('title', $block_id, $title); ?> </label> </p> <p class="description"> <label for="<?php echo $this->get_field_id('content'); ?> "> <?php _e("Alert Text (required)", 'oblivion'); ?> <br/> <?php echo field_textarea('content', $block_id, $content); ?> </label> </p> <p class="description half"> <label for="<?php echo $this->get_field_id('type'); ?> "> <?php _e("Alert Type", 'oblivion'); ?> <br/> <?php
function form($instance) { $defaults = array('text' => '', 'icon' => 'none', 'title' => 'none'); $icon_options = array('none' => 'None', 'icon-glass' => 'glass', 'icon-music' => 'music', 'icon-search' => 'search', 'icon-envelope' => 'envelope', 'icon-heart' => 'heart', 'icon-star' => 'star', 'icon-star-empty' => 'star empty', 'icon-user' => 'user', 'icon-film' => 'film', 'icon-th-large' => 'th large', 'icon-th' => 'th', 'icon-th-list' => 'th list', 'icon-ok' => 'ok', 'icon-remove' => 'remove', 'icon-zoom-in' => 'zoom in', 'icon-zoom-out' => 'zoom out', 'icon-off' => 'off', 'icon-signal' => 'signal', 'icon-cog' => 'cog', 'icon-trash' => 'trash', 'icon-home' => 'home', 'icon-file' => 'file', 'icon-time' => 'time', 'icon-road' => 'road', 'icon-download-alt' => 'download alt', 'icon-download' => 'download', 'icon-upload' => 'upload', 'icon-inbox' => 'inbox', 'icon-play-circle' => 'play circle', 'icon-repeat' => 'repeat', 'icon-refresh' => 'refresh', 'icon-list-alt' => 'list alt', 'icon-lock' => 'lock', 'icon-flag' => 'flag', 'icon-headphones' => 'headphones', 'icon-volume-off' => 'volume off', 'icon-volume-down' => 'volume down', 'icon-volume-up' => 'volume up', 'icon-qrcode' => 'qrcode', 'icon-barcode' => 'barcode', 'icon-tag' => 'tag', 'icon-tags' => 'tags', 'icon-book' => 'book', 'icon-bookmark' => 'bookmark', 'icon-print' => 'print', 'icon-camera' => 'camera', 'icon-bold' => 'bold', 'icon-italic' => 'italic', 'icon-text-height' => 'text height', 'icon-text-width' => 'text width', 'icon-align-left' => 'align left', 'icon-align-center' => 'align center', 'icon-align-right' => 'align right', 'icon-align-justify' => 'align justify', 'icon-list' => 'list', 'icon-indent-left' => 'indent left', 'icon-indent-right' => 'indent right', 'icon-facetime-video' => 'facetime video', 'icon-picture' => 'picture', 'icon-pencil' => 'pencil', 'icon-map-marker' => 'map marker', 'icon-adjust' => 'adjust', 'icon-tint' => 'tint', 'icon-edit' => 'edit', 'icon-share' => 'share', 'icon-check' => 'check', 'icon-move' => 'move', 'icon-step-backward' => 'step backward', 'icon-fast-backward' => 'fast backward', 'icon-backward' => 'backward', 'icon-play' => 'play', 'icon-pause' => 'pause', 'icon-stop' => 'stop', 'icon-forward' => 'forward', 'icon-fast-forward' => 'fast forward', 'icon-step-forward' => 'step forward', 'icon-eject' => 'eject', 'icon-chevron-left' => 'chevron left', 'icon-chevron-right' => 'chevron right', 'icon-plus-sign' => 'plus sign', 'icon-minus-sign' => 'minus sign', 'icon-remove-sign' => 'remove sign', 'icon-ok-sign' => 'oksign', 'icon-question-sign' => 'question sign', 'icon-info-sign' => 'infosign', 'icon-screenshot' => 'screenshot', 'icon-remove-circle' => 'remove circle', 'icon-ok-circle' => 'ok circle', 'icon-ban-circle' => 'ban circle', 'icon-arrow-left' => 'arrow left', 'icon-arrow-right' => 'arrow right', 'icon-arrow-up' => 'arrow up', 'icon-arrow-down' => 'arrow down', 'icon-share-alt' => 'share alt', 'icon-resize-full' => 'resize full', 'icon-resize-small' => 'resize small', 'icon-plus' => 'plus', 'icon-minus' => 'minus', 'icon-asterisk' => 'asterisk', 'icon-exclamation-sign' => 'exclamation sign', 'icon-gift' => 'gift', 'icon-leaf' => 'leaf', 'icon-fire' => 'fire', 'icon-eye-open' => 'eye open', 'icon-eye-close' => 'eye close', 'icon-warning-sign' => 'warning sign', 'icon-plane' => 'plane', 'icon-calendar' => 'calendar', 'icon-random' => 'random', 'icon-comment' => 'comment', 'icon-magnet' => 'magnet', 'icon-chevron-up' => 'chevron up', 'icon-chevron-down' => 'chevron dow ', 'icon-retweet' => 'retweet', 'icon-shopping-cart' => 'shopping cart', 'icon-folder-close' => 'folder close', 'icon-folder-open' => 'folder open', 'icon-resize-vertical' => 'resize vertical', 'icon-resize-horizontal' => 'resize horizontal', 'icon-bar-chart' => 'bar chart', 'icon-twitter-sign' => 'twitter sign', 'icon-facebook-sign' => 'facebook sign', 'icon-camera-retro' => 'camera retro', 'icon-key' => 'key', 'icon-cogs' => 'cogs', 'icon-comments' => 'comments', 'icon-thumbs-up' => 'thumbs up', 'icon-thumbs-down' => 'thumbs down', 'icon-star-half' => 'star half', 'icon-heart-empty' => 'heart empty', 'icon-signout' => 'signout', 'icon-linkedin-sign' => 'linkedin sign', 'icon-pushpin' => 'pushpin', 'icon-external-link' => 'external link', 'icon-signin' => 'signin', 'icon-trophy' => 'trophy', 'icon-github-sign' => 'github sign', 'icon-upload-alt' => 'upload alt', 'icon-lemon' => 'lemon', 'icon-phone' => 'phone', 'icon-check-empty' => 'check empty', 'icon-bookmark-empty' => 'bookmark empty', 'icon-phone-sign' => 'phone sign', 'icon-twitter' => 'twitter', 'icon-facebook' => 'facebook', 'icon-github' => 'github', 'icon-unlock' => 'unlock', 'icon-credit-card' => 'credit card', 'icon-rss' => 'rss', 'icon-hdd' => 'hdd', 'icon-bullhorn' => 'bullhorn', 'icon-bell' => 'bell', 'icon-certificate' => 'certificate', 'icon-hand-right' => 'hand right', 'icon-hand-left' => 'handleft', 'icon-hand-up' => 'hand up', 'icon-hand-down' => 'hand down', 'icon-circle-arrow-left' => 'circle arrow left', 'icon-circle-arrow-right' => 'circle arrow right', 'icon-circle-arrow-up' => 'circle arrow up', 'icon-circle-arrow-down' => 'circle arrow down', 'icon-globe' => 'globe', 'icon-wrench' => 'wrench', 'icon-tasks' => 'tasks', 'icon-filter' => 'filter', 'icon-briefcase' => 'briefcase', 'icon-fullscreen' => 'fullscreen', 'icon-group' => 'group', 'icon-link' => 'link', 'icon-cloud' => 'cloud', 'icon-beaker' => 'beaker', 'icon-cut' => 'cut', 'icon-copy' => 'copy', 'icon-paper-clip' => 'paper clip', 'icon-save' => ' save', 'icon-sign-blank' => 'sign blank', 'icon-reorder' => 'reorder', 'icon-list-ul' => 'list ul', 'icon-list-ol' => 'list ol', 'icon-strikethrough' => 'strikethrough', 'icon-underline' => 'underline', 'icon-table' => 'table', 'icon-magic' => 'magic', 'icon-truck' => 'truck', 'icon-pinterest' => 'pinterest', 'icon-pinterest-sign' => 'pinterest sign', 'icon-google-plus-sign' => 'google plus sign', 'icon-google-plus' => 'google plus', 'icon-money' => 'money', 'icon-caret-down' => 'caret down', 'icon-caret-left' => 'caret left', 'icon-caret-right' => 'caret right', 'icon-columns' => 'columns', 'icon-sort' => 'sort', 'icon-sort-down' => 'sort down', 'icon-sort-up' => 'sort up', 'icon-envelope-alt' => 'envelope alt', 'icon-linkedin' => 'linkedin', 'icon-undo' => 'undo', 'icon-legal' => 'legal', 'icon-dashboard' => 'dashboard', 'icon-comment-alt' => 'comment alt', 'icon-comments-alt' => 'comments alt', 'icon-bolt' => 'bolt', 'icon-sitemap' => 'sitemap', 'icon-umbrella' => 'umbrella', 'icon-paste' => 'paste', 'icon-lightbulb' => 'lightbulb', 'icon-exchange' => 'exchange', 'icon-cloud-download' => 'cloud download', 'icon-cloud-upload' => 'cloud upload', 'icon-user-md' => 'user md', 'icon-stethoscope' => 'stethoscope', 'icon-suitcase' => 'suitcase', 'icon-bell-alt' => 'bell alt', 'icon-coffee' => 'coffee', 'icon-food' => 'food', 'icon-file-alt' => 'file alt', 'icon-building' => 'building', 'icon-hospital' => 'hospital', 'icon-ambulance' => 'ambulance', 'icon-medkit' => 'medkit', 'icon-fighter-jet' => 'fighter jet', 'icon-beer' => 'beer', 'icon-h-sign' => 'h sign', 'icon-plus-sign-alt' => 'plus sign alt', 'icon-double-angle-left' => 'double angle left', 'icon-double-angle-right' => 'double angle right', 'icon-double-angle-up' => 'double angle up', 'icon-double-angle-down' => 'double angle down', 'icon-angle-left' => 'angle left', 'icon-angle-right' => 'angle right', 'icon-angle-up' => 'angle up', 'icon-angle-down' => 'angle down', 'icon-desktop' => 'desktop', 'icon-laptop' => 'laptop', 'icon-tablet' => 'tablet', 'icon-mobile-phone' => 'mobile phone', 'icon-circle-blank' => 'circle blank', 'icon-quote-left' => 'quote left', 'icon-quote-right' => 'quote right', 'icon-spinner' => 'spinner', 'icon-circle' => 'circle', 'icon-reply' => 'reply'); $instance = wp_parse_args($instance, $defaults); extract($instance); ?> <p class="description"> <label for="<?php echo $this->get_field_id('title'); ?> "> <?php _e("Title", 'oblivion'); ?> <?php echo field_input('title', $block_id, $title, $size = 'full'); ?> </label> </p> <p class="description fourth"> <label for="<?php echo $this->get_field_id('icon'); ?> "> <?php _e("Icon", 'oblivion'); ?> <br/> <?php echo field_select('icon', $block_id, $icon_options, $icon, $block_id); ?> </label> </p> <p class="description"> <label for="<?php
if ($is_display_textarea) { ?> <p><?php echo Form::textarea(sprintf($prefix . '_description[%d]', $file->id), isset($file->description) ? $file->description : '', array('rows' => 2, 'placeholder' => '写真の説明', 'class' => 'form-control', 'id' => sprintf($prefix . '_description_%d', $file->id))); ?> </p> <?php } ?> <?php echo Form::hidden(sprintf($prefix . '[%d]', $file->id), $file->name_prefix . $file->name, array('class' => $prefix)); // select insert image size if (!empty($insert_target) && !empty($file->accept_sizes)) { ?> <p><?php echo field_select(null, $value = null, Util_Array::set_key_from_value($file->accept_sizes), array('id' => 'select_size_' . $file->id)); ?> </p> <?php } // insert image tag button. if (!empty($insert_target)) { $data = array('class' => 'js-insert_img', 'id' => 'img_insert_btn_' . $file->id, 'data-id' => $file->id, 'data-body' => $insert_target, 'data-file_name' => $file->name, 'data-file_name_prefix' => $file->name_prefix); echo btn('form.insert_picture', '#', '', true, 'sm', null, $data, null, 'button', null, false); } ?> </div><!-- caption --> </div><!-- thumbnail --> <?php } ?>
function setting_field_render($setting_id) { $CI =& get_instance(); $row = $CI->db->get_where('settings', array('id' => $setting_id))->row(); if (!$row || empty($row)) { return FALSE; } $html = NULL; switch ($row->type) { case 'text': $html .= field_text($row->key, empty($row->value) ? $row->default_value : $row->value); break; case 'textarea': $html .= field_textarea($row->key, empty($row->value) ? $row->default_value : $row->value); break; case 'date': $html .= field_date($row->key, empty($row->value) ? $row->default_value : $row->value); break; case 'select': $options = array(); if (!empty($row->options)) { $rows = unserialize($row->options); if (isset($rows['value']) && is_array($rows['value']) && count($rows['value'])) { foreach ($rows['value'] as $key => $value) { $options[$value] = isset($rows['title'][$key]) ? $rows['title'][$key] : ''; } } } $html .= field_select($row->key, $options, empty($row->value) ? $row->default_value : $row->value, 'class="input-block-level form-control"'); break; case 'boolen': $options = array(); if (!empty($row->options)) { $rows = unserialize($row->options); if (isset($rows['value']) && is_array($rows['value']) && count($rows['value'])) { foreach ($rows['value'] as $key => $value) { $options[$value] = isset($rows['title'][$key]) ? $rows['title'][$key] : ''; } } } $html .= field_select($row->key, $options, empty($row->value) ? $row->default_value : $row->value, 'class="input-block-level form-control"'); break; } return $html; }
function field_heure($name, $selected, $plage_h = '08:00-18:00', $options = array()) { $tab_heure = explode('-', $plage_h); $heure_deb = intval($tab_heure[0]); $heure_fin = intval($tab_heure[1]); $list_vals = array(); for ($h = $heure_deb; $h <= $heure_fin; $h++) { if (!empty($options['minut_unit'])) { $minutes = 0; while ($minutes < 60) { $val_h = add_zero($h, 2) . ':' . add_zero($minutes, 2); if ($val_h >= $tab_heure[0] && $val_h <= $tab_heure[1]) { $list_vals[$val_h] = $val_h; } $minutes += $options['minut_unit']; } } else { $val_h = add_zero($h, 2) . ':00'; if ($val_h >= $tab_heure[0] && $val_h <= $tab_heure[1]) { $list_vals[$val_h] = $val_h; } } } return field_select($name, $list_vals, $selected, $options); }