XPressME Integration Kit

Trac

Changeset 127


Ignore:
Timestamp:
Mar 21, 2009, 12:37:24 AM (15 years ago)
Author:
toemon
Message:

ページブロックの調整 ブロック複製を可能にし、 wp_list_pages()での選択オプションを追加
この変更をもってデザイン面での修正 #72 も終了とする

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/blocks/page_block.php

    r121 r127  
    1919                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 
    2020                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_page_block.html' : trim( $options[1] ); 
    21                 $sort_column = empty( $options[2] ) ? 0 : $options[1] ; 
    22                 $sort_order_asc = empty( $options[3] ) ? 0 : 1 ; 
    23                 $show_date = empty( $options[4] ) ? 0 : 1 ; 
    24                 $date_format = empty( $options[5] ) ? '' : $options[5] ; 
     21                $sort_column = empty( $options[2] ) ? 'post_title' : $options[2] ; 
     22                $sort_order = empty( $options[3] ) ? 'asc' : $options[3] ; 
     23                $exclude = empty( $options[4] ) ? '' : $options[4] ; 
     24                $exclude_tree = !is_numeric( $options[5] ) ? 0 : $options[5] ; 
     25                $includes = empty( $options[6] ) ? '' : $options[6] ; 
     26                $depth = !is_numeric( $options[7] ) ? 0 : $options[7] ; 
     27                $child_of = !is_numeric( $options[8] ) ? 0 : $options[8] ; 
     28                $show_date = empty( $options[9] ) ? 'none' : $options[9] ; 
     29                $date_format = empty( $options[10] ) ? '' : $options[10] ; 
     30                $hierarchical = empty( $options[11] ) ? false : true ; 
     31                $meta_key = empty( $options[12] ) ? '' : $options[12] ; 
     32                $meta_value = empty( $options[13] ) ? '' : $options[13] ; 
    2533 
    2634                require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php'); 
     
    2937            $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />"; 
    3038                $form .= "<br />"; 
    31                 $form .= _MB_XPRESS_SORT_COLUMN ."\n"; 
    32                 $form .= "<select name='options[2]' size='1'>\n"; 
    33                 $selected[0] = ''; $selected[1]= ''; $selected[2]= ''; 
    34                 $selected[$sort_column] = ' selected '; 
    35                 $form .= "<option value='0' " . $selected[0] . " >" . _MB_XPRESS_TITLE . "</option>\n"; 
    36                 $form .= "<option value='1' " . $selected[1] . " >" . _MB_XPRESS_PUBLISH_DATE . "</option>\n"; 
    37                 $form .= "<option value='2' " . $selected[2] . " >" . _MB_XPRESS_MENU_ORDER . "</option>\n"; 
    38                 $form .= "</select><br />\n"; 
    39                 $form .= yes_no_radio_option('options[3]', _MB_XPRESS_SORT_ORDER , $sort_order_asc , _MB_XPRESS_SORT_ASC ,_MB_XPRESS_SORT_DESC) . "<br />\n"; 
    40                 $form .= yes_no_radio_option('options[4]', _MB_XPRESS_SHOW_DATE , $show_date) . "<br />\n"; 
    41                 $form .= _MB_XPRESS_DATE_FORMAT .": <input type='text' name='options[5]' value='" . $date_format . "' /><br />\n"; 
    42 //          $form .="<br /><input type='text' size='60' name='options[2]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />"; 
    43              
     39                $form .= _MB_XPRESS_PAGE_ORDERBY .": "; 
     40                $form .=  "<select name='options[2]'>"; 
     41                 
     42                if ($sort_column =='post_title') 
     43                        $form .=  "<option value='post_title' selected='selected'>". _MB_XPRESS_PAGE_TITLE; 
     44                else 
     45                        $form .=  "<option value='post_title'>". _MB_XPRESS_PAGE_TITLE; 
     46                 
     47                if ($sort_column =='menu_order') 
     48                        $form .=  "<option value='menu_order' selected='selected'>". _MB_XPRESS_PAGE_MENU_ORDER; 
     49                else 
     50                        $form .=  "<option value='menu_order'>". _MB_XPRESS_PAGE_MENU_ORDER; 
     51                 
     52                if ($sort_column =='post_date') 
     53                        $form .=  "<option value='post_date' selected='selected'>". _MB_XPRESS_PAGE_POST_DATE; 
     54                else 
     55                        $form .=  "<option value='post_date'>". _MB_XPRESS_PAGE_POST_DATE; 
     56                 
     57                if ($sort_column =='post_modified') 
     58                        $form .=  "<option value='post_modified' selected='selected'>". _MB_XPRESS_PAGE_POST_MODIFY; 
     59                else 
     60                        $form .=  "<option value='post_modified'>". _MB_XPRESS_PAGE_POST_MODIFY; 
     61                 
     62                if ($sort_column =='ID') 
     63                        $form .=  "<option value='ID' selected='selected'>". _MB_XPRESS_PAGE_ID; 
     64                else 
     65                        $form .=  "<option value='ID'>". _MB_XPRESS_PAGE_ID; 
     66                 
     67                if ($sort_column =='post_author') 
     68                        $form .=  "<option value='post_author' selected='selected'>". _MB_XPRESS_PAGE_AUTHOR; 
     69                else 
     70                        $form .=  "<option value='post_author'>". _MB_XPRESS_PAGE_AUTHOR; 
     71                 
     72                if ($sort_column =='post_name') 
     73                        $form .=  "<option value='post_name' selected='selected'>". _MB_XPRESS_PAGE_SLUG; 
     74                else 
     75                        $form .=  "<option value='post_name'>". _MB_XPRESS_PAGE_SLUG; 
     76                 
     77                $form .=  "</select><br/>"; 
     78                 
     79                 
     80                $form .= _MB_XPRESS_SORT_ORDER .": "; 
     81                $form .=  "<select name='options[3]'>"; 
     82                if ($sort_order =='asc') 
     83                        $form .=  "<option value='asc' selected='selected'>" . _MB_XPRESS_SORT_ASC; 
     84                else 
     85                        $form .=  "<option value='asc'>" . _MB_XPRESS_SORT_ASC; 
     86                if ($sort_order =='desc') 
     87                        $form .=  "<option value='desc' selected='selected'>" . _MB_XPRESS_SORT_DESC; 
     88                else 
     89                        $form .=  "<option value='desc'>" . _MB_XPRESS_SORT_DESC; 
     90                $form .=  "</select><br/>\n"; 
     91                 
     92                $form .= _MB_XPRESS_PAGE_EXCLUDE . "  <input type='text' name='options[4]' value='" . $exclude . "' size ='60' /><br />\n"; 
     93                $form .= _MB_XPRESS_PAGE_EXCLUDE_TREE . "  <input type='text' name='options[5]' value='" . $exclude_tree . "' size ='8' /><br />\n"; 
     94                $form .= _MB_XPRESS_PAGE_INCLUDE . "  <input type='text' name='options[6]' value='" . $includes . "' size ='60' /><br />\n"; 
     95                $form .= _MB_XPRESS_PAGE_DEPTH . "  <input type='text' name='options[7]' value='" . $depth . "' size ='8' /><br />"; 
     96                $form .= _MB_XPRESS_PAGE_CHILD_OF . "  <input type='text' name='options[8]' value='" . $child_of . "' size ='8' /><br />"; 
     97 
     98                $form .= _MB_XPRESS_SHOW_DATE_SELECT .": "; 
     99                $form .=  "<select name='options[9]'>"; 
     100                if ($show_date =='none') 
     101                        $form .=  "<option value='none' selected='selected'>" . _MB_XPRESS_SHOW_DATE_NONE; 
     102                else 
     103                        $form .=  "<option value='none'>" . _MB_XPRESS_SHOW_DATE_NONE; 
     104 
     105                if ($show_date =='post_date') 
     106                        $form .=  "<option value='post_date' selected='selected'>" . _MB_XPRESS_SHOW_POST_DATE; 
     107                else 
     108                        $form .=  "<option value='post_date'>" . _MB_XPRESS_SHOW_POST_DATE; 
     109 
     110                if ($show_date =='modified') 
     111                        $form .=  "<option value='modified' selected='selected'>" . _MB_XPRESS_SHOW_MODIFY_DATE; 
     112                else 
     113                        $form .=  "<option value='modified'>" . _MB_XPRESS_SHOW_MODIFY_DATE; 
     114                 
     115                $form .=  "</select><br/>\n"; 
     116 
     117                $form .= _MB_XPRESS_DATE_FORMAT .": <input type='text' name='options[10]' value='" . $date_format . "' /><br />\n"; 
     118                $form .= yes_no_radio_option('options[11]', _MB_XPRESS_PAGE_HIERARCHICAL , $hierarchical) . "<br />" ; 
     119                $form .= _MB_XPRESS_PAGE_META_KEY . "  <input type='text' name='options[12]' value='" . $meta_key . "' size ='40' /><br />\n"; 
     120                $form .= _MB_XPRESS_PAGE_META_VALUE . "  <input type='text' name='options[12]' value='" . $meta_value . "' size ='40' /><br />\n"; 
     121     
    44122                return $form; 
    45123        } 
  • trunk/language/ja_utf8/blocks.php

    r125 r127  
    1616        define("_MB_XPRESS_SORT_ASC","昇順"); 
    1717        define("_MB_XPRESS_SORT_DESC","降順"); 
     18        define("_MB_XPRESS_SHOW_DATE_SELECT","日付の表示"); 
     19        define("_MB_XPRESS_SHOW_DATE_NONE","表示しない"); 
     20        define("_MB_XPRESS_SHOW_POST_DATE","作成日を表示"); 
     21        define("_MB_XPRESS_SHOW_MODIFY_DATE","最終更新日を表示"); 
    1822        define("_MB_XPRESS_SHOW_DATE","日付を表示する"); 
    1923        define("_MB_XPRESS_DATE_FORMAT","日付のフォーマット(空白の場合WordPressでの設定が適用されます)"); 
     
    5963 
    6064// page          
    61         define("_MB_XPRESS_MENU_ORDER","メニューオーダー"); 
    62         define("_MB_XPRESS_SORT_COLUMN","並び順の項目"); 
     65        define("_MB_XPRESS_PAGE_ORDERBY","ページリストのソート項目"); 
     66        define("_MB_XPRESS_PAGE_TITLE","タイトル名順"); 
     67        define("_MB_XPRESS_PAGE_MENU_ORDER","ページ順"); 
     68        define("_MB_XPRESS_PAGE_POST_DATE","作成日順"); 
     69        define("_MB_XPRESS_PAGE_POST_MODIFY","最終更新日順"); 
     70        define("_MB_XPRESS_PAGE_ID","ページ ID順"); 
     71        define("_MB_XPRESS_PAGE_AUTHOR","作成者ID 順"); 
     72        define("_MB_XPRESS_PAGE_SLUG","ページスラッグ順"); 
     73        define("_MB_XPRESS_PAGE_EXCLUDE","リストから除外するページID をカンマ区切りで昇順に指定。"); 
     74        define("_MB_XPRESS_PAGE_EXCLUDE_TREE","リストから除外するページID を指定(子ページも除外されます)。"); 
     75        define("_MB_XPRESS_PAGE_INCLUDE","指定したページID のみリストに表示。カンマ区切りで昇順に指定"); 
     76        define("_MB_XPRESS_PAGE_DEPTH","ページ階層のどのレベルまでをリストに出力するかを指定。 (0=全親子ページを出力)"); 
     77        define("_MB_XPRESS_PAGE_CHILD_OF","指定IDのページを親とする階層のページをリストに表示します。(0=全親子ページを出力)"); 
     78        define("_MB_XPRESS_PAGE_HIERARCHICAL","子ページをリスト表示するとき、インデント(字下げ)する。"); 
     79        define("_MB_XPRESS_PAGE_META_KEY","ここに記述したカスタムフィールドキーを持つページだけを表示します。"); 
     80        define("_MB_XPRESS_PAGE_META_VALUE","ここに記述したカスタムフィールド値を持つページだけを表示します。"); 
    6381         
    6482// Search 
     
    91109        define("_MB_XPRESS_CAT_INCLUDE","指定したカテゴリID のみリストに表示。カンマ区切りで昇順に指定"); 
    92110        define("_MB_XPRESS_CAT_HIERARCHICAL","サブカテゴリーを表示するとき、インデント(字下げ)する。"); 
    93         define("_MB_XPRESS_CAT_DEPTH","カテゴリ階層のどのレベルまでをカテゴリリストに出力するかを指定。 (0=全親子カテゴリを出力)"); 
     111        define("_MB_XPRESS_CAT_DEPTH","カテゴリ階層のどのレベルまでをリストに出力するかを指定。 (0=全親子カテゴリを出力)"); 
    94112         
    95113// meta  
  • trunk/templates/source/page_block.html

    r121 r127  
    22        The template tag of the following list can be used.  
    33                <{$block.err_message}>                                  // When the block cannot be displayed, this outputs the reason. Please do not delete it. 
    4                 <{$block.data_count}>                                   // The number of archives is displayed.  
    5                 <{$block.contents}>                                             // Data array of archives.  
    6                 // Examples of <{$block.contents}> 
    7                 <{foreach from=$block.contents item=content}>   // Loop 
    8                 <{$content.page}>                                               // the author name is displayed as a link to their posts. Optionally this tag displays each author's post count. 
    9                 <{/foreach}>                                                    // End of Loop 
     4                <{$block.list_pages}>                                   // Displays Pages List from wp_list_pages() function 
    105************************* End of usage ************************ *}> 
    116<{* Start Template *}> 
     
    149        <{$block.err_message}> 
    1510        <div class='xpress_page_block'> 
    16                 <ul> 
    17                 <{foreach from=$block.contents item=content}> 
    18                         <li> 
    19                         <{$content.page}> 
    20                         </li> 
    21                 <{/foreach}> 
    22                 </ul> 
     11                <{$block.list_pages}> 
    2312        </div> 
    2413</div> 
  • trunk/wp-content/themes/xpress_default/blocks/page_block_theme.php

    r121 r127  
    55        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 
    66        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_page_block.html' : trim( $options[1] ); 
    7         $sort_column = empty( $options[2] ) ? 0 : $options[2] ; 
    8         $sort_order_asc = empty( $options[3] ) ? 0 : 1 ; 
    9         $show_date = empty( $options[4] ) ? 0 : 1 ; 
    10         $date_format = empty( $options[5] ) ? '' : $options[5] ; 
     7        $sort_column = empty( $options[2] ) ? 'post_title' : $options[2] ; 
     8        $sort_order = empty( $options[3] ) ? 'asc' : $options[3] ; 
     9        $exclude = empty( $options[4] ) ? '' : $options[4] ; 
     10        $exclude_tree = !is_numeric( $options[5] ) ? 0 : $options[5] ; 
     11        $includes = empty( $options[6] ) ? '' : $options[6] ; 
     12        $depth  = !is_numeric( $options[7] ) ? 0 : $options[7] ; 
     13        $child_of  = !is_numeric( $options[8] ) ? 0 : $options[8] ; 
     14        $show_date = empty( $options[9] ) ? 'none' : $options[9] ; 
     15        $date_format = empty( $options[10] ) ? '' : $options[10] ; 
     16        $hierarchical = empty( $options[11] ) ? false : true ; 
     17        $meta_key = empty( $options[12] ) ? '' : $options[12] ; 
     18        $meta_value = empty( $options[13] ) ? '' : $options[13] ; 
    1119 
    12         switch ($sort_column) { 
    13                 case 0: 
    14                         $sort_column_name = 'post_title'; 
    15                         break ; 
    16                 case 1: 
    17                         $sort_column_name = 'post_date'; 
    18                         break ; 
    19                 case 2: 
    20                         $sort_column_name = 'menu_order'; 
    21                         break ; 
    22                 default: 
    23                         $sort_column_name = 'post_title'; 
    24                         break ; 
    25         } 
    2620        if (empty($date_format)) $date_format = get_option('date_format'); 
    27         if ($show_date) $show_date_name = 'post_date' ; else $show_date_name = ''; 
     21        if ($exclude_tree == 0 ) $exclude_tree = ''; 
     22        if ($show_date == 'none' ) $show_date = ''; 
     23         
    2824        $parm = array( 
    29         'depth'       => 0,  
    30         'title_li'    => '',  
    31         'show_date'   => $show_date_name, 
    32         'date_format' => $date_format, 
    33         'child_of'    => 0,  
    34         'exclude'     => '', 
    35         'echo'        => 0, 
    36         'authors'     => '', 
    37         'sort_column' => $sort_column_name 
     25        'sort_column'   => $sort_column,  
     26        'sort_order'    => $sort_order,  
     27        'exclude'               => $exclude, 
     28        'exclude_tree'  => $exclude_tree, 
     29        'include'               => $includes, 
     30        'depth'                 => $depth,  
     31        'child_of'              => $child_of, 
     32        'show_date'             => $show_date, 
     33        'date_format'   => $date_format, 
     34        'title_li'              => '', 
     35        'echo'                  => 0, 
     36        'hierarchical'  => $hierarchical, 
     37        'meta_key'              => $meta_key, 
     38        'meta_value'    => $meta_value 
    3839    ); 
    3940         
    40         $content = wp_list_pages($parm); 
    41                 $item_no = 0; 
    42                 $row_data = array( 
    43                         'page'          => $content 
    44                 ); 
    45                 $block['contents']['item'.$item_no] = $row_data; 
    46                 $item_no++; 
    47  
    48         $block['data_count'] = $item_no;  //xml unserialise error 
    49  
     41        $output = "<ul>\n" . wp_list_pages($parm) . "\n</ul>\n"; 
     42        $block['list_pages'] = $output; 
    5043        return $block ;  
    5144} 
  • trunk/xoops_version.php

    r125 r127  
    187187        'show_func'     => "b_". $mydirname . "_page_show" , 
    188188        'edit_func'     => "b_". $mydirname . "_page_edit" , 
    189         'options'               => $mydirname. '||0|1|1|' , 
    190         'can_clone'             => false , 
     189        'options'               => $mydirname. '||post_title|asc||0||0|0|none||1||' , 
     190        'can_clone'             => true , 
    191191        'func_num'              => $b_no, 
    192192); 
Note: See TracChangeset for help on using the changeset viewer.