ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 6349


Ignore:
Timestamp:
Apr 7, 2008, 1:20:02 PM (14 years ago)
Author:
ebihara
Message:

#333:merged prj_deco_diary branche

Location:
OpenPNE/trunk
Files:
23 edited
104 copied

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/public_html/js/pne.js

    r2849 r6349  
    77    document.write('<a href="'+url+'" target="_blank">'+urlstr+'</a>');
    88}
     9
     10function pne_toggle_mce_editor(id)
     11{
     12    tinyMCE.execCommand("mceToggleEditor", false, id);
     13
     14    if (tinyMCE.get(id).isHidden()) {
     15        document.getElementById('mce_editor_buttonmenu').style.display = "block";
     16    } else {
     17        document.getElementById('mce_editor_buttonmenu').style.display = "none";
     18    }
     19}
     20
     21function pne_mce_editor_init()
     22{
     23    tinyMCE.init({
     24        mode : "textareas",
     25        theme : "advanced",
     26        editor_selector : "mceEditor_dummy_selector",
     27        plugins : "openpne",
     28        theme_advanced_toolbar_location : "top",
     29        theme_advanced_toolbar_align : "left",
     30        theme_advanced_buttons1 : "op_b,op_u,op_s,op_i,op_large,op_small,op_color,op_album,op_emoji_docomo,op_emoji_au,op_emoji_softbank",
     31        theme_advanced_buttons2 : "",
     32        theme_advanced_buttons3 : "",
     33        valid_elements : "b/strong,u,s/strike,i,font[color|size],br",
     34        forced_root_block : false,
     35        force_p_newlines : false,
     36        force_br_newlines : true,
     37        inline_styles : false,
     38        language : "ja"
     39    });
     40
     41    var textmode_checkbox = document.getElementById("mce_editor_mode_changer_1");
     42    var previewmode_checkbox = document.getElementById("mce_editor_mode_changer_2");
     43    if (previewmode_checkbox.checked) {
     44        textmode_checkbox.checked = true;
     45        previewmode_checkbox.checked = false;
     46    }
     47}
     48
     49function pne_mce_insert_tagname(id, tagname)
     50{
     51    var opt = "";
     52
     53    var elm = document.getElementById(id);
     54    var selection = new Selection(elm);
     55
     56    var pos = selection.create();
     57
     58    if (tagname == "op:color") {
     59        opt = " code=\"#000000\"";
     60    }
     61
     62    var replace = "<" + tagname + opt + ">" + elm.value.substring(pos.start, pos.end) + "</" + tagname + ">";
     63    var head = elm.value.substring(0, pos.start);
     64    var tail = elm.value.substring(pos.end, elm.value.length);
     65    elm.value =  head + replace + tail;
     66}
     67
  • OpenPNE/trunk/public_html/modules/admin/default.css

    r5859 r6349  
    220220#admin_page_edit_c_holiday li#adminSNSConfig ul.pull ,
    221221#admin_page_list_c_rank li#adminSNSConfig ul.pull ,
     222#admin_page_edit_deco li#adminSNSConfig ul.pull ,
    222223
    223224#admin_page_list_c_admin_user li#adminAdminConfig ul.pull ,
     
    14641465#admin_page_blacklist_delete_confirm div.contents p.textBtn { display: inline;}
    14651466
     1467/** admin_page_edit_deco **/
     1468
     1469#admin_page_edit_deco div.contents h3.ttl01 { border-left:0.5em solid #58585C; margin-bottom: 0.5em; font-size:1.4em; padding-left: 0.3em; }
     1470
    14661471/*********** footer ***********/
    14671472.footer { margin-top: 20px; padding: 10px 0; text-align: center;}
  • OpenPNE/trunk/webapp/lib/OpenPNE/Config.php

    r5965 r6349  
    5252            'OPENPNE_IS_SET_KTAI_FONT_SIZE',
    5353            'OPENPNE_USE_RANKING',
     54            'OPENPNE_USE_DECORATION',
    5455        );
    5556    }
     
    147148            'OPENPNE_SKIN_THEME' => '005_openpne_blue',
    148149            'OPENPNE_IS_SET_KTAI_FONT_SIZE' => 1,
     150            'OPENPNE_USE_DECORATION' => 1,
    149151        // config.php
    150152            'OPENPNE_RSS_CACHE_DIR' => OPENPNE_VAR_DIR . '/rss_cache',
  • OpenPNE/trunk/webapp/lib/db/etc.php

    r5856 r6349  
    880880}
    881881
     882function db_decoration_enable_list()
     883{
     884    $sql = 'SELECT tagname,is_enabled FROM c_config_decoration';
     885    $decoration_enable_list = db_get_all($sql);
     886
     887    $result = array();
     888    foreach ($decoration_enable_list as $value) {
     889        $tagname = strtr($value['tagname'], ':', '_');
     890        $result[$tagname] = $value['is_enabled'];
     891    }
     892
     893    return $result;
     894}
     895
     896function db_decoration_is_enabled4tagname($tagname)
     897{
     898    $sql = 'SELECT is_enabled FROM c_config_decoration WHERE tagname = ?';
     899    $is_enabled = db_get_one($sql, array($tagname));
     900
     901    return $is_enabled;
     902}
     903
    882904?>
  • OpenPNE/trunk/webapp/modules/admin/init.inc

    r4933 r6349  
    7070'page_update_c_profile',
    7171'page_update_c_rank',
     72'page_update_deco',
    7273'do_delete_c_banner',
    7374'do_delete_c_cmd',
     
    122123'do_update_skin_theme',
    123124'do_update_top_banner_html',
     125'do_update_c_deco',
    124126),
    125127
     
    193195'page_user_analysis_date_month',
    194196'page_user_analysis_generation',
     197'page_edit_deco',
    195198'do_delete_c_banner',
    196199'do_delete_c_cmd',
     
    258261'do_update_skin_theme',
    259262'do_update_top_banner_html',
     263'do_update_c_deco',
    260264),
    261265);
  • OpenPNE/trunk/webapp/modules/admin/lib/db_admin.php

    r5965 r6349  
    28942894}
    28952895
     2896function db_admin_c_config_decoration_list()
     2897{
     2898    $sql = 'SELECT * FROM c_config_decoration';
     2899    $c_config_decoration_list = db_get_all($sql);
     2900
     2901    return $c_config_decoration_list;
     2902}
     2903
     2904function db_admin_update_c_config_decoration($c_config_decoration_id, $is_enabled)
     2905{
     2906    $data = array(
     2907        'is_enabled' => $is_enabled,
     2908    );
     2909    $where = array('c_config_decoration_id' => $c_config_decoration_id);
     2910    return db_update('c_config_decoration', $data, $where);
     2911}
    28962912?>
  • OpenPNE/trunk/webapp/modules/admin/page/edit_skin_image.php

    r4933 r6349  
    1212        $this->set('theme_list', $this->_search_skin_dir());
    1313        $this->set('skin_list', db_get_c_skin_filename_list());
     14
     15        $c_config_decoration_list = db_admin_c_config_decoration_list();
     16        foreach ($c_config_decoration_list as $key => $value) {
     17            $c_config_decoration_list[$key]['tagname'] = strtr($value['tagname'], ':', '_');
     18        }
     19        $this->set('c_config_decoration_list', $c_config_decoration_list);
     20
    1421        return 'success';
    1522    }
  • OpenPNE/trunk/webapp/modules/admin/templates/diary_list.tpl

    r5089 r6349  
    109109({/if})
    110110({if $smarty.const.OPENPNE_ADMIN_CONVERT_URL})
    111 ({$item.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'})
     111({$item.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'|t_decoration:1})
    112112({else})
    113 ({$item.body|nl2br})
     113({$item.body|nl2br|t_decoration:1})
    114114({/if})
    115115</td>
  • OpenPNE/trunk/webapp/modules/admin/templates/edit_c_admin_config.tpl

    r5106 r6349  
    211211</select></td>
    212212</tr>
    213 
     213<tr>
     214<th colspan="2">文字装飾使用設定</th>
     215<td>
     216<span class="info">文字装飾機能を有効にするかどうかを設定します</span><br />
     217<select class="basic" name="OPENPNE_USE_DECORATION">
     218<option value="1"({if $smarty.const.OPENPNE_USE_DECORATION}) selected="selected"({/if})>使用する</option>
     219<option value="0"({if !$smarty.const.OPENPNE_USE_DECORATION}) selected="selected"({/if})>使用しない</option>
     220</select></td>
     221</tr>
    214222<tr class="cell20">
    215223<th colspan="2">cmdタグ使用設定</th>
  • OpenPNE/trunk/webapp/modules/admin/templates/edit_skin_image.tpl

    r5005 r6349  
    922922</tr>
    923923({*******})
     924<tr class="skin13">
     925<th><a name="skin13">文字装飾画像</a></th>
     926</tr>
     927<tr class="skin13">
     928<td>
     929({foreach from=$c_config_decoration_list item=item})
     930<dl class="box">
     931<dt><strong>({$item.caption})</strong></dt>
     932<dd class="image">({assign var=skinname value=deco_`$item.tagname`})
     933<a href="({t_img_url_skin filename=$skinname})" target="_blank"><img src="({t_img_url_skin filename=$skinname w=180 h=180})" /></a>
     934</dd>
     935<dd class="default">
     936({if $skin_list[$skinname]})[<a href="?m=({$module_name})&amp;a=do_({$hash_tbl->hash('delete_skin_image','do')})&amp;skinname=({$skinname})&amp;sessid=({$PHPSESSID})">デフォルトに戻す</a>]<br />({/if})
     937</dd>
     938<dd class="submit">
     939<form action="./" method="post" enctype="multipart/form-data" >
     940<input type="hidden" name="m" value="({$module_name})" />
     941<input type="hidden" name="a" value="do_({$hash_tbl->hash('update_skin_image','do')})" />
     942<input type="hidden" name="sessid" value="({$PHPSESSID})" />
     943<input type="hidden" name="skinname" value="({$skinname})" />
     944<input type="file" name="upfile" /><span class="textBtnS"><input type="submit" value="変更" /></span>
     945</form></dd>
     946</dl>
     947({/foreach})
     948<br class="clear" />
     949</td>
     950</tr>
     951({*******})
    924952<tr class="skin12">
    925953<th><a name="skin12">携帯版画像</a></th>
  • OpenPNE/trunk/webapp/modules/admin/templates/inc_header.tpl

    r6120 r6349  
    134134<li><a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('list_c_cmd')})">CMD設定</a></li>
    135135<li><a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('list_c_api')})">API設定</a></li>
     136({if $smarty.const.OPENPNE_USE_DECORATION})
     137<li><a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('edit_deco')})">文字装飾設定</a></li>
     138({/if})
    136139</ul>
    137140</li>
  • OpenPNE/trunk/webapp/modules/admin/templates/inc_subnavi_adminSNSConfig.tpl

    r4216 r6349  
    1414<a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('list_c_cmd')})">CMD設定</a>&nbsp;|&nbsp;
    1515<a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('list_c_api')})">API設定</a>&nbsp;|&nbsp;
     16({if $smarty.const.OPENPNE_USE_DECORATION})
     17<a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('edit_deco')})">文字装飾設定</a>&nbsp;|&nbsp;
     18({/if})
    1619({/strip})
    1720</div>
  • OpenPNE/trunk/webapp/modules/admin/validate/do/update_c_admin_config.ini

    r5079 r6349  
    180180type = "bool"
    181181default = "1"
     182
     183[OPENPNE_USE_DECORATION]
     184type = "bool"
     185default = "1"
  • OpenPNE/trunk/webapp/modules/ktai/templates/fh_diary.tpl

    r6067 r6349  
    1313</td></tr></table>
    1414<a href="#({if $c_diary_comment})dc1({else})({if $is_prev || $is_next})pager({else})write({/if})({/if})"><font color="#({$ktai_color_config.font_08})">▼</font></a>({$target_c_diary.r_datetime|date_format:"%y/%m/%d %H:%M"})({if $target_diary_writer.c_member_id==$u}) [<a href="({t_url m=ktai a=page_h_diary_edit})&amp;target_c_diary_id=({$target_c_diary.c_diary_id})&amp;({$tail})">編集</a>][<a href="({t_url m=ktai a=page_fh_diary_delete_c_diary_confirm})&amp;target_c_diary_id=({$target_c_diary.c_diary_id})&amp;({$tail})">削除</a>]({/if})<br>
    15 ({$target_c_diary.body|t_url2a_ktai|nl2br})
     15({$target_c_diary.body|t_url2a_ktai|nl2br|t_decoration_ktai})
    1616<br>
    1717({if $target_c_diary.image_filename_1})
  • OpenPNE/trunk/webapp/modules/pc/init.inc

    r6179 r6349  
    5757    $smarty->assign('INC_HEADER_inc_page_top', p_common_c_siteadmin4target_pagename('inc_page_top'));
    5858    $smarty->assign('INC_HEADER_inc_page_top2', p_common_c_siteadmin4target_pagename('inc_page_top2'));
     59    $smarty->assign('INC_HEADER_decoration_config', db_decoration_enable_list());
    5960
    6061    // INC_FOOTER_* (inc_footer.tpl)
  • OpenPNE/trunk/webapp/modules/pc/templates/common/layout.tpl

    r6328 r6349  
    1111<link rel="stylesheet" href="./xhtml_style.php" type="text/css" />
    1212<script type="text/javascript" src="./js/prototype.js"></script>
     13<script type="text/javascript" src="./js/Selection.js"></script>
    1314<script type="text/javascript" src="./js/pne.js"></script>
     15<script type="text/javascript" src="./js/tiny_mce/tiny_mce.js"></script>
    1416<style type="text/css">
    1517.border_01 { border: #({$INC_HEADER_color_config.border_01}) 1px solid; }
     
    3436body { background-color: #({$INC_HEADER_color_config.bg_12}); }
    3537.container { background-color: #({$INC_HEADER_color_config.bg_13}); }
     38
     39/* 文字装飾 */
     40({if $INC_HEADER_decoration_config.op_b})
     41span.op_b {
     42    font-weight : bold;
     43}
     44({/if})
     45
     46({if $INC_HEADER_decoration_config.op_u})
     47span.op_u {
     48    text-decoration : underline;
     49}
     50({/if})
     51
     52({if $INC_HEADER_decoration_config.op_s})
     53span.op_s {
     54    text-decoration : line-through;
     55}
     56({/if})
     57
     58({if $INC_HEADER_decoration_config.op_i})
     59span.op_i {
     60    font-style : italic;
     61}
     62({/if})
     63
     64({if $INC_HEADER_decoration_config.op_large})
     65span.op_large {
     66    font-size : 20px;
     67}
     68({/if})
     69
     70({if $INC_HEADER_decoration_config.op_small})
     71span.op_small {
     72    font-size : 8px;
     73}
     74({/if})
     75
     76({if !$INC_HEADER_decoration_config.op_color})
     77span.op_color {
     78    color : #000 !important;
     79}
     80({/if})
    3681</style>
    3782</head>
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_diary.tpl

    r6318 r6349  
    110110({/if})
    111111<p class="text">
    112 ({$target_diary.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'})
     112({$target_diary.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'|t_decoration})
    113113</p>
    114114</div>
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_diary_list.tpl

    r6014 r6349  
    149149</ul>
    150150({/if})
    151 <p class="text">({$item.body|t_truncate:48:"":3})</p>
     151<p class="text">({$item.body|t_decoration:1|t_truncate:48:"":3})</p>
    152152</div>
    153153<div class="footer">
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_add.tpl

    r6014 r6349  
    8989<td>
    9090({if $inc_entry_point[3]})({$inc_entry_point[3]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})({/if})
    91 <textarea name="body" rows="15" cols="50">({$form_val.body})</textarea>
     91
     92({if $smarty.const.OPENPNE_USE_DECORATION})
     93<input type="radio" name="mce_editor_mode_changer" id="mce_editor_mode_changer_1" onchange="pne_toggle_mce_editor('mce_editor_textarea')" checked="checked" /><label for="mce_editor_mode_changer_1">テキストモード</label>&nbsp;<input type="radio" name="mce_editor_mode_changer" id="mce_editor_mode_changer_2" onchange="pne_toggle_mce_editor('mce_editor_textarea')" /><label for="mce_editor_mode_changer_2">プレビューモード</label>
     94<div id="mce_editor_buttonmenu">
     95({foreach from=$INC_HEADER_decoration_config item=item key=key})
     96({if item})
     97<a href="#" onclick="pne_mce_insert_tagname('mce_editor_textarea', '({$key|replace:"_":":"})');"><img src="({t_img_url_skin filename=deco_`$key`})" alt="" /></a>
     98({/if})
     99({/foreach})
     100</div>
     101
     102<script type="text/javascript">
     103function pne_mce_editor_get_config()
     104{
     105    return {
     106        op_b : {
     107            isEnabled : ({$INC_HEADER_decoration_config.op_b}),
     108            imageURL : "({t_img_url_skin filename=deco_op_b})"
     109        },
     110        op_u : {
     111            isEnabled : ({$INC_HEADER_decoration_config.op_u}),
     112            imageURL : "({t_img_url_skin filename=deco_op_u})"
     113        },
     114        op_s : {
     115            isEnabled : ({$INC_HEADER_decoration_config.op_s}),
     116            imageURL : "({t_img_url_skin filename=deco_op_s})"
     117        },
     118        op_i : {
     119            isEnabled : ({$INC_HEADER_decoration_config.op_i}),
     120            imageURL : "({t_img_url_skin filename=deco_op_i})"
     121        },
     122        op_large : {
     123            isEnabled : ({$INC_HEADER_decoration_config.op_large}),
     124            imageURL : "({t_img_url_skin filename=deco_op_large})"
     125        },
     126        op_small : {
     127            isEnabled : ({$INC_HEADER_decoration_config.op_small}),
     128            imageURL : "({t_img_url_skin filename=deco_op_small})"
     129        },
     130        op_color : {
     131            isEnabled : ({$INC_HEADER_decoration_config.op_color}),
     132            imageURL : "({t_img_url_skin filename=deco_op_color})"
     133        }
     134    }
     135}
     136
     137pne_mce_editor_init();
     138</script>
     139({/if})
     140
     141<textarea id="mce_editor_textarea" name="body" rows="15" cols="50">({$form_val.body})</textarea>
    92142</td>
    93143</tr>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_add_confirm.tpl

    r6137 r6349  
    55<div class="dparts formTable"><div class="parts">
    66<div class="partsHeading"><h3>日記を書く</h3></div>
    7 <div class="partsInfo"
     7<div class="partsInfo">
    88<p>以下の内容でよろしいですか?</p>
    99</div>
     
    1515<tr>
    1616<th>本文</th>
    17 <td>({$form_val.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'})</td>
     17<td>({$form_val.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'|t_decoration})</td>
    1818</tr>
    1919({if $form_val.upfile_1.name})
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_edit.tpl

    r6014 r6349  
    9191<td>
    9292({if $inc_entry_point[3]})({$inc_entry_point[3]|smarty:nodefaults|t_url2cmd:'entry_point'|t_cmd:'entry_point'})</div>({/if})
    93 <textarea name="body" rows="15" cols="50">({$diary.body})</textarea>
     93
     94({if $smarty.const.OPENPNE_USE_DECORATION})
     95<input type="radio" name="mce_editor_mode_changer" id="mce_editor_mode_changer_1" onchange="pne_toggle_mce_editor('mce_editor_textarea')" checked="checked" /><label for="mce_editor_mode_changer_1">テキストモード</label>&nbsp;<input type="radio" name="mce_editor_mode_changer" id="mce_editor_mode_changer_2" onchange="pne_toggle_mce_editor('mce_editor_textarea')" /><label for="mce_editor_mode_changer_2">プレビューモード</label>
     96
     97<div id="mce_editor_buttonmenu">
     98({foreach from=$INC_HEADER_decoration_config item=item key=key})
     99({if item})
     100<a href="#" onclick="pne_mce_insert_tagname('mce_editor_textarea', '({$key|replace:"_":":"})');"><img src="({t_img_url_skin filename=deco_`$key`})" alt="" /></a>&nbsp;
     101({/if})
     102({/foreach})
     103</div>
     104
     105<script type="text/javascript">
     106function pne_mce_editor_get_config()
     107{
     108    return {
     109        op_b : {
     110            isEnabled : ({$INC_HEADER_decoration_config.op_b}),
     111            imageURL : "({t_img_url_skin filename=deco_op_b})"
     112        },
     113        op_u : {
     114            isEnabled : ({$INC_HEADER_decoration_config.op_u}),
     115            imageURL : "({t_img_url_skin filename=deco_op_u})"
     116        },
     117        op_s : {
     118            isEnabled : ({$INC_HEADER_decoration_config.op_s}),
     119            imageURL : "({t_img_url_skin filename=deco_op_s})"
     120        },
     121        op_i : {
     122            isEnabled : ({$INC_HEADER_decoration_config.op_i}),
     123            imageURL : "({t_img_url_skin filename=deco_op_i})"
     124        },
     125        op_large : {
     126            isEnabled : ({$INC_HEADER_decoration_config.op_large}),
     127            imageURL : "({t_img_url_skin filename=deco_op_large})"
     128        },
     129        op_small : {
     130            isEnabled : ({$INC_HEADER_decoration_config.op_small}),
     131            imageURL : "({t_img_url_skin filename=deco_op_small})"
     132        },
     133        op_color : {
     134            isEnabled : ({$INC_HEADER_decoration_config.op_color}),
     135            imageURL : "({t_img_url_skin filename=deco_op_color})"
     136        }
     137    }
     138}
     139
     140pne_mce_editor_init();
     141</script>
     142({/if})
     143
     144<textarea id="mce_editor_textarea" name="body" rows="15" cols="50">({$diary.body})</textarea>
    94145</td>
    95146</tr>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_edit_confirm.tpl

    r6014 r6349  
    1010<table>
    1111<tr><th>タイトル</th><td>({$form_val.subject})</td></tr>
    12 <tr><th>本文</th><td>({$form_val.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'})</td></tr>
     12<tr><th>本文</th><td>({$form_val.body|nl2br|t_url2cmd:'diary'|t_cmd:'diary'|t_decoration})</td></tr>
    1313({if $form_val.upfile_1.name})
    1414<tr><th>写真1</th><td>({$form_val.upfile_1.name})</td></tr>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_list_all.tpl

    r6319 r6349  
    4949<th>タイトル</th><td>({$diary.subject}) (({$diary.num_comment}))({if $diary.image_filename_1 || $diary.image_filename_2 || $diary.image_filename_3}) <img src="({t_img_url_skin filename=icon_camera})" alt="" />({/if})</td>
    5050</tr><tr>
    51 <th>本文</th><td>({$diary.body|t_truncate:36:"":3})</td>
     51<th>本文</th><td>({$diary.body|t_decoration:1|t_truncate:36:"":3})</td>
    5252</tr><tr class="operation">
    5353<th>作成日時</th><td><span class="text">({$diary.r_datetime|date_format:"%m月%d日 %H:%M"})</span> <span class="moreInfo"><a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$diary.c_diary_id})"><img src="({t_img_url_skin filename=button_shosai})" alt="詳細を見る" /></a></span></td>
Note: See TracChangeset for help on using the changeset viewer.