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


PHP do_hook函数代码示例

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


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

示例1: translate_read_form

/** Show the translation for a message you're reading */
function translate_read_form()
{
    global $color, $translate_server;
    global $message, $translate_dir;
    global $translate_show_read;
    global $imapConnection, $wrap_at, $passed_id, $mailbox;
    if (!$translate_show_read) {
        return;
    }
    $translate_dir = 'to';
    $trans_ar = $message->findDisplayEntity(array(), array('text/plain'));
    $body = '';
    if (!empty($trans_ar[0])) {
        for ($i = 0; $i < count($trans_ar); $i++) {
            $body .= formatBody($imapConnection, $message, $color, $wrap_at, $trans_ar[$i], $passed_id, $mailbox, true);
        }
        $hookResults = do_hook('message_body', $body);
        $body = $hookResults[1];
    } else {
        $body = 'Message can\'t be translated';
    }
    $new_body = $body;
    $trans = get_html_translation_table(HTML_ENTITIES);
    $trans[' '] = '&nbsp;';
    $trans = array_flip($trans);
    $new_body = strtr($new_body, $trans);
    $new_body = urldecode($new_body);
    $new_body = strip_tags($new_body);
    /* I really don't like this next part ... */
    $new_body = str_replace('"', "''", $new_body);
    $new_body = strtr($new_body, "\n", ' ');
    $function = 'translate_form_' . $translate_server;
    $function($new_body);
}
开发者ID:jin255ff,项目名称:company_website,代码行数:35,代码来源:setup.php

示例2: cpw_do_change

/**
 * Does the actual password changing (meaning it calls the hook function
 * from the backend that does this. If something goes wrong, return error
 * message(s). If everything ok, change the password in the session so the
 * user doesn't have to log out, and redirect back to the options screen.
 */
function cpw_do_change()
{
    global $cpw_backend;
    sqgetGlobalVar('cpw_curpass', $curpw, SQ_POST);
    sqgetGlobalVar('cpw_newpass', $newpw, SQ_POST);
    sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
    sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
    sqgetGlobalVar('key', $key, SQ_COOKIE);
    sqgetGlobalVar('username', $username, SQ_SESSION);
    require_once SM_PATH . 'plugins/change_password/backend/' . $cpw_backend . '.php';
    $msgs = do_hook('change_password_dochange', $temp = array('username' => &$username, 'curpw' => &$curpw, 'newpw' => &$newpw));
    /* something bad happened, return */
    if (count($msgs) > 0) {
        return $msgs;
    }
    /* update our password stored in the session */
    $onetimepad = OneTimePadCreate(strlen($newpw));
    sqsession_register($onetimepad, 'onetimepad');
    $key = OneTimePadEncrypt($newpw, $onetimepad);
    sqsetcookie('key', $key, 0, $base_uri);
    /* make sure we write the session data before we redirect */
    session_write_close();
    header('Location: ' . SM_PATH . 'src/options.php?optmode=submit&optpage=change_password&plugin_change_password=1&smtoken=' . sm_generate_security_token());
    exit;
}
开发者ID:teammember8,项目名称:roundcube,代码行数:31,代码来源:functions.php

示例3: logout_error

function logout_error($errString, $errTitle = '')
{
    global $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height, $hide_sm_attributions, $version, $squirrelmail_language, $color, $theme, $theme_default;
    $base_uri = sqm_baseuri();
    include_once SM_PATH . 'functions/page_header.php';
    if (!isset($org_logo)) {
        // Don't know yet why, but in some accesses $org_logo is not set.
        include SM_PATH . 'config/config.php';
    }
    /* Display width and height like good little people */
    $width_and_height = '';
    if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width > 0) {
        $width_and_height = " width=\"{$org_logo_width}\"";
    }
    if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height > 0) {
        $width_and_height .= " height=\"{$org_logo_height}\"";
    }
    if (!isset($frame_top) || $frame_top == '') {
        $frame_top = '_top';
    }
    // load default theme if possible
    if (!isset($color) && @file_exists($theme[$theme_default]['PATH'])) {
        @(include $theme[$theme_default]['PATH']);
    }
    if (!isset($color)) {
        $color = array();
        $color[0] = '#dcdcdc';
        /* light gray    TitleBar               */
        $color[1] = '#800000';
        /* red                                  */
        $color[2] = '#cc0000';
        /* light red     Warning/Error Messages */
        $color[4] = '#ffffff';
        /* white         Normal Background      */
        $color[7] = '#0000cc';
        /* blue          Links                  */
        $color[8] = '#000000';
        /* black         Normal text            */
    }
    $logout_link = $base_uri . 'src/login.php';
    list($junk, $errString, $errTitle, $logout_link) = do_hook('logout_error', $errString, $errTitle, $logout_link);
    if ($errTitle == '') {
        $errTitle = $errString;
    }
    set_up_language($squirrelmail_language, true);
    displayHtmlHeader($org_name . ' - ' . $errTitle, '', false);
    echo '<body text="' . $color[8] . '" bgcolor="' . $color[4] . '" link="' . $color[7] . '" vlink="' . $color[7] . '" alink="' . $color[7] . "\">\n\n" . '<center>';
    if (isset($org_logo) && $org_logo != '') {
        echo '<img src="' . $org_logo . '" alt="' . sprintf(_("%s Logo"), $org_name) . "\"{$width_and_height} /><br />\n";
    }
    echo ($hide_sm_attributions ? '' : '<small>' . sprintf(_("SquirrelMail version %s"), $version) . '<br />' . _("By the SquirrelMail Project Team") . "<br /></small>\n") . '<table cellspacing="1" cellpadding="0" bgcolor="' . $color[1] . '" width="70%">' . '<tr><td>' . '<table width="100%" border="0" bgcolor="' . $color[4] . '" align="center">' . '<tr><td bgcolor="' . $color[0] . '" align="center">' . '<font color="' . $color[2] . '"><b>' . _("ERROR") . '</b></font>' . '</td></tr>' . '<tr><td align="center">' . $errString . '</td></tr>' . '<tr><td bgcolor="' . $color[0] . '" align="center">' . '<font color="' . $color[2] . '"><b>' . '<a href="' . $logout_link . '" target="' . $frame_top . '">' . _("Go to the login page") . '</a></b></font></td></tr>' . '</table></td></tr></table></center></body></html>';
}
开发者ID:jin255ff,项目名称:company_website,代码行数:52,代码来源:display_messages.php

示例4: elseif

} elseif (do_hook('verify_permission', 'zone_content_edit_own')) {
    $perm_content_edit = "own";
} elseif (do_hook('verify_permission', 'zone_content_edit_own_as_client')) {
    $perm_content_edit = "own_as_client";
} else {
    $perm_content_edit = "none";
}
if (do_hook('verify_permission', 'zone_meta_edit_others')) {
    $perm_meta_edit = "all";
} elseif (do_hook('verify_permission', 'zone_meta_edit_own')) {
    $perm_meta_edit = "own";
} else {
    $perm_meta_edit = "none";
}
$zid = get_zone_id_from_record_id($_GET['id']);
$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid', $zid);
$zone_type = get_domain_type($zid);
$zone_name = get_zone_name_from_id($zid);
if (isset($_POST["commit"])) {
    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
        error(ERR_PERM_EDIT_RECORD);
    } else {
        $old_record_info = get_record_from_id($_POST["rid"]);
        $ret_val = edit_record($_POST);
        if ($ret_val == "1") {
            if ($_POST['type'] != "SOA") {
                update_soa_serial($zid);
            }
            success(SUC_RECORD_UPD);
            $new_record_info = get_record_from_id($_POST["rid"]);
            log_info(sprintf('client_ip:%s user:%s operation:edit_record' . ' old_record_type:%s old_record:%s old_content:%s old_ttl:%s old_priority:%s' . ' record_type:%s record:%s content:%s ttl:%s priority:%s', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"], $old_record_info['type'], $old_record_info['name'], $old_record_info['content'], $old_record_info['ttl'], $old_record_info['prio'], $new_record_info['type'], $new_record_info['name'], $new_record_info['content'], $new_record_info['ttl'], $new_record_info['prio']));
开发者ID:cengjing,项目名称:poweradmin,代码行数:31,代码来源:edit_record.php

示例5: define

/* Define basic, general purpose preference constants. */
define('SMPREF_NO', 0);
define('SMPREF_OFF', 0);
define('SMPREF_YES', 1);
define('SMPREF_ON', 1);
define('SMPREF_NONE', 'none');
/* Define constants for location based preferences. */
define('SMPREF_LOC_TOP', 'top');
define('SMPREF_LOC_BETWEEN', 'between');
define('SMPREF_LOC_BOTTOM', 'bottom');
define('SMPREF_LOC_LEFT', '');
define('SMPREF_LOC_RIGHT', 'right');
/* Define preferences for folder settings. */
define('SMPREF_UNSEEN_NONE', 1);
define('SMPREF_UNSEEN_INBOX', 2);
define('SMPREF_UNSEEN_ALL', 3);
define('SMPREF_UNSEEN_SPECIAL', 4);
// Only special folders
define('SMPREF_UNSEEN_NORMAL', 5);
// Only normal folders
define('SMPREF_UNSEEN_ONLY', 1);
define('SMPREF_UNSEEN_TOTAL', 2);
/* Define constants for time/date display preferences. */
define('SMPREF_TIME_24HR', 1);
define('SMPREF_TIME_12HR', 2);
/* Define constants for javascript preferences. */
define('SMPREF_JS_OFF', 0);
define('SMPREF_JS_ON', 1);
define('SMPREF_JS_AUTODETECT', 2);
do_hook('loading_constants');
开发者ID:jin255ff,项目名称:company_website,代码行数:30,代码来源:constants.php

示例6: foreach

    } else {
        foreach ($owners as $owner) {
            echo "    <tr><td>" . $owner["fullname"] . "</td><td>&nbsp;</td></tr>";
        }
    }
}
if ($meta_edit) {
    echo "      <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
    echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
    echo "       <tr>\n";
    echo "        <td>\n";
    echo "         <select name=\"newowner\">\n";
    /*
     Show list of users to add as owners of this domain, only if we have permission to do so.
    */
    $users = do_hook('show_users');
    foreach ($users as $user) {
        $add = '';
        if ($user["id"] == $_SESSION["userid"]) {
            echo "          <option" . $add . " value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
        } elseif ($perm_view_others == "1") {
            echo "          <option  value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
        }
    }
    echo "         </select>\n";
    echo "        </td>\n";
    echo "        <td>\n";
    echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Add') . "\">\n";
    echo "        </td>\n";
    echo "       </tr>\n";
    echo "      </form>\n";
开发者ID:alex1702,项目名称:poweradmin,代码行数:31,代码来源:edit.php

示例7: _

    $selopts['-1'] = _("All address books");
    $ret = $abook->get_backend_list();
    while (list($undef, $v) = each($ret)) {
        $selopts[$v->bnum] = $v->sname;
    }
    echo addSelect('backend', $selopts, $backend, TRUE);
} else {
    echo addHidden('backend', '-1');
}
if (isset($session)) {
    echo addHidden('session', $session);
}
echo '<input type="submit" value="' . _("Search") . '" />' . '&nbsp;|&nbsp;<input type="submit" value="' . _("List all") . '" name="listall" />' . "\n" . '</form></center></td></tr></table>' . "\n";
addr_insert_hidden();
echo '</center>';
do_hook('addrbook_html_search_below');
/* End search form */
/* Show personal addressbook */
if (!empty($listall)) {
    $addrquery = '*';
}
if ($addrquery == '' && empty($listall)) {
    if (!isset($backend) || $backend != -1 || $addrquery == '') {
        if ($addrquery == '') {
            $backend = $abook->localbackend;
        }
        /* echo '<h3 align="center">' . $abook->backends[$backend]->sname) . "</h3>\n"; */
        $res = $abook->list_addr($backend);
        if (is_array($res)) {
            usort($res, 'alistcmp');
            addr_display_result($res, false);
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:addrbook_search_html.php

示例8: abook_create_form

        }
    }
    $addresses[$current_backend]['Addresses'] = $new_address_list;
}
if ($showaddrlist) {
    $oTemplate->assign('show_all', $show_all);
    $oTemplate->assign('page_number', $page_number);
    $oTemplate->assign('page_size', $page_size);
    $oTemplate->assign('total_addresses', $total_addresses);
    $oTemplate->assign('abook_compact_paginator', $abook_compact_paginator);
    $oTemplate->assign('abook_page_selector', $abook_page_selector);
    $oTemplate->assign('current_page_args', $current_page_args);
    $oTemplate->assign('abook_page_selector_max', $abook_page_selector_max);
    $oTemplate->assign('addresses', $addresses);
    $oTemplate->assign('current_backend', $current_backend);
    $oTemplate->assign('backends', $list_backends);
    $oTemplate->assign('abook_has_extra_field', $abook->add_extra_field);
    $oTemplate->assign('compose_new_win', $compose_new_win);
    $oTemplate->assign('compose_height', $compose_height);
    $oTemplate->assign('compose_width', $compose_width);
    $oTemplate->assign('form_action', $form_url);
    $oTemplate->display('addressbook_list.tpl');
}
/* Display the "new address" form */
//FIXME: Remove HTML from here! (echo abook_create_form() is OK, since it is all template based output
echo '<a name="AddAddress"></a>' . "\n";
echo abook_create_form($form_url, 'addaddr', _("Add to address book"), _("Add address"), $current_backend, $defdata);
echo "</form>\n";
/* Hook for extra address book blocks */
do_hook('addressbook_bottom', $null);
$oTemplate->display('footer.tpl');
开发者ID:teammember8,项目名称:roundcube,代码行数:31,代码来源:addressbook.php

示例9: _

 *
 * @package     Poweradmin
 * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
 * @copyright   2010-2014 Poweradmin Development Team
 * @license     http://opensource.org/licenses/GPL-3.0 GPL
 */
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
echo "     <h3>" . _('Welcome') . " " . $_SESSION["name"] . "</h3>\n";
do_hook('verify_permission', 'search') ? $perm_search = "1" : ($perm_search = "0");
do_hook('verify_permission', 'zone_content_view_own') ? $perm_view_zone_own = "1" : ($perm_view_zone_own = "0");
do_hook('verify_permission', 'zone_content_view_others') ? $perm_view_zone_other = "1" : ($perm_view_zone_other = "0");
do_hook('verify_permission', 'supermaster_view') ? $perm_supermaster_view = "1" : ($perm_supermaster_view = "0");
do_hook('verify_permission', 'zone_master_add') ? $perm_zone_master_add = "1" : ($perm_zone_master_add = "0");
do_hook('verify_permission', 'zone_slave_add') ? $perm_zone_slave_add = "1" : ($perm_zone_slave_add = "0");
do_hook('verify_permission', 'supermaster_add') ? $perm_supermaster_add = "1" : ($perm_supermaster_add = "0");
echo "    <ul>\n";
echo "    <li><a href=\"index.php\">" . _('Index') . "</a></li>\n";
if ($perm_search == "1") {
    echo "    <li><a href=\"search.php\">" . _('Search zones and records') . "</a></li>\n";
}
if ($perm_view_zone_own == "1" || $perm_view_zone_other == "1") {
    echo "    <li><a href=\"list_zones.php\">" . _('List zones') . "</a></li>\n";
}
if ($perm_zone_master_add) {
    echo "    <li><a href=\"list_zone_templ.php\">" . _('List zone templates') . "</a></li>\n";
}
if ($perm_supermaster_view) {
    echo "    <li><a href=\"list_supermasters.php\">" . _('List supermasters') . "</a></li>\n";
}
if ($perm_zone_master_add) {
开发者ID:rephlex,项目名称:poweradmin,代码行数:31,代码来源:index.php

示例10: getPref

}
// Determine where the navigation frame should be
$location_of_bar = getPref($data_dir, $username, 'location_of_bar');
if (isset($languages[$squirrelmail_language]['DIR']) && strtolower($languages[$squirrelmail_language]['DIR']) == 'rtl') {
    $temp_location_of_bar = 'right';
} else {
    $temp_location_of_bar = 'left';
}
if ($location_of_bar == '') {
    $location_of_bar = $temp_location_of_bar;
}
// this value may be changed by a plugin, but initialize
// it first to avoid register_globals headaches
//
$right_frame_url = '';
do_hook('webmail_top', $null);
// Determine the main frame URL
/*
 * There are three ways to call webmail.php
 * 1.  webmail.php
 *      - This just loads the default entry screen.
 * 2.  webmail.php?right_frame=right_main.php&sort=X&startMessage=X&mailbox=XXXX
 *      - This loads the frames starting at the given values.
 * 3.  webmail.php?right_frame=folders.php
 *      - Loads the frames with the Folder options in the right frame.
 *
 * This was done to create a pure HTML way of refreshing the folder list since
 * we would like to use as little Javascript as possible.
 *
 * The test for // should catch any attempt to include off-site webpages into
 * our frameset.
开发者ID:teammember8,项目名称:roundcube,代码行数:31,代码来源:webmail.php

示例11: html_tag

                    echo html_tag('td', '&nbsp;', 'center', '', 'valign="top" width="1%"');
                }
                echo html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['nickname']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%" nowrap') . html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['name']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%" nowrap') . html_tag('td', '', 'left', '', 'valign="top" width="10%" nowrap') . '&nbsp;';
            }
            $email = $abook->full_address($row);
            echo addHidden($row['backend'] . ':' . $row['nickname'], rawurlencode($email)) . makeComposeLink('src/compose.php?send_to=' . rawurlencode($email), htmlspecialchars($row['email'])) . '&nbsp;</td>' . "\n" . html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['label']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%"');
            // add extra column if third party backend needs it
            if ($abook->add_extra_field) {
                echo html_tag('td', '&nbsp;' . (isset($row['extra']) ? $row['extra'] : '') . '&nbsp;', 'left', '', 'valign="top" width="10%"');
            }
            echo "</tr>\n";
            $line++;
            $count++;
        }
        /* End of list. Close table. */
        if ($headerprinted) {
            echo html_tag('tr', html_tag('td', addSubmit(_("Edit selected"), 'editaddr') . addSubmit(_("Delete selected"), 'deladdr') . addSubmit(_("Compose to selected"), 'compose_to', $javascript_on && $compose_new_win ? $compose_to_in_new_window_javascript : ''), 'center', '', "colspan=\"{$abook_fields}\""));
        }
        echo '</table></form>';
    }
}
/* end of addresslist */
/* Display the "new address" form */
echo '<a name="AddAddress"></a>' . "\n" . addForm($form_url, 'post', 'f_add') . html_tag('table', html_tag('tr', html_tag('td', "\n" . '<strong>' . sprintf(_("Add to %s"), $abook->localbackendname) . '</strong>' . "\n", 'center', $color[0])), 'center', '', 'width="95%"') . "\n";
address_form('addaddr', _("Add address"), $defdata);
echo "</form>\n";
/* Add hook for anything that wants on the bottom */
do_hook('addressbook_bottom');
?>
</body></html>
开发者ID:jprice,项目名称:EHCP,代码行数:30,代码来源:addressbook.php

示例12: sqimap_mailbox_select

$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);
$location = set_url_var($location, 'composenew', 0, false);
$location = set_url_var($location, 'composesession', 0, false);
$location = set_url_var($location, 'session', 0, false);
// make sure that cache is not used
$location = set_url_var($location, 'use_mailbox_cache', 0, false);
/* remember changes to mailbox setting */
if (!isset($lastTargetMailbox)) {
    $lastTargetMailbox = 'INBOX';
}
if ($targetMailbox != $lastTargetMailbox) {
    $lastTargetMailbox = $targetMailbox;
    sqsession_register($lastTargetMailbox, 'lastTargetMailbox');
}
$exception = false;
do_hook('move_before_move');
/*
    Move msg list sorting up here, as it is used several times,
    makes it more efficient to do it in one place for the code
*/
$id = array();
if (isset($msg) && is_array($msg)) {
    foreach ($msg as $key => $uid) {
        // using foreach removes the risk of infinite loops that was there //
        $id[] = $uid;
    }
}
// expunge-on-demand if user isn't using move_to_trash or auto_expunge
if (isset($expungeButton)) {
    $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
    if ($startMessage + $cnt - 1 >= $mbx_response['EXISTS']) {
开发者ID:jprice,项目名称:EHCP,代码行数:31,代码来源:move_messages.php

示例13: formatAttachments

function formatAttachments($message, $exclude_id, $mailbox, $id)
{
    global $where, $what, $startMessage, $color, $passed_ent_id;
    static $ShownHTML = 0;
    $att_ar = $message->getAttachments($exclude_id);
    if (!count($att_ar)) {
        return '';
    }
    $attachments = '';
    $urlMailbox = urlencode($mailbox);
    foreach ($att_ar as $att) {
        $ent = $att->entity_id;
        $header = $att->header;
        $type0 = strtolower($header->type0);
        $type1 = strtolower($header->type1);
        $name = '';
        $links['download link']['text'] = _("Download");
        $links['download link']['href'] = SM_PATH . "src/download.php?absolute_dl=true&amp;passed_id={$id}&amp;mailbox={$urlMailbox}&amp;ent_id={$ent}";
        $ImageURL = '';
        if ($type0 == 'message' && $type1 == 'rfc822') {
            $default_page = SM_PATH . 'src/read_body.php';
            $rfc822_header = $att->rfc822_header;
            $filename = $rfc822_header->subject;
            if (trim($filename) == '') {
                $filename = 'untitled-[' . $ent . ']';
            }
            $from_o = $rfc822_header->from;
            if (is_object($from_o)) {
                $from_name = $from_o->getAddress(false);
            } elseif (is_array($from_o) && count($from_o) && is_object($from_o[0])) {
                // when a digest message is opened and you return to the digest
                // now the from object is part of an array. This is a workaround.
                $from_name = $from_o[0]->getAddress(false);
            } else {
                $from_name = _("Unknown sender");
            }
            $from_name = decodeHeader($from_name);
            $description = $from_name;
        } else {
            $default_page = SM_PATH . 'src/download.php';
            if (is_object($header->disposition)) {
                $filename = $header->disposition->getProperty('filename');
                if (trim($filename) == '') {
                    $name = decodeHeader($header->disposition->getProperty('name'));
                    if (trim($name) == '') {
                        $name = $header->getParameter('name');
                        if (trim($name) == '') {
                            if (trim($header->id) == '') {
                                $filename = 'untitled-[' . $ent . ']';
                            } else {
                                $filename = 'cid: ' . $header->id;
                            }
                        } else {
                            $filename = $name;
                        }
                    } else {
                        $filename = $name;
                    }
                }
            } else {
                $filename = $header->getParameter('name');
                if (!trim($filename)) {
                    if (trim($header->id) == '') {
                        $filename = 'untitled-[' . $ent . ']';
                    } else {
                        $filename = 'cid: ' . $header->id;
                    }
                }
            }
            if ($header->description) {
                $description = decodeHeader($header->description);
            } else {
                $description = '';
            }
        }
        $display_filename = $filename;
        if (isset($passed_ent_id)) {
            $passed_ent_id_link = '&amp;passed_ent_id=' . $passed_ent_id;
        } else {
            $passed_ent_id_link = '';
        }
        $defaultlink = $default_page . "?startMessage={$startMessage}" . "&amp;passed_id={$id}&amp;mailbox={$urlMailbox}" . '&amp;ent_id=' . $ent . $passed_ent_id_link;
        if ($where && $what) {
            $defaultlink .= '&amp;where=' . urlencode($where) . '&amp;what=' . urlencode($what);
        }
        // IE does make use of mime content sniffing. Forcing a download
        // prohibit execution of XSS inside an application/octet-stream attachment
        if ($type0 == 'application' && $type1 == 'octet-stream') {
            $defaultlink .= '&amp;absolute_dl=true';
        }
        /* This executes the attachment hook with a specific MIME-type.
         * If that doesn't have results, it tries if there's a rule
         * for a more generic type. Finally, a hook for ALL attachment
         * types is run as well.
         */
        $hookresults = do_hook("attachment {$type0}/{$type1}", $links, $startMessage, $id, $urlMailbox, $ent, $defaultlink, $display_filename, $where, $what);
        if (count($hookresults[1]) <= 1) {
            $hookresults = do_hook("attachment {$type0}/*", $links, $startMessage, $id, $urlMailbox, $ent, $defaultlink, $display_filename, $where, $what);
        }
        $hookresults = do_hook("attachment */*", $hookresults[1], $startMessage, $id, $urlMailbox, $ent, $hookresults[6], $display_filename, $where, $what);
//.........这里部分代码省略.........
开发者ID:jin255ff,项目名称:company_website,代码行数:101,代码来源:mime.php

示例14: str_replace

        $line = "<span style=\"white-space: nowrap;\"><tt>{$prefix}</tt>";
        /* Add the folder name and link. */
        if (!isset($color[15])) {
            $color[15] = $color[6];
        }
        if (in_array('noselect', $boxes[$i]['flags'])) {
            if (isSpecialMailbox($boxes[$i]['unformatted'])) {
                $line .= "<font color=\"{$color['11']}\">";
            } else {
                $line .= "<font color=\"{$color['15']}\">";
            }
            if (ereg("^( *)([^ ]*)", $mailbox, $regs)) {
                $mailbox = str_replace('&nbsp;', '', $mailbox);
                $line .= str_replace(' ', '&nbsp;', $mailbox);
            }
            $line .= '</font>';
        } else {
            $line .= formatMailboxName($imapConnection, $boxes[$i]);
        }
        /* Put the final touches on our folder line. */
        $line .= "</span><br />\n";
        /* Output the line for this folder. */
        echo $line;
    }
}
do_hook('left_main_after');
sqimap_logout($imapConnection);
?>
</td></tr></table>
</body></html>
开发者ID:jprice,项目名称:EHCP,代码行数:30,代码来源:left_main.php

示例15: dbConnect

    $rtypes[] = 'CURL';
}
/* * ***********
 * Includes  *
 * *********** */
$db = dbConnect();
require_once "plugin.inc.php";
require_once "i18n.inc.php";
require_once "auth.inc.php";
require_once "users.inc.php";
require_once "dns.inc.php";
require_once "record.inc.php";
require_once "dnssec.inc.php";
require_once "templates.inc.php";
//do_hook('hook_post_includes');
do_hook('authenticate');
/* * ***********
 * Functions *
 * *********** */
/** Print paging menu
 *
 * Display the page option: [ < ][ 1 ] .. [ 8 ][ 9 ][ 10 ][ 11 ][ 12 ][ 13 ][ 14 ][ 15 ][ 16 ] .. [ 34 ][ > ]
 *
 * @param int $amount Total number of items
 * @param int $rowamount Per page number of items
 * @param int $id Page specific ID (Zone ID, Template ID, etc)
 *
 * @return null
 */
function show_pages($amount, $rowamount, $id = '')
{
开发者ID:alex1702,项目名称:poweradmin,代码行数:31,代码来源:toolkit.inc.php


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