예제 #1
0
 /**
  * List the layouts in <option> fields
  * @author Howard <*****@*****.**>
  * @param array $instance
  * @param string $field_name
  * @return string
  */
 public function generate_pages_selectbox($instance, $field_name = 'wpltarget')
 {
     $pages = wpl_global::get_wp_pages();
     $data = '';
     foreach ($pages as $page) {
         $data .= '<option ';
         if (isset($instance[$field_name]) and $page->ID == $instance[$field_name]) {
             $data .= 'selected="selected" ';
         }
         $data .= 'value="' . $page->ID . '"';
         $data .= '>';
         $data .= substr($page->post_title, 0, 100);
         $data .= '</option>';
     }
     return $data;
 }
예제 #2
0
 /**
  * List WP Pages in <option> fields
  * @author Howard <*****@*****.**>
  * @param int $selected
  * @return string
  */
 public static function generate_pages_selectbox($selected)
 {
     $pages = wpl_global::get_wp_pages();
     $output = '';
     foreach ($pages as $page) {
         $output .= '<option ';
         if (isset($selected) and $page->ID == $selected) {
             $output .= 'selected="selected" ';
         }
         $output .= 'value="' . $page->ID . '">';
         $output .= substr($page->post_title, 0, 100);
         $output .= '</option>';
     }
     return $output;
 }
예제 #3
0
        </span>
		<?php 
    }
    ?>

		<span class="ajax-inline-save" id="wpl_ajax_loader_<?php 
    echo $setting_record->id;
    ?>
"></span>
	</div>
</div>
<?php 
    $done_this = true;
} elseif ($type == 'wppages' and !$done_this) {
    $show_empty = isset($options['show_empty']) ? $options['show_empty'] : NULL;
    $wp_pages = wpl_global::get_wp_pages();
    ?>
<div class="prow wpl_setting_form_container wpl_st_type<?php 
    echo $setting_record->type;
    ?>
 wpl_st_<?php 
    echo $setting_record->setting_name;
    ?>
" id="wpl_st_<?php 
    echo $setting_record->id;
    ?>
">
    <div class="select-wp">
        <label for="wpl_st_form_element<?php 
    echo $setting_record->id;
    ?>