public function __toString() { $body = empty($this->body) ? null : InlineFactory::factory($this->body); $str = FALSE; // Try to call the plugin $str = PluginRenderer::executePluginInline($this->name, $this->param, $body); if ($str !== FALSE) { return $str; // Succeed } else { // No such plugin, or Failed $body = (empty($body) ? '' : '{' . $body . '}') . ';'; return parent::setLineRules(Utility::htmlsc('&' . $this->plain) . $body); } }
function do_plugin_inline($name, $args = '', $body = '') { return PluginRenderer::executePluginInline($name, $args, $body); }
public function __toString() { $body = empty($this->body) ? '' : InlineFactory::factory($this->body); return PluginRenderer::executePluginInline($this->name, $this->param, $body); }
/** * ページ出力の内容を生成 * @return string */ public function getContent() { global $_LINK, $info, $_LANG; global $site_name, $newtitle, $modifier, $modifierlink, $menubar, $sidebar, $headarea, $footarea, $navigation; $body = $this->body; // Linkタグ $_LINK = self::getLinkSet($this->page); // ページをコンストラクト $view = new View(THEME_NAME); // ページ名が指定されているか $view->is_page = isset($this->page); // readプラグイン(通常時動作)か? $view->is_read = $this->cmd === 'read'; // ページが凍結されているか $view->is_freeze = isset($this->page) ? Factory::Wiki($this->page)->isFreezed() : false; if ($this->cmd === 'read') { // ページを読み込む場合 global $adminpass, $_string, $menubar, $sidebar; // パスワードがデフォルトのままだった時に警告を出す if ($adminpass == '{x-php-md5}1a1dc91c907325c69271ddf0c944bc72' || $adminpass == '') { $body = '<p class="alert alert-danger"><span class="fa fa-exclamation-triangle"></span>' . '<strong>' . $_string['warning'] . '</strong> ' . $_string['changeadminpass'] . '</p>' . "\n" . $body; } // デバッグモード時に記載 if (DEBUG === true && !empty($info)) { $body = '<div class="panel panel-info" id="pkwk-info">' . '<div class="panel-heading"><span class="fa fa-info-circle"></span>' . $_string['debugmode'] . '</div>' . "\n" . '<div class="panel-body">' . "\n" . '<ul>' . "\n" . '<li>' . join("</li>\n<li>", $info) . '</li>' . "\n" . '</ul></div></div>' . "\n\n" . $body; } // リファラーを保存 Factory::Referer($this->page)->set(); // 最終更新日 $view->lastmodified = '<time datetime="' . Time::getZoneTimeDate('c', $this->wiki->time()) . '">' . Time::getZoneTimeDate('D, d M Y H:i:s T', $this->wiki->time()) . ' ' . $this->wiki->passage() . '</time>'; // ページの添付ファイル $view->attaches = $this->getAttaches(); // 関連リンク $view->related = $this->getRelated(); // 注釈 global $foot_explain; ksort($foot_explain, SORT_NUMERIC); $notes = count($foot_explain) !== 0 ? '<ul>' . join("\n", $foot_explain) . '</ul>' : ''; // 検索語句をハイライト if (isset($vars['word'])) { $notes = self::hilightWord($vars['word'], $notes); $body = '<p class="alert alert-info">' . $_string['word'] . '<var>' . Utility::htmlsc($vars['word']) . '</var></p>' . "\n" . '<hr />' . "\n" . self::hilightWord($vars['word'], $body); } $view->notes = $notes; // モードによって、3カラム、2カラムを切り替える。 $isExistSideBar = Factory::Wiki($sidebar)->has(); // #nomenubarが指定されると$menubarはnullになる if (empty($menubar) && !$isExistSideBar) { $view->colums = View::CLASS_NO_COLUMS; } elseif (empty($menubar) || !$isExistSideBar) { $view->colums = View::CLASS_TWO_COLUMS; } else { $view->colums = View::CLASS_THREE_COLUMS; } $view->menubar = !empty($menubar) && Factory::Wiki($menubar)->has() ? PluginRenderer::executePluginBlock('menu') : null; $view->sidebar = $isExistSideBar ? PluginRenderer::executePluginBlock('side') : null; // ステータスアイコン if ($this->wiki->isFreezed()) { // 錠前マーク(フリーズされてる) $view->status = '<i class="fa fa-lock" title="Freezed" aria-hidden="true"></i>'; } else { if (!$this->wiki->isEditable()) { // 駐禁マーク(編集できない) $view->status = '<i class="fa fa-ban" title="Not Editable" aria-hidden="true"></i>'; } else { // 鉛筆マーク(編集できる) $view->status = '<i class="fa fa-pencil-square" title="Editable" aria-hidden="true"></i>'; } } } else { // プラグインを実行する場合、大抵の場合メニューバーやサイドバーを表示しない $view->colums = View::CLASS_NO_COLUMS; // ステータスアイコンを歯車にする $view->status = '<i class="fa fa-cog" title="Function mode" aria-hidden="true"></i>'; } // ナビバー $view->navibar = PluginRenderer::executePluginBlock('navibar', $view->conf['navibar']); // ツールバー $view->toolbar = PluginRenderer::executePluginBlock('toolbar', $view->conf['toolbar']); // <head>タグ内 $view->head = self::getHead($view->conf); // ナビゲーション $view->navigation = Factory::Wiki($navigation)->has() ? PluginRenderer::executePluginBlock('suckerfish') : null; // ヘッドエリア $view->headarea = Factory::Wiki($headarea)->has() ? PluginRenderer::executePluginInline('headarea') : null; // フッターエリア $view->footarea = Factory::Wiki($footarea)->has() ? PluginRenderer::executePluginInline('footarea') : null; // パンくずリスト $view->topicpath = $this->getBreadcrumbs(); // 中身 $view->body = $body; // サイト名 $view->site_name = $site_name; // ページ名 $view->page = $this->page; // タイトル $view->title = !empty($newtitle) ? $newtitle : $this->title; // 管理人の名前 $view->modifier = $modifier; // 管理人のリンク $view->modifierlink = $modifierlink; // JavaScript $view->js = $this->getJs(); // 汎用ワード $view->strings = $_LANG; // 表示言語 $view->lang = substr(LANG, 0, 2); // テーマディレクトリへの相対パス $view->path = SKIN_DIR . THEME_PLUS_NAME . (!IS_MOBILE ? PLUS_THEME : 'mobile') . '/'; // リンク $view->links = $_LINK; // 処理にかかった所要時間 $view->proc_time = $this->getProcessTime(); // メモリ使用量 $view->memory = $this->getMemoryUsage(); // このへんにViewオブジェクトのキャッシュ処理を入れれば大幅に速くなるが・・・。 return $view->__toString(); }
/** * インライン型プラグインを実行 * @param string $name プラグイン名 * @param string $args プラグインに渡す引数 * @return string */ public function pluginInline($name, $args = '') { return PluginRenderer::executePluginInline($name, $args); }
function plugin_login_inline() { if (PKWK_READONLY != Auth::ROLE_AUTH) { return ''; } $auth_key = Auth::get_user_info(); // Offline if (empty($auth_key['key'])) { return plugin_login_auth_guide(); } // Online return PluginRenderer::hasPlugin($auth_key['api']) ? PluginRenderer::executePluginInline($auth_key['api']) : ''; }
$info[] = sprintf(T_('Facebook is authenticated. Welcome, %s.'), '<var>'.$me['username'].'</var>'); } catch (FacebookApiException $e) { $info[] = 'Facebook Error: <samp>'.$e.'</samp>'; } } $js_init['FACEBOOK_APPID'] = $fb->getAppId(); }else{ $info[] = T_('Could not to load Facebook. This function needs <code>curl</code> extention.'); } } */ ///////////////////////////////////////////////// // Execute Plugin. // auth remoteip if (isset($auth_api['remoteip']['use']) && $auth_api['remoteip']['use']) { PluginRenderer::executePluginInline('remoteip'); } // プラグインのaction命令を実行 $cmd = strtolower($vars['cmd']); $is_protect = Auth::is_protect(); if ($is_protect) { $plugin_arg = ''; if (Auth::is_protect_plugin_action($cmd)) { PluginRenderer::executePluginAction($cmd); // Location で飛ばないプラグインの場合 $plugin_arg = $cmd; } PluginRenderer::executePluginBlock('protect', $plugin_arg); } if (!empty($cmd)) { if (!PluginRenderer::hasPluginMethod($cmd, 'action')) {