array( 'title_update' => 'キャッシュ更新', 'msg_adminpass' => '管理者パスワード', 'btn_submit' => '実行', 'msg_done' => 'キャッシュの更新が完了しました。', 'msg_usage' => ' * 処理内容 :文字実体参照にマッチする正規表現パターンのキャッシュを更新| PHPの持つテーブルおよびW3CのDTDをスキャンして、キャッシュに記録します。 * 処理対象 「COLOR(red){not found.}」と表示されたファイルは処理されません。 -%s * 実行 管理者パスワードを入力して、[実行]ボタンをクリックしてください。 ' ) ); set_plugin_messages($messages); } function plugin_update_entities_action() { global $script, $vars; global $_entities_messages; if (empty($vars['action']) or empty($vars['adminpass']) or ! pkwk_login($vars['adminpass'])) { $items = plugin_update_entities_create(); $body = convert_html(sprintf($_entities_messages['msg_usage'],join("\n-",$items))); $body .= <<
{$_entities_messages['msg_adminpass']}
EOD; return array( 'msg'=>$_entities_messages['title_update'], 'body'=>$body ); } else if ($vars['action'] == 'update') { plugin_update_entities_create(TRUE); return array( 'msg'=>$_entities_messages['title_update'], 'body'=>$_entities_messages['msg_done'] ); } return array( 'msg'=>$_entities_messages['title_update'], 'body'=>$_entities_messages['err_invalid'] ); } function plugin_update_entities_create($do=FALSE) { $files = array('xhtml-lat1.ent','xhtml-special.ent','xhtml-symbol.ent'); $entities = strtr( array_values(get_html_translation_table(HTML_ENTITIES)), array('&'=>'',';'=>'') ); $items = array('php:html_translation_table'); foreach ($files as $file) { $source = file(W3C_XHTML_DTD_LOCATION.$file); // or die_message('cannot receive '.W3C_XHTML_DTD_LOCATION.$file.'.'); if (!is_array($source)) { $items[] = "w3c:$file COLOR(red):not found."; continue; } $items[] = "w3c:$file"; if (preg_match_all('/maybe permission is not writable or filename is too long'); fwrite($fp,$pattern); fclose($fp); return $items; } ?>