• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP plugin_load函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中plugin_load函数的典型用法代码示例。如果您正苦于以下问题:PHP plugin_load函数的具体用法?PHP plugin_load怎么用?PHP plugin_load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了plugin_load函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: numberingProcessNum

function numberingProcessNum()
{
    $db = numberingDB();
    $helper = plugin_load('helper', 'numbering');
    $start = urldecode($helper->getConfValue('nstart'));
    $number = getNumberingNextNumber($db, $start);
    $padding = urldecode($helper->getConfValue('padding'));
    $len = (int) urldecode($helper->getConfValue('pad_length'));
    $set_date = $helper->getConfValue('set_date');
    $format = urldecode($helper->getConfValue('format'));
    if ($helper->getConfValue('use_imgs')) {
        $imagestr = urldecode($helper->getConfValue('imgs'));
        $images = explode(',', $imagestr);
        $i_no = 0;
        foreach ($images as $img) {
            $nxt = '%i' . ++$i_no;
            $format = str_replace($nxt, '{{' . $img . '}}', $format);
        }
    }
    if ($set_date) {
        $dformat = urldecode($helper->getConfValue('datestyle'));
        $time = strftime($dformat);
        $format = str_replace('%d', $time, $format);
    }
    $n = str_pad((string) $number, (int) $len, $padding, STR_PAD_LEFT);
    $format = str_replace('%n', $n, $format);
    echo "{$format}\n\n";
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:28,代码来源:getnum.php


示例2: handle

 /**
  * handle user request
  */
 function handle()
 {
     if (!isset($_REQUEST['cmd'])) {
         return;
         // first time - nothing to do
     }
     if (!checkSecurityToken()) {
         return;
     }
     if (!is_array($_REQUEST['cmd'])) {
         return;
     }
     $crud = plugin_load('helper', 'judge_crud', true);
     // verify valid values
     switch (key($_REQUEST['cmd'])) {
         case 'get':
             $this->output = '<div class="table sectionedit1">
                                 <table class="inline">';
             $table = $crud->tableRender(array('problem_name' => $_REQUEST['problem_name'], 'type' => $_REQUEST['type'], 'user' => $_REQUEST['user']), "html", 1, "timestamp");
             if ($table["count"] == 0) {
                 $this->output .= '<p>' . $this->getLang("empty_result") . '</p>';
                 break;
             } else {
                 $this->output .= $table["submissions_table"];
             }
             $this->output .= "</table></div>";
             break;
         case 'delete':
             $this->output = $crud->delSubmissions(array('problem_name' => $_REQUEST['problem_name'], 'type' => $_REQUEST['type'], 'user' => $_REQUEST['user']));
             break;
     }
 }
开发者ID:smmsadrnezh,项目名称:dokuwiki-plugin-judge,代码行数:35,代码来源:admin.php


示例3: handle_schema

 /**
  * Load a whole schema as fields
  *
  * @param Doku_Event $event event object by reference
  * @param mixed $param [the parameters passed as fifth argument to register_hook() when this
  *                           handler was registered]
  * @return bool
  */
 public function handle_schema(Doku_Event $event, $param)
 {
     $args = $event->data['args'];
     if ($args[0] != 'struct_schema') {
         return false;
     }
     $event->preventDefault();
     $event->stopPropagation();
     /** @var helper_plugin_bureaucracy_field $helper */
     $helper = plugin_load('helper', 'bureaucracy_field');
     $helper->initialize($args);
     $schema = new Schema($helper->opt['label']);
     if (!$schema->getId()) {
         msg('This schema does not exist', -1);
         return false;
     }
     foreach ($schema->getColumns(false) as $column) {
         /** @var helper_plugin_struct_field $field */
         $field = plugin_load('helper', 'struct_field');
         // we don't initialize the field but set the appropriate values
         $field->opt = $helper->opt;
         // copy all the settings to each field
         $field->opt['label'] = $column->getFullQualifiedLabel();
         $field->column = $column;
         $event->data['fields'][] = $field;
     }
     return true;
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:36,代码来源:bureaucracy.php


示例4: handle_ajax

 /**
  * Rename a single page
  */
 public function handle_ajax(Doku_Event $event)
 {
     if ($event->data != 'plugin_move_rename') {
         return;
     }
     $event->preventDefault();
     $event->stopPropagation();
     global $MSG;
     global $INPUT;
     $src = cleanID($INPUT->str('id'));
     $dst = cleanID($INPUT->str('newid'));
     /** @var helper_plugin_move_op $MoveOperator */
     $MoveOperator = plugin_load('helper', 'move_op');
     $JSON = new JSON();
     header('Content-Type: application/json');
     if ($this->renameOkay($src) && $MoveOperator->movePage($src, $dst)) {
         // all went well, redirect
         echo $JSON->encode(array('redirect_url' => wl($dst, '', true, '&')));
     } else {
         if (isset($MSG[0])) {
             $error = $MSG[0];
             // first error
         } else {
             $error = $this->getLang('cantrename');
         }
         echo $JSON->encode(array('error' => $error));
     }
 }
开发者ID:kochichi,项目名称:dokuwiki-plugin-move,代码行数:31,代码来源:rename.php


示例5: handle

 function handle()
 {
     global $lang;
     $cid = $_REQUEST['cid'];
     if (is_array($cid)) {
         $cid = array_keys($cid);
     }
     $action =& plugin_load('action', 'discussion');
     if (!$action) {
         return;
     }
     // couldn't load action plugin component
     switch ($_REQUEST['comment']) {
         case $lang['btn_delete']:
             $action->_save($cid, '');
             break;
         case $this->getLang('btn_show'):
             $action->_save($cid, '', 'show');
             break;
         case $this->getLang('btn_hide'):
             $action->_save($cid, '', 'hide');
             break;
         case $this->getLang('btn_change'):
             $this->_changeStatus($_REQUEST['status']);
             break;
     }
 }
开发者ID:NikolausL,项目名称:plugin-discussion,代码行数:27,代码来源:admin.php


示例6: handle

 function handle($match, $state, $pos, Doku_Handler $handler)
 {
     global $DOKU_PLUGINS;
     preg_match('/^\\n[ \\t]*>(?:[ \\t>]*>)?[ \\t]?/', $match, $quotearg);
     $quoteinarg = preg_replace('/^\\n[ \\t]*>(?:[ \\t>]*>)?[ \\t]?/', '', $match);
     if ($state == DOKU_LEXER_ENTER) {
         $ReWriter = new Doku_Handler_Markdown_Quote($handler->CallWriter);
         $handler->CallWriter =& $ReWriter;
         $handler->_addCall('quote_start', $quotearg, $pos);
     } elseif ($state == DOKU_LEXER_EXIT) {
         $handler->_addCall('quote_end', array(), $pos);
         $handler->CallWriter->process();
         $ReWriter =& $handler->CallWriter;
         $handler->CallWriter =& $ReWriter->CallWriter;
     }
     if ($quoteinarg == '') {
         $handler->_addCall('quote_newline', $quotearg, $pos);
         /* ATX headers (headeratx) */
     } elseif (preg_match('/^\\#{1,6}[ \\t]*.+?[ \\t]*\\#*/', $quoteinarg)) {
         $plugin =& plugin_load('syntax', 'markdowku_headeratx');
         $plugin->handle($quoteinarg, $state, $pos, $handler);
         /* Horizontal rulers (hr) */
     } elseif (preg_match('/[ ]{0,2}(?:[ ]?_[ ]?){3,}[ \\t]*/', $quoteinarg) or preg_match('/[ ]{0,2}(?:[ ]?-[ ]?){3,}[ \\t]*/', $quoteinarg) or preg_match('/[ ]{0,2}(?:[ ]?\\*[ ]?){3,}[ \\t]*/', $quoteinarg)) {
         $plugin =& plugin_load('syntax', 'markdowku_hr');
         $plugin->handle($quoteinarg, $state, $pos, $handler);
         /* Setext headers (headersetext) */
     } elseif (preg_match('/^[^\\n]+?[ \\t]*\\n[ \\t]*>(?:[ \\t>]*>)?[ \\t]?=+[ \\t]*/', $quoteinarg) or preg_match('/^[^\\n]+?[ \\t]*\\n[ \\t]*>(?:[ \\t>]*>)?[ \\t]?-+[ \\t]*/', $quoteinarg)) {
         $quoteinarg = preg_replace('/(?<=\\n)[ \\t]*>(?:[ \\t>]*>)?[ \\t]?/', '', $quoteinarg);
         $plugin =& plugin_load('syntax', 'markdowku_headersetext');
         $plugin->handle($quoteinarg, $state, $pos, $handler);
     } else {
         $handler->_addCall('cdata', array($quoteinarg), $pos);
     }
     return true;
 }
开发者ID:arapat,项目名称:markdowku,代码行数:35,代码来源:blockquotes.php


示例7: handle

 function handle()
 {
     global $lang;
     $lid = $_REQUEST['lid'];
     if (is_array($lid)) {
         $lid = array_keys($lid);
     }
     $action =& plugin_load('action', 'linkback_display');
     if (!$action) {
         return;
     }
     // couldn't load action plugin component
     switch ($_REQUEST['linkback']) {
         case $lang['btn_delete']:
             $action->_deleteLinkbacks($lid);
             break;
         case $this->getLang('btn_show'):
             $action->_changeLinkbackVisibilities($lid, true);
             break;
         case $this->getLang('btn_hide'):
             $action->_changeLinkbackVisibilities($lid, false);
             break;
         case $this->getLang('btn_ham'):
             $action->_markLinkbacks($lid, false);
             break;
         case $this->getLang('btn_spam'):
             $action->_markLinkbacks($lid, true);
             break;
         case $this->getLang('btn_change'):
             $this->_changeStatus($_REQUEST['status']);
             break;
     }
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:33,代码来源:admin.php


示例8: handle_editform_output

 /**
  * Create the additional fields for the edit form
  */
 function handle_editform_output(&$event, $param)
 {
     // check if source view -> no captcha needed
     if (!$param['oldhook']) {
         // get position of submit button
         $pos = $event->data->findElementByAttribute('type', 'submit');
         if (!$pos) {
             return;
         }
         // no button -> source view mode
     } elseif ($param['editform'] && !$event->data['writable']) {
         if ($param['editform'] && !$event->data['writable']) {
             return;
         }
     }
     // do nothing if logged in user and no CAPTCHA required
     if (!$this->getConf('forusers') && $_SERVER['REMOTE_USER']) {
         return;
     }
     // get the CAPTCHA
     $helper = plugin_load('helper', 'captcha');
     $out = $helper->getHTML();
     if ($param['oldhook']) {
         // old wiki - just print
         echo $out;
     } else {
         // new wiki - insert at correct position
         $event->data->insertElement($pos++, $out);
     }
 }
开发者ID:neutrinog,项目名称:Door43,代码行数:33,代码来源:action.php


示例9: setUp

 public function setUp()
 {
     parent::setUp();
     /** @var \helper_plugin_struct_db $sqlite */
     $sqlite = plugin_load('helper', 'struct_db');
     $this->sqlite = $sqlite->getDB();
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:7,代码来源:SchemaBuilder.test.php


示例10: addApproval

 function addApproval()
 {
     global $USERINFO;
     global $ID;
     global $INFO;
     if (!$INFO['exists']) {
         msg($this->getLang('cannot approve a non-existing revision'), -1);
         return;
     }
     $approvalRevision = $this->helper->getRevision();
     $approvals = $this->helper->getApprovals();
     if (!isset($approvals[$approvalRevision])) {
         $approvals[$approvalRevision] = array();
     }
     $approvals[$approvalRevision][$INFO['client']] = array($INFO['client'], $_SERVER['REMOTE_USER'], $USERINFO['mail'], time());
     $success = p_set_metadata($ID, array('approval' => $approvals), true, true);
     if ($success) {
         msg($this->getLang('version approved'), 1);
         $data = array();
         $data['rev'] = $approvalRevision;
         $data['id'] = $ID;
         $data['approver'] = $_SERVER['REMOTE_USER'];
         $data['approver_info'] = $USERINFO;
         if ($this->getConf('send_mail_on_approve') && $this->helper->isRevisionApproved($approvalRevision)) {
             /** @var action_plugin_publish_mail $mail */
             $mail = plugin_load('action', 'publish_mail');
             $mail->send_approve_mail();
         }
         trigger_event('PLUGIN_PUBLISH_APPROVE', $data);
     } else {
         msg($this->getLang('cannot approve error'), -1);
     }
     send_redirect(wl($ID, array('rev' => $this->helper->getRevision()), true, '&'));
 }
开发者ID:hefanbo,项目名称:dokuwiki-plugin-publish,代码行数:34,代码来源:approve.php


示例11: handle_ajax

 /**
  * Step up
  *
  * @param Doku_Event $event
  */
 public function handle_ajax(Doku_Event $event)
 {
     if ($event->data != 'plugin_move_progress') {
         return;
     }
     $event->preventDefault();
     $event->stopPropagation();
     global $INPUT;
     global $USERINFO;
     if (!auth_ismanager($_SERVER['REMOTE_USER'], $USERINFO['grps'])) {
         http_status(403);
         exit;
     }
     $return = array('error' => '', 'complete' => false, 'progress' => 0);
     /** @var helper_plugin_move_plan $plan */
     $plan = plugin_load('helper', 'move_plan');
     if (!$plan->isCommited()) {
         // There is no plan. Something went wrong
         $return['complete'] = true;
     } else {
         $todo = $plan->nextStep($INPUT->bool('skip'));
         $return['progress'] = $plan->getProgress();
         $return['error'] = $plan->getLastError();
         if ($todo === 0) {
             $return['complete'] = true;
         }
     }
     $json = new JSON();
     header('Content-Type: application/json');
     echo $json->encode($return);
 }
开发者ID:kochichi,项目名称:dokuwiki-plugin-move,代码行数:36,代码来源:progress.php


示例12: ajax_siteexport_cron_provider

 /**
  * AJAX Provider - check what is going to be done
  * @param $event
  * @param $args
  */
 public function ajax_siteexport_cron_provider(&$event, $args)
 {
     // If this is not a siteexport call - and cron call, ignore it.
     if (!(strstr($event->data, '__siteexport') && strstr($event->data, 'cron'))) {
         return;
     }
     $this->__init_functions();
     $cronOverwriteExisting = intval($_REQUEST['cronOverwriteExisting']) == 1;
     list($url, $combined) = $this->ajax_siteexport_prepareURL_and_POSTData($event);
     if (!($function =& plugin_load('cron', 'siteexport'))) {
         $this->functions->debug->message("Could not load Cron base", null, 4);
         return;
     }
     $this->functions->debug->message("Will write parameters to Cron:", $combined, 1);
     $status = null;
     switch ($event->data) {
         case '__siteexport_savecron':
             $status = $function->saveCronDataWithParameters($combined, $cronOverwriteExisting);
             break;
         case '__siteexport_deletecron':
             $status = $function->deleteCronDataWithParameters($combined);
             break;
         case '__siteexport_showcron':
             $status = $this->printCronDataList($function->configuration);
             break;
         default:
             $this->functions->debug->message("Uhoh. You did not say the magic word.", null, 4);
     }
     if (!empty($status)) {
         $this->functions->debug->message("Tried to do an action with siteexport/cron, but failed.", "Tried to do an action with siteexport/cron, but failed. ({$status})" . 4);
     }
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:37,代码来源:cron.php


示例13: init

 /**
  * Initialize the database
  *
  * @throws Exception
  */
 protected function init()
 {
     /** @var helper_plugin_sqlite $sqlite */
     $this->sqlite = plugin_load('helper', 'sqlite');
     if (!$this->sqlite) {
         if (defined('DOKU_UNITTEST')) {
             throw new \Exception('Couldn\'t load sqlite.');
         }
         msg('The struct plugin requires the sqlite plugin. Please install it', -1);
         return;
     }
     if ($this->sqlite->getAdapter()->getName() != DOKU_EXT_PDO) {
         if (defined('DOKU_UNITTEST')) {
             throw new \Exception('Couldn\'t load PDO sqlite.');
         }
         msg('The struct plugin requires sqlite3 you\'re still using sqlite2', -1);
         $this->sqlite = null;
         return;
     }
     $this->sqlite->getAdapter()->setUseNativeAlter(true);
     // initialize the database connection
     if (!$this->sqlite->init('struct', DOKU_PLUGIN . 'struct/db/')) {
         if (defined('DOKU_UNITTEST')) {
             throw new \Exception('Couldn\'t init sqlite.');
         }
         return;
     }
     // register our JSON function with variable parameters
     // todo this might be useful to be moved into the sqlite plugin
     $this->sqlite->create_function('STRUCT_JSON', array($this, 'STRUCT_JSON'), -1);
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:36,代码来源:db.php


示例14: admin_plugin_blogtng

 function admin_plugin_blogtng()
 {
     $this->commenthelper =& plugin_load('helper', 'blogtng_comments');
     $this->entryhelper =& plugin_load('helper', 'blogtng_entry');
     $this->sqlitehelper =& plugin_load('helper', 'blogtng_sqlite');
     $this->taghelper =& plugin_load('helper', 'blogtng_tags');
 }
开发者ID:speed47,项目名称:plugin-blogtng,代码行数:7,代码来源:admin.php


示例15: render

 function render($mode, &$renderer, $indata)
 {
     if ($mode == 'xhtml') {
         list($state, $data) = $indata;
         switch ($state) {
             case DOKU_LEXER_ENTER:
                 $pluginClass = $this->getConf('addStyling') ? 'blockquote-plugin' : '';
                 $attr = '';
                 if ($data && strlen($data) > 0 && !plugin_isdisabled('wrap')) {
                     // get attributes from wrap helper plugin (if installed)
                     $wrap =& plugin_load('helper', 'wrap');
                     $attr = $wrap->buildAttributes($data, $pluginClass);
                 } else {
                     if ($pluginClass) {
                         $attr = 'class="' . $pluginClass . '"';
                     }
                 }
                 $renderer->doc .= '<cite ' . $attr . '>';
                 break;
             case DOKU_LEXER_UNMATCHED:
                 $renderer->doc .= $renderer->_xmlEntities($data);
                 break;
             case DOKU_LEXER_EXIT:
                 $renderer->doc .= "</cite>";
                 break;
         }
         return true;
     }
     // unsupported $mode
     return false;
 }
开发者ID:neutrinog,项目名称:Door43,代码行数:31,代码来源:cite.php


示例16: handle_start

 /**
  * handle event
  */
 function handle_start(&$event, $param)
 {
     global $ID;
     global $ACT;
     if ($ACT != 'show') {
         return;
     }
     $redirects = confToHash($this->getsavedir() . '/shorturl.conf');
     if ($redirects[$ID]) {
         if (preg_match('/^https?:\\/\\//', $redirects[$ID])) {
             send_redirect($redirects[$ID]);
         } else {
             if ($this->getConf('showmsg')) {
                 msg(sprintf($this->getLang('redirected'), hsc($ID)));
             }
             send_redirect(wl($redirects[$ID], '', true));
         }
         exit;
     } else {
         if ($_GET['generateShortURL'] != "" && auth_quickaclcheck($ID) >= AUTH_READ) {
             $shorturl =& plugin_load('helper', 'shorturl');
             if ($shorturl) {
                 $shortID = $shorturl->autoGenerateShortUrl($ID);
             }
         }
     }
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:action.php


示例17: render

 /**
  * Create output
  */
 function render($format, &$renderer, $data)
 {
     global $INFO, $conf;
     $helper = plugin_load('helper', 'orphanswanted');
     if ($format == 'xhtml') {
         // prevent caching to ensure content is always fresh
         $renderer->info['cache'] = false;
         // $data is an array
         // $data[1]..[x] are excluded namespaces, $data[0] is the report type
         //handle choices
         switch ($data[0]) {
             case 'orphans':
                 $renderer->doc .= $helper->orphan_pages($data);
                 break;
             case 'wanted':
                 $renderer->doc .= $helper->wanted_pages($data);
                 break;
             case 'valid':
                 $renderer->doc .= $helper->valid_pages($data);
                 break;
             case 'all':
                 $renderer->doc .= $helper->all_pages($data);
                 break;
             default:
                 $renderer->doc .= "ORPHANSWANTED syntax error";
                 // $renderer->doc .= "syntax ~~ORPHANSWANTED:<choice>~~<optional_excluded>  <choice> :: orphans|wanted|valid|all  Ex: ~~ORPHANSWANTED:valid~~";
         }
         return true;
     }
     return false;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:34,代码来源:syntax.php


示例18: tearDown

 /**
  * Default teardown
  *
  * we always make sure the database is clear
  */
 protected function tearDown()
 {
     parent::tearDown();
     /** @var \helper_plugin_struct_db $db */
     $db = plugin_load('helper', 'struct_db');
     $db->resetDB();
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:12,代码来源:StructTest.php


示例19: plugin

 /**
  * handle plugin rendering
  *
  * @param string $name Plugin name
  * @param mixed  $data custom data set by handler
  * @param string $state matched state if any
  * @param string $match raw matched syntax
  */
 function plugin($name, $data, $state = '', $match = '')
 {
     $plugin = plugin_load('syntax', $name);
     if ($plugin != null) {
         $plugin->render($this->getFormat(), $this, $data);
     }
 }
开发者ID:rsnitsch,项目名称:dokuwiki,代码行数:15,代码来源:renderer.php


示例20: render

 /**
  * Create output
  */
 function render($mode, &$renderer, $data)
 {
     list($flags, $pages) = $data;
     // for XHTML output
     if ($mode == 'xhtml') {
         if (!($my =& plugin_load('helper', 'pagelist'))) {
             return false;
         }
         $my->setFlags($flags);
         $my->startList();
         if ($my->sort) {
             // pages should be sorted by pagename
             $keys = array();
             $fnc = create_function('$a, $b', 'return strcmp(noNS($a["id"]), noNS($b["id"])); ');
             usort($pages, $fnc);
         }
         foreach ($pages as $page) {
             $my->addPage($page);
         }
         $renderer->doc .= $my->finishList();
         return true;
         // for metadata renderer
     } elseif ($mode == 'metadata') {
         foreach ($pages as $page) {
             $renderer->meta['relation']['references'][$page['id']] = $page['exists'];
         }
         return true;
     }
     return false;
 }
开发者ID:kosenconf,项目名称:kcweb,代码行数:33,代码来源:syntax.php



注:本文中的plugin_load函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP plugin_manager函数代码示例发布时间:2022-05-15
下一篇:
PHP plugin_list函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap