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

PHP prettyprint_id函数代码示例

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

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



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

示例1: tpl_subscribe

/**
 * Display the subscribe form
 *
 * @author Adrian Lang <[email protected]>
 */
function tpl_subscribe()
{
    global $INFO;
    global $ID;
    global $lang;
    global $conf;
    $stime_days = $conf['subscribe_time'] / 60 / 60 / 24;
    echo p_locale_xhtml('subscr_form');
    echo '<h2>' . $lang['subscr_m_current_header'] . '</h2>';
    echo '<div class="level2">';
    if ($INFO['subscribed'] === false) {
        echo '<p>' . $lang['subscr_m_not_subscribed'] . '</p>';
    } else {
        echo '<ul>';
        foreach ($INFO['subscribed'] as $sub) {
            echo '<li><div class="li">';
            if ($sub['target'] !== $ID) {
                echo '<code class="ns">' . hsc(prettyprint_id($sub['target'])) . '</code>';
            } else {
                echo '<code class="page">' . hsc(prettyprint_id($sub['target'])) . '</code>';
            }
            $sstl = sprintf($lang['subscr_style_' . $sub['style']], $stime_days);
            if (!$sstl) {
                $sstl = hsc($sub['style']);
            }
            echo ' (' . $sstl . ') ';
            echo '<a href="' . wl($ID, array('do' => 'subscribe', 'sub_target' => $sub['target'], 'sub_style' => $sub['style'], 'sub_action' => 'unsubscribe', 'sectok' => getSecurityToken())) . '" class="unsubscribe">' . $lang['subscr_m_unsubscribe'] . '</a></div></li>';
        }
        echo '</ul>';
    }
    echo '</div>';
    // Add new subscription form
    echo '<h2>' . $lang['subscr_m_new_header'] . '</h2>';
    echo '<div class="level2">';
    $ns = getNS($ID) . ':';
    $targets = array($ID => '<code class="page">' . prettyprint_id($ID) . '</code>', $ns => '<code class="ns">' . prettyprint_id($ns) . '</code>');
    $styles = array('every' => $lang['subscr_style_every'], 'digest' => sprintf($lang['subscr_style_digest'], $stime_days), 'list' => sprintf($lang['subscr_style_list'], $stime_days));
    $form = new Doku_Form(array('id' => 'subscribe__form'));
    $form->startFieldset($lang['subscr_m_subscribe']);
    $form->addRadioSet('sub_target', $targets);
    $form->startFieldset($lang['subscr_m_receive']);
    $form->addRadioSet('sub_style', $styles);
    $form->addHidden('sub_action', 'subscribe');
    $form->addHidden('do', 'subscribe');
    $form->addHidden('id', $ID);
    $form->endFieldset();
    $form->addElement(form_makeButton('submit', 'subscribe', $lang['subscr_m_subscribe']));
    html_form('SUBSCRIBE', $form);
    echo '</div>';
}
开发者ID:neosunchess,项目名称:dokuwiki,代码行数:55,代码来源:template.php


示例2: send_list

 /**
  * Send a list mail
  *
  * Sends a list mail showing a list of changed pages.
  *
  * @author Adrian Lang <[email protected]>
  *
  * @param string $subscriber_mail The target mail address
  * @param array  $ids             Array of ids
  * @param string $ns_id           The id of the namespace
  * @return bool true if a mail was sent
  */
 protected function send_list($subscriber_mail, $ids, $ns_id)
 {
     if (count($ids) === 0) {
         return false;
     }
     $tlist = '';
     $hlist = '<ul>';
     foreach ($ids as $id) {
         $link = wl($id, array(), true);
         $tlist .= '* ' . $link . NL;
         $hlist .= '<li><a href="' . $link . '">' . hsc($id) . '</a></li>' . NL;
     }
     $hlist .= '</ul>';
     $id = prettyprint_id($ns_id);
     $trep = array('DIFF' => rtrim($tlist), 'PAGE' => $id, 'SUBSCRIBE' => wl($id, array('do' => 'subscribe'), true, '&'));
     $hrep = array('DIFF' => $hlist);
     return $this->send($subscriber_mail, 'subscribe_list', $ns_id, 'subscr_list', $trep, $hrep);
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:subscription.php


示例3: subscription_handle_post

/**
 * Validate POST data
 *
 * Validates POST data for a subscribe or unsubscribe request. This is the
 * default action for the event ACTION_HANDLE_SUBSCRIBE.
 *
 * @author Adrian Lang <[email protected]>
 */
function subscription_handle_post(&$params)
{
    global $INFO;
    global $lang;
    // Get and validate parameters.
    if (!isset($params['target'])) {
        throw new Exception('no subscription target given');
    }
    $target = $params['target'];
    $valid_styles = array('every', 'digest');
    if (substr($target, -1, 1) === ':') {
        // Allow “list” subscribe style since the target is a namespace.
        $valid_styles[] = 'list';
    }
    $style = valid_input_set('style', $valid_styles, $params, 'invalid subscription style given');
    $action = valid_input_set('action', array('subscribe', 'unsubscribe'), $params, 'invalid subscription action given');
    // Check other conditions.
    if ($action === 'subscribe') {
        if ($INFO['userinfo']['mail'] === '') {
            throw new Exception($lang['subscr_subscribe_noaddress']);
        }
    } elseif ($action === 'unsubscribe') {
        $is = false;
        foreach ($INFO['subscribed'] as $subscr) {
            if ($subscr['target'] === $target) {
                $is = true;
            }
        }
        if ($is === false) {
            throw new Exception(sprintf($lang['subscr_not_subscribed'], $_SERVER['REMOTE_USER'], prettyprint_id($target)));
        }
        // subscription_set deletes a subscription if style = null.
        $style = null;
    }
    $data = in_array($style, array('list', 'digest')) ? time() : null;
    $params = compact('target', 'style', 'data', 'action');
}
开发者ID:JeromeS,项目名称:dokuwiki,代码行数:45,代码来源:actions.php


示例4: subscription_send_list

/**
 * Send a list mail
 *
 * Sends a list mail showing a list of changed pages.
 *
 * @param string $subscriber_mail The target mail address
 * @param array  $ids             Array of ids
 * @param string $ns_id           The id of the namespace
 *
 * @author Adrian Lang <[email protected]>
 */
function subscription_send_list($subscriber_mail, $ids, $ns_id)
{
    if (count($ids) === 0) {
        return;
    }
    global $conf;
    $list = '';
    foreach ($ids as $id) {
        $list .= '* ' . wl($id, array(), true) . NL;
    }
    subscription_send($subscriber_mail, array('DIFF' => rtrim($list), 'SUBSCRIBE' => wl($ns_id . $conf['start'], array('do' => 'subscribe'), true, '&')), 'subscribe_list', prettyprint_id($ns_id), 'subscr_list');
}
开发者ID:nextghost,项目名称:dokuwiki,代码行数:23,代码来源:subscription.php


示例5: subscription_send_list

/**
 * Send a list mail
 *
 * Sends a list mail showing a list of changed pages.
 *
 * @param string $subscriber_mail The target mail address
 * @param array  $changes         Array of changes
 * @param string $id              The id of the namespace
 *
 * @author Adrian Lang <[email protected]>
 */
function subscription_send_list($subscriber_mail, $changes, $id)
{
    global $conf;
    $list = '';
    foreach ($changes as $change) {
        $list .= '* ' . wl($change['id'], array(), true) . NL;
    }
    subscription_send($subscriber_mail, array('DIFF' => rtrim($list), 'SUBSCRIBE' => wl($id . $conf['start'], array('do' => 'subscribe'), true, '&')), 'subscribe_list', prettyprint_id($id), 'subscr_list');
}
开发者ID:JeromeS,项目名称:dokuwiki,代码行数:20,代码来源:subscription.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP prev函数代码示例发布时间:2022-05-15
下一篇:
PHP pretty_time函数代码示例发布时间: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