当前位置: 首页>>代码示例>>PHP>>正文


PHP callback_event函数代码示例

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


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

示例1: end_page

function end_page()
{
    global $txp_user, $event, $app_mode, $theme;
    if ($app_mode != 'async' && $event != 'tag') {
        echo $theme->footer();
        callback_event('admin_side', 'body_end');
        echo n . '</body>' . n . '</html>';
    }
}
开发者ID:joebushi,项目名称:textpattern,代码行数:9,代码来源:txplib_html.php

示例2: end_page

/**
 * Render the admin-side theme's footer partial via the "admin_side" > "footer" pluggable UI.
 * and send the "admin_side" > "body_end" event.
 */
function end_page()
{
    global $txp_user, $event, $app_mode, $theme, $textarray_script;
    if ($app_mode != 'async' && $event != 'tag') {
        echo '</div><!-- /txp-body --><div class="txp-footer">';
        echo pluggable_ui('admin_side', 'footer', $theme->footer());
        callback_event('admin_side', 'body_end');
        echo n . script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</div><!-- /txp-footer --></body>' . n . '</html>';
    }
}
开发者ID:balcides,项目名称:Cathartic_server,代码行数:14,代码来源:txplib_html.php

示例3: end_page

/**
 * Renders the admin-side footer.
 *
 * The footer's default markup is provided by a theme. It can
 * be further customized via the "admin_side > footer" pluggable
 * UI callback event.
 *
 * In addition to the pluggable UI, this function also calls callback
 * events "admin_side > main_content_end" and "admin_side > body_end".
 */
function end_page()
{
    global $event, $app_mode, $theme, $textarray_script;
    if ($app_mode != 'async' && $event != 'tag') {
        callback_event('admin_side', 'main_content_end');
        echo n . '</main><!-- /txp-body -->' . n . '<footer role="contentinfo" class="txp-footer">';
        echo pluggable_ui('admin_side', 'footer', $theme->footer());
        callback_event('admin_side', 'body_end');
        echo script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</footer><!-- /txp-footer -->' . n . '</body>' . n . '</html>';
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:21,代码来源:txplib_html.php

示例4: end_page

function end_page()
{
    global $txp_user, $event;
    if ($event != 'tag') {
        echo '<div id="end_page">', navPop() . n, '<a href="http://www.textpattern.com"><img src="txp_img/carver.gif" width="60" height="48" border="0" alt="" /></a>' . n;
        echo graf('Textpattern &#183; ' . txp_version) . n;
        echo $txp_user ? graf(gTxt('logged_in_as') . ' ' . span(htmlspecialchars($txp_user)) . br . '<a href="index.php?logout=1">' . gTxt('logout') . '</a>', ' id="moniker"') . n . '</div>' : '</div>';
        callback_event('admin_side', 'body_end');
        echo n . '</body>' . n . '</html>';
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:11,代码来源:txplib_html.php

示例5: log_hit

function log_hit($status)
{
    global $nolog, $logging;
    callback_event('log_hit');
    if (!isset($nolog) && $status != '404') {
        if ($logging == 'refer') {
            logit('refer', $status);
        } elseif ($logging == 'all') {
            logit('', $status);
        }
    }
}
开发者ID:joebushi,项目名称:textpattern,代码行数:12,代码来源:log.php

示例6: end_page

/**
 * Renders the admin-side footer.
 *
 * The footer's default markup is provided by a theme. It can be further
 * customised via the "admin_side > footer" pluggable UI callback event.
 *
 * In addition to the pluggable UI, this function also calls callback events
 * "admin_side > main_content_end" and "admin_side > body_end".
 */
function end_page()
{
    global $event, $app_mode, $theme, $textarray_script;
    if ($app_mode != 'async' && $event != 'tag') {
        callback_event('admin_side', 'main_content_end');
        echo n . '</main><!-- /txp-body -->' . n . '<footer class="txp-footer">';
        echo pluggable_ui('admin_side', 'footer', $theme->footer());
        callback_event('admin_side', 'body_end');
        gTxtScript(array('password_strength_0', 'password_strength_1', 'password_strength_2', 'password_strength_3', 'password_strength_4'), array(), array('admin', 'new_pass_form'));
        echo script_js('vendors/dropbox/zxcvbn/zxcvbn.js', TEXTPATTERN_SCRIPT_URL, array('admin', 'new_pass_form')) . script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</footer><!-- /txp-footer -->' . n . '</body>' . n . '</html>';
    }
}
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:21,代码来源:txplib_html.php

示例7: page_list

function page_list($current)
{
    $protected = safe_column('DISTINCT page', 'txp_section', '1=1') + array('error_default');
    $criteria = 1;
    $criteria .= callback_event('admin_criteria', 'page_list', 0, $criteria);
    $rs = safe_rows_start('name', 'txp_page', "{$criteria} order by name asc");
    while ($a = nextRow($rs)) {
        extract($a);
        $link = eLink('page', '', 'name', $name, $name);
        $dlink = !in_array($name, $protected) ? dLink('page', 'page_delete', 'name', $name) : '';
        $out[] = $current == $name ? tr(td($name) . td($dlink)) : tr(td($link) . td($dlink));
    }
    return startTable('', '', 'txp-list') . join(n, $out) . endTable();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:14,代码来源:txp_page.php

示例8: __construct

 /**
  * Constructor.
  *
  * Creates core Textfilters according to a preference and registers all
  * available filters with the core.
  *
  * This method triggers 'textfilter.register' callback
  * event.
  */
 public function __construct()
 {
     if ($filters = get_pref('admin_textfilter_classes')) {
         foreach (do_list($filters) as $filter) {
             new $filter();
         }
     } else {
         new Plain();
         new Nl2Br();
         new Textile();
     }
     $this->filters = array();
     callback_event('textfilter', 'register', 0, $this);
 }
开发者ID:scar45,项目名称:textpattern,代码行数:23,代码来源:Registry.php

示例9: css_list

function css_list($current, $default)
{
    $out[] = startTable('', '', 'txp-list');
    $criteria = 1;
    $criteria .= callback_event('admin_criteria', 'css_list', 0, $criteria);
    $rs = safe_rows_start('name', 'txp_css', $criteria);
    if ($rs) {
        while ($a = nextRow($rs)) {
            extract($a);
            $edit = $current != $name ? eLink('css', '', 'name', $name, $name) : txpspecialchars($name);
            $delete = $name != $default ? dLink('css', 'css_delete', 'name', $name) : '';
            $out[] = tr(td($edit) . td($delete));
        }
        $out[] = endTable();
        return join('', $out);
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:17,代码来源:txp_css.php

示例10: form_list

function form_list($curname)
{
    global $step, $essential_forms, $form_types;
    $types = formTypes('', false);
    $methods = array('changetype' => array('label' => gTxt('changetype'), 'html' => $types), 'delete' => gTxt('delete'));
    $out[] = '<p class="action-create">' . sLink('form', 'form_create', gTxt('create_new_form')) . '</p>';
    $criteria = 1;
    $criteria .= callback_event('admin_criteria', 'form_list', 0, $criteria);
    $rs = safe_rows_start("*", "txp_form", "{$criteria} order by field(type,'" . join("','", array_keys($form_types)) . "') asc, name asc");
    if ($rs) {
        $ctr = 1;
        $prev_type = '';
        while ($a = nextRow($rs)) {
            extract($a);
            $editlink = $curname != $name ? eLink('form', 'form_edit', 'name', $name, $name) : txpspecialchars($name);
            $modbox = !in_array($name, $essential_forms) ? '<input type="checkbox" name="selected_forms[]" value="' . $name . '" />' : '';
            if ($prev_type != $type) {
                $visipref = 'pane_form_' . $type . '_visible';
                $group_start = '<div class="form-list-group ' . $type . '"><h3 class="lever' . (get_pref($visipref) ? ' expanded' : '') . '"><a href="#' . $type . '">' . $form_types[$type] . '</a></h3>' . n . '<div id="' . $type . '" class="toggle form-list" style="display:' . (get_pref($visipref) ? 'block' : 'none') . '">' . n . '<ul class="plain-list">' . n;
                $group_end = $ctr > 1 ? '</ul></div></div>' . n : '';
            } else {
                $group_start = $group_end = '';
            }
            $out[] = $group_end . $group_start;
            $out[] = '<li>' . n . '<span class="form-list-action">' . $modbox . '</span><span class="form-list-name">' . $editlink . '</span></li>';
            $prev_type = $type;
            $ctr++;
        }
        $out[] = '</ul></div></div>';
        $out[] = multi_edit($methods, 'form', 'form_multi_edit');
        return form(join('', $out), '', '', 'post', '', '', 'allforms_form') . script_js(<<<EOS
\t\t\t\t\$(document).ready(function() {
\t\t\t\t\t\$('#allforms_form').txpMultiEditForm({
\t\t\t\t\t\t'checkbox' : 'input[name="selected_forms[]"][type=checkbox]',
\t\t\t\t\t\t'row' : '.plain-list li, .form-list-name',
\t\t\t\t\t\t'highlighted' : '.plain-list li'
\t\t\t\t\t});
\t\t\t\t});
EOS
);
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:42,代码来源:txp_form.php

示例11: css

function css($atts)
{
    global $css, $doctype;
    extract(lAtts(array('format' => 'url', 'media' => 'screen', 'n' => $css, 'name' => $css, 'rel' => 'stylesheet', 'title' => ''), $atts));
    if (isset($atts['n'])) {
        $name = $n;
        trigger_error(gTxt('deprecated_attribute', array('{name}' => 'n')), E_USER_NOTICE);
    }
    if (empty($name)) {
        $name = 'default';
    }
    if (has_handler('css.url')) {
        $url = callback_event('css.url', '', false, compact('name'));
    } else {
        $url = hu . 'css.php?n=' . urlencode($name);
    }
    if ($format == 'link') {
        return tag_void('link', array('rel' => $rel, 'type' => $doctype != 'html5' ? 'text/css' : '', 'media' => $media, 'title' => $title, 'href' => $url));
    }
    return txpspecialchars($url);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:21,代码来源:taghandlers.php

示例12: rss

function rss()
{
    global $prefs, $thisarticle;
    set_error_handler('feedErrorHandler');
    ob_clean();
    extract($prefs);
    extract(doSlash(gpsa(array('limit', 'area'))));
    // build filter criteria from a comma-separated list of sections and categories
    $feed_filter_limit = get_pref('feed_filter_limit', 10);
    $section = gps('section');
    $category = gps('category');
    if (!is_scalar($section) || !is_scalar($category)) {
        txp_die('Not Found', 404);
    }
    $section = $section ? array_slice(array_unique(do_list($section)), 0, $feed_filter_limit) : array();
    $category = $category ? array_slice(array_unique(do_list($category)), 0, $feed_filter_limit) : array();
    $st = array();
    foreach ($section as $s) {
        $st[] = fetch_section_title($s);
    }
    $ct = array();
    foreach ($category as $c) {
        $ct[] = fetch_category_title($c);
    }
    $sitename .= $section ? ' - ' . join(' - ', $st) : '';
    $sitename .= $category ? ' - ' . join(' - ', $ct) : '';
    $dn = explode('/', $siteurl);
    $mail_or_domain = $use_mail_on_feeds_id ? eE($blog_mail_uid) : $dn[0];
    // feed header
    $out[] = tag('http://textpattern.com/?v=' . $version, 'generator');
    $out[] = tag(doSpecial($sitename), 'title');
    $out[] = tag(hu, 'link');
    $out[] = '<atom:link href="' . pagelinkurl(array('rss' => 1, 'area' => $area, 'section' => $section, 'category' => $category, 'limit' => $limit)) . '" rel="self" type="application/rss+xml" />';
    $out[] = tag(doSpecial($site_slogan), 'description');
    $last = fetch('unix_timestamp(val)', 'txp_prefs', 'name', 'lastmod');
    $out[] = tag(safe_strftime('rfc822', $last), 'pubDate');
    $out[] = callback_event('rss_head');
    // feed items
    $articles = array();
    $section = doSlash($section);
    $category = doSlash($category);
    if (!$area or $area == 'article') {
        $sfilter = !empty($section) ? "and Section in ('" . join("','", $section) . "')" : '';
        $cfilter = !empty($category) ? "and (Category1 in ('" . join("','", $category) . "') or Category2 in ('" . join("','", $category) . "'))" : '';
        $limit = $limit ? $limit : $rss_how_many;
        $limit = intval(min($limit, max(100, $rss_how_many)));
        $frs = safe_column("name", "txp_section", "in_rss != '1'");
        if ($frs) {
            foreach ($frs as $f) {
                $query[] = "and Section != '" . doSlash($f) . "'";
            }
        }
        $query[] = $sfilter;
        $query[] = $cfilter;
        $expired = $publish_expired_articles ? '' : ' and (now() <= Expires or Expires = ' . NULLDATETIME . ') ';
        $rs = safe_rows_start("*, unix_timestamp(Posted) as uPosted, unix_timestamp(LastMod) as uLastMod, unix_timestamp(Expires) as uExpires, ID as thisid", "textpattern", "Status = 4 " . join(' ', $query) . "and Posted < now()" . $expired . "order by Posted desc limit {$limit}");
        if ($rs) {
            while ($a = nextRow($rs)) {
                extract($a);
                populateArticleData($a);
                $cb = callback_event('rss_entry');
                $a['posted'] = $uPosted;
                $permlink = permlinkurl($a);
                $summary = trim(replace_relative_urls(parse($thisarticle['excerpt']), $permlink));
                $content = trim(replace_relative_urls(parse($thisarticle['body']), $permlink));
                if ($syndicate_body_or_excerpt) {
                    # short feed: use body as summary if there's no excerpt
                    if (!trim($summary)) {
                        $summary = $content;
                    }
                    $content = '';
                }
                if ($show_comment_count_in_feed) {
                    $count = $comments_count > 0 ? ' [' . $comments_count . ']' : '';
                } else {
                    $count = '';
                }
                $Title = escape_title(strip_tags($Title)) . $count;
                $thisauthor = get_author_name($AuthorID);
                $item = tag($Title, 'title') . n . (trim($summary) ? tag(n . escape_cdata($summary) . n, 'description') . n : '') . (trim($content) ? tag(n . escape_cdata($content) . n, 'content:encoded') . n : '') . tag($permlink, 'link') . n . tag(safe_strftime('rfc822', $a['posted']), 'pubDate') . n . tag(htmlspecialchars($thisauthor), 'dc:creator') . n . tag('tag:' . $mail_or_domain . ',' . $feed_time . ':' . $blog_uid . '/' . $uid, 'guid', ' isPermaLink="false"') . n . $cb;
                $articles[$ID] = tag($item, 'item');
                $etags[$ID] = strtoupper(dechex(crc32($articles[$ID])));
                $dates[$ID] = $uPosted;
            }
        }
    } elseif ($area == 'link') {
        $cfilter = $category ? "category in ('" . join("','", $category) . "')" : '1';
        $limit = $limit ? $limit : $rss_how_many;
        $limit = intval(min($limit, max(100, $rss_how_many)));
        $rs = safe_rows_start("*, unix_timestamp(date) as uDate", "txp_link", "{$cfilter} order by date desc limit {$limit}");
        if ($rs) {
            while ($a = nextRow($rs)) {
                extract($a);
                $item = tag(doSpecial($linkname), 'title') . n . tag(doSpecial($description), 'description') . n . tag(doSpecial($url), 'link') . n . tag(safe_strftime('rfc822', $uDate), 'pubDate');
                $articles[$id] = tag($item, 'item');
                $etags[$id] = strtoupper(dechex(crc32($articles[$id])));
                $dates[$id] = $date;
            }
        }
    }
//.........这里部分代码省略.........
开发者ID:bgarrels,项目名称:textpattern,代码行数:101,代码来源:rss.php

示例13: output_file_download

function output_file_download($filename)
{
    global $file_error, $file_base_path, $pretext;
    callback_event('file_download');
    if (!isset($file_error)) {
        $filename = sanitizeForFile($filename);
        $fullpath = build_file_path($file_base_path, $filename);
        if (is_file($fullpath)) {
            // Discard any error PHP messages.
            ob_clean();
            $filesize = filesize($fullpath);
            $sent = 0;
            header('Content-Description: File Download');
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename="' . $filename . '"; size = "' . $filesize . '"');
            // Fix for IE6 PDF bug on servers configured to send cache headers.
            header('Cache-Control: private');
            @ini_set("zlib.output_compression", "Off");
            @set_time_limit(0);
            @ignore_user_abort(true);
            if ($file = fopen($fullpath, 'rb')) {
                while (!feof($file) and connection_status() == 0) {
                    echo fread($file, 1024 * 64);
                    $sent += 1024 * 64;
                    ob_flush();
                    flush();
                }
                fclose($file);
                // Record download.
                if (connection_status() == 0 and !connection_aborted()) {
                    safe_update('txp_file', "downloads = downloads + 1", "id = " . intval($pretext['id']));
                } else {
                    $pretext['request_uri'] .= $sent >= $filesize ? '#aborted' : "#aborted-at-" . floor($sent * 100 / $filesize) . "%";
                }
                log_hit('200');
            }
        } else {
            $file_error = 404;
        }
    }
    // Deal with error.
    if (isset($file_error)) {
        switch ($file_error) {
            case 403:
                txp_die(gTxt('403_forbidden'), '403');
                break;
            case 404:
                txp_die(gTxt('404_not_found'), '404');
                break;
            default:
                txp_die(gTxt('500_internal_server_error'), '500');
                break;
        }
    }
}
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:55,代码来源:publish.php

示例14: section_delete

function section_delete()
{
    $selected = ps('selected');
    $with_articles = safe_rows('Section, Count(*) AS count', 'textpattern', "Section in ('" . join("','", doSlash($selected)) . "') GROUP BY Section");
    $protected[] = 'default';
    $del['success'] = $del['error'] = array();
    foreach ($with_articles as $row) {
        $protected[] = $row['Section'];
    }
    $protected = array_unique($protected);
    foreach ($selected as $item) {
        if (in_array($item, $protected)) {
            $del['error'][] = $item;
        } else {
            $ret = safe_delete('txp_section', "name = '" . doSlash($item) . "'");
            if ($ret) {
                $del['success'][] = $item;
            } else {
                $del['error'][] = $item;
            }
        }
    }
    if ($del['success']) {
        callback_event('sections_deleted', '', 0, $del['success']);
    }
    $message = $del['success'] ? gTxt('section_deleted', array('{name}' => join(', ', $del['success']))) : '';
    sec_section_list($message);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:28,代码来源:txp_section.php

示例15: admin_multi_edit

/**
 * Processes multi-edit actions.
 *
 * Accessing requires 'admin.edit' privileges.
 */
function admin_multi_edit()
{
    global $txp_user;
    require_privs('admin.edit');
    $selected = ps('selected');
    $method = ps('edit_method');
    $changed = array();
    $msg = '';
    if (!$selected or !is_array($selected)) {
        return author_list();
    }
    $names = safe_column('name', 'txp_users', "name IN (" . join(',', quote_list($selected)) . ") AND name != '" . doSlash($txp_user) . "'");
    if (!$names) {
        return author_list();
    }
    switch ($method) {
        case 'delete':
            $assign_assets = ps('assign_assets');
            if (!$assign_assets) {
                $msg = array('must_reassign_assets', E_ERROR);
            } elseif (in_array($assign_assets, $names)) {
                $msg = array('cannot_assign_assets_to_deletee', E_ERROR);
            } elseif (remove_user($names, $assign_assets)) {
                $changed = $names;
                callback_event('authors_deleted', '', 0, $changed);
                $msg = 'author_deleted';
            }
            break;
        case 'changeprivilege':
            if (change_user_group($names, ps('privs'))) {
                $changed = $names;
                $msg = 'author_updated';
            }
            break;
        case 'resetpassword':
            foreach ($names as $name) {
                $passwd = generate_password(PASSWORD_LENGTH);
                if (change_user_password($name, $passwd)) {
                    $email = safe_field('email', 'txp_users', "name = '" . doSlash($name) . "'");
                    if (send_new_password($passwd, $email, $name)) {
                        $changed[] = $name;
                        $msg = 'author_updated';
                    } else {
                        return author_list(array(gTxt('could_not_mail') . ' ' . txpspecialchars($name), E_ERROR));
                    }
                }
            }
            break;
    }
    if ($changed) {
        return author_list(gTxt($msg, array('{name}' => txpspecialchars(join(', ', $changed)))));
    }
    author_list($msg);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:59,代码来源:txp_admin.php


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