本文整理汇总了PHP中tag函数的典型用法代码示例。如果您正苦于以下问题:PHP tag函数的具体用法?PHP tag怎么用?PHP tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
//记录登陆失败者IP
$ip = get_client_ip();
$username = I("post.account", "", "trim");
$password = I("post.password", "", "trim");
if (empty($username)) {
$this->error("用户名不能为空,请重新输入!");
}
if (empty($password)) {
$this->error("密码不能为空,请重新输入!");
}
if (Admin::getInstance()->login($username, $password)) {
$forward = cookie("forward");
if (!$forward) {
$forward = U("Admins:Index");
} else {
cookie("forward", NULL);
}
//增加登陆成功行为调用
$admin_public_tologin = array('username' => $username, 'ip' => $ip);
tag('admin_public_tologin', $admin_public_tologin);
$this->success('成功登录后台管理系统', U('Index/index'));
} else {
//增加登陆失败行为调用
$admin_public_tologin = array('username' => $username, 'password' => $password, 'ip' => $ip);
tag('admin_public_tologin_error', $admin_public_tologin);
$this->error("用户名或者密码错误,登陆失败!", U("login"));
}
}
开发者ID:gzwyufei,项目名称:hp,代码行数:30,代码来源:LoginController.class.php
示例2: doLoginForm
/**
* Renders and outputs a login form.
*
* This function outputs a full HTML document,
* including <head> and footer.
*
* @param string|array $message The activity message
*/
function doLoginForm($message)
{
global $textarray_script, $event, $step;
include txpath . '/lib/txplib_head.php';
$event = 'login';
if (gps('logout')) {
$step = 'logout';
} elseif (gps('reset')) {
$step = 'reset';
}
pagetop(gTxt('login'), $message);
$stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
$reset = gps('reset');
$name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
$out = array();
if ($reset) {
$out[] = hed(gTxt('password_reset'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), ' class="login-name"') . graf(fInput('submit', '', gTxt('password_reset_button'), 'publish') . n) . graf(href(gTxt('back_to_login'), 'index.php'), array('class' => 'login-return')) . hInput('p_reset', 1);
} else {
$out[] = hed(gTxt('login_to_textpattern'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), array('class' => 'login-name')) . graf(n . span(tag(gTxt('password'), 'label', array('for' => 'login_password')), array('class' => 'txp-label')) . n . span(fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password'), array('class' => 'txp-value')), array('class' => 'login-password')) . graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . tag(gTxt('stay_logged_in'), 'label', array('for' => 'login_stay')) . popHelp('remember_login') . n, array('class' => 'login-stay')) . graf(fInput('submit', '', gTxt('log_in_button'), 'publish') . n) . graf(href(gTxt('password_forgotten'), '?reset=1'), array('class' => 'login-forgot'));
if (gps('event')) {
$out[] = eInput(gps('event'));
}
}
echo form(tag(join('', $out), 'section', array('role' => 'region', 'class' => 'txp-login', 'aria-labelledby' => 'txp-login-heading')), '', '', 'post', '', '', 'login_form') . script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</main><!-- /txp-body -->' . n . '</body>' . n . '</html>';
exit(0);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:34,代码来源:txp_auth.php
示例3: get_config_by_app
public function get_config_by_app($app)
{
$config = array();
if ($app && AppService::is_app_active($app)) {
$configs = S("configs/app/all");
$config = $configs[$app];
}
$config = $config ? $config : array();
/*
* 全局文件加载
* **/
foreach (AppService::$allAppConfigs as $app => $app_config) {
if ($app_config['global_include'] && AppService::is_app_active($app)) {
$config['include'] = array_merge_recursive((array) $config['include'], (array) $app_config['global_include']);
}
if ($app_config['force_global_include']) {
$config['include'] = array_merge_recursive((array) $config['include'], (array) $app_config['force_global_include']);
}
if ($app_config['global_load_modules'] && AppService::is_app_active($app)) {
$config['load_modules'] = array_merge_recursive((array) $config['load_modules'], (array) $app_config['global_load_modules']);
}
}
tag("before_app_config_response", $config);
return $config;
}
开发者ID:npk,项目名称:ones,代码行数:25,代码来源:ConfigService.class.php
示例4: authenticate
public function authenticate($company_sign_id, $login, $password)
{
$company = D("Account/Company")->where(array('sign_id' => $company_sign_id))->find();
if (!$company) {
return -1;
}
$user = $this->where(array("company_id" => $company['id'], "login" => $login))->relation(false)->find();
if (!$user) {
return -2;
}
$hashed = $this->generate_password($password, $user['rand_hash']);
if ($user['password'] !== $hashed[0]) {
return -3;
}
$params = array($user, $company);
tag('after_user_authenticated', $params);
list($user, $company) = $params;
session('[destroy]');
session('[start]');
session('[regenerate]');
$is_super_user = false;
if ($company['superuser'] && $company['superuser'] == $user["id"]) {
$is_super_user = true;
}
session('user', array("login" => $user["login"], "id" => $user["id"], "realname" => $user["realname"], "email" => $user["email"], "avatar" => $user["avatar"], "company" => $company, "is_super_user" => $is_super_user));
return true;
}
开发者ID:joncv,项目名称:ones,代码行数:27,代码来源:UserService.class.php
示例5: text2img
/**
* AlbaToolsHelper.
*
* @package symfony
* @subpackage helper
* @author Fernando Toledo <[email protected]>
* @version SVN: $Id: NumberHelper.php 7757 2008-03-07 10:55:22Z fabien $
*/
function text2img($texto)
{
if (is_null($texto)) {
return null;
}
return tag('img', array('alt' => $texto, 'src' => url_for('albaTools/text2img?texto=' . $texto)));
}
开发者ID:mediasadc,项目名称:alba,代码行数:15,代码来源:AlbaToolsHelper.php
示例6: Syntaxhighlighter_systemCheck
/**
* Returns the requirements information view.
*
* @return string The (X)HTML.
*/
function Syntaxhighlighter_systemCheck()
{
// RELEASE-TODO
global $pth, $tx, $plugin_tx;
define('SYNTAXHIGHLIGHTER_PHP_VERSION', '4.0.7');
$ptx = $plugin_tx['syntaxhighlighter'];
$imgdir = $pth['folder']['plugins'] . 'syntaxhighlighter/images/';
$ok = tag('img src="' . $imgdir . 'ok.png" alt="ok"');
$warn = tag('img src="' . $imgdir . 'warn.png" alt="warning"');
$fail = tag('img src="' . $imgdir . 'fail.png" alt="failure"');
$o = '<h4>' . $ptx['syscheck_title'] . '</h4>' . (version_compare(PHP_VERSION, SYNTAXHIGHLIGHTER_PHP_VERSION) >= 0 ? $ok : $fail) . ' ' . sprintf($ptx['syscheck_phpversion'], SYNTAXHIGHLIGHTER_PHP_VERSION) . tag('br') . "\n";
foreach (array('pcre') as $ext) {
$o .= (extension_loaded($ext) ? $ok : $fail) . ' ' . sprintf($ptx['syscheck_extension'], $ext) . tag('br') . "\n";
}
$o .= (!get_magic_quotes_runtime() ? $ok : $fail) . ' ' . $ptx['syscheck_magic_quotes'] . tag('br') . tag('br') . "\n";
$o .= (strtoupper($tx['meta']['codepage']) == 'UTF-8' ? $ok : $fail) . ' ' . $ptx['syscheck_encoding'] . tag('br') . "\n";
$folders = array();
foreach (array('config/', 'css/', 'languages/') as $folder) {
$folders[] = $pth['folder']['plugins'] . 'syntaxhighlighter/' . $folder;
}
foreach ($folders as $folder) {
$o .= (is_writable($folder) ? $ok : $warn) . ' ' . sprintf($ptx['syscheck_writable'], $folder) . tag('br') . "\n";
}
return $o;
}
开发者ID:bbfriend,项目名称:CMSimpleXH-Template-bootstrap_Acme,代码行数:30,代码来源:admin.php
示例7: __toString
public function __toString()
{
$name = $this->getPropertyValue('namePattern');
$id = $this->getPropertyValue('namePattern');
$imageHTML = tag('img', array('src' => theme_path('images/callout-left.png'), 'title' => 'Click here to edit', 'alt' => 'Edit', 'class' => 'callout dialogInvoker'));
$placeholderGetters = $this->getPropertyValue('placeholderGetters');
$id = $this->generateAttributeValue($placeholderGetters, $this->getPropertyValue('idPattern'));
$name = $this->generateAttributeValue($placeholderGetters, $this->getPropertyValue('namePattern'));
$comments = $this->getValue();
$commentExtract = '';
$allComments = '';
// show last comment only
if (count($comments) > 0) {
foreach ($comments as $comment) {
$created = new DateTime($comment->getCreated());
$createdAt = set_datepicker_date_format($created->format('Y-m-d')) . ' ' . $created->format('H:i');
$formatComment = $createdAt . ' ' . $comment->getCreatedByName() . "\n\n" . $comment->getComments();
$allComments = $formatComment . "\n\n" . $allComments;
}
$lastComment = $comments->getLast();
$commentExtract = $this->trimComment($lastComment->getComments());
}
$commentContainerHTML = content_tag('span', $commentExtract, array('id' => $this->generateAttributeValue($placeholderGetters, 'commentContainer-{id}')));
$hiddenFieldHTML = tag('input', array('type' => 'hidden', 'id' => $id, 'name' => $name, 'value' => $allComments));
$commentHTML = content_tag('span', $commentContainerHTML . $imageHTML . $hiddenFieldHTML, array('class' => 'commentContainerLong'));
if ($this->isHiddenOnCallback()) {
return ' ';
}
return $commentHTML . $this->getHiddenFieldHTML();
}
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:30,代码来源:LeaveCommentCell.php
示例8: jmd_save
/**
* Inserts JS.
*/
function jmd_save()
{
$js = <<<EOD
//inc <save.js>
EOD;
echo tag($js, 'script', ' type="text/javascript"');
}
开发者ID:jmdeldin,项目名称:jmd_save,代码行数:10,代码来源:save.php
示例9: read
public function read()
{
if (!$_GET["includeRows"] or $_GET['workflow']) {
return parent::read();
}
// $this->readModel = "PurchaseView";
// $formData = parent::read(true);
$formData = D("PurchaseView")->find($_GET['id']);
$formData["inputTime"] = $formData["dateline"] * 1000;
// $formData["total_amount"] = $formData["total_price"];
// $formData["total_amount_real"] = $formData["total_price_real"];
// $formData["total_num"] = $formData["quantity"];
$rowModel = D("PurchaseDetailView");
$rows = $rowModel->where("PurchaseDetail.purchase_id=" . $formData["id"])->select();
// echo $rowModel->getLastSql();exit;
$modelIds = array();
$rowData = array();
foreach ($rows as $v) {
$tmp = explode(DBC("goods.unique.separator"), $v["factory_code_all"]);
//根据factory_code_all factory_code - standard - version
$factory_code = array_shift($tmp);
$modelIds = array_merge($modelIds, $tmp);
$v["modelIds"] = $tmp;
$v["goods_id"] = sprintf("%s_%s_%s", $factory_code, $v["goods_id"], $v["goods_category_id"]);
// factory_code, id, catid
$v["goods_id_label"] = sprintf("%s", $v["goods_name"]);
// $v["amount"] = $v["price"];
$rowData[$v["id"]] = $v;
}
// array_flip(array_flip($modelIds));
$formData["customer_id_label"] = $formData["customer"];
$params = array($rowData, $modelIds);
tag("assign_dataModel_data", $params);
$formData["rows"] = reIndex($params[0]);
/*
* 相关单据
* **/
$relateItem = array();
$id = abs(intval($_GET["id"]));
if (isAppLoaded("store")) {
$tmp = D("Stockin")->toRelatedItem("Purchase", $id);
if ($tmp) {
$relateItem = array_merge($relateItem, $tmp);
}
}
if (isAppLoaded("finance")) {
$tmp = D("FinancePayPlan")->toRelatedItem("Purchase", $id);
if ($tmp) {
$relateItem = array_merge($relateItem, $tmp);
}
}
if ($formData["source_model"] == "ProducePlan" && $formData["source_id"] && isAppLoaded("produce")) {
$tmp = D("ProducePlan")->getRelatedItem($formData["source_id"]);
if ($tmp) {
$relateItem[] = $tmp;
}
}
$formData["relatedItems"] = $relateItem;
$this->response($formData);
}
开发者ID:bqx619,项目名称:ones_dev,代码行数:60,代码来源:PurchaseAction.class.php
示例10: occurrence_delete
function occurrence_delete()
{
global $vars, $phpcdb, $phpcid, $phpc_script;
$html = tag('div', attributes('class="phpc-container"'));
if (empty($vars["oid"])) {
$message = __('No occurrence selected.');
$html->add(tag('p', $message));
return $html;
}
if (is_array($vars["oid"])) {
$oids = $vars["oid"];
} else {
$oids = array($vars["oid"]);
}
$removed_occurs = array();
$unremoved_occurs = array();
$permission_denied = array();
foreach ($oids as $oid) {
$occur = $phpcdb->get_occurrence_by_oid($oid);
if (!$occur->can_modify()) {
$permission_denied[] = $oid;
} else {
if ($phpcdb->delete_occurrence($oid)) {
$removed_occurs[] = $oid;
// TODO: Verify that the event still has occurences.
$eid = $occur->get_eid();
} else {
$unremoved_occurs[] = $oid;
}
}
}
if (sizeof($removed_occurs) > 0) {
if (sizeof($removed_occurs) == 1) {
$text = __("Removed occurrence");
} else {
$text = __("Removed occurrences");
}
$text .= ': ' . implode(', ', $removed_occurs);
$html->add(tag('p', $text));
}
if (sizeof($unremoved_occurs) > 0) {
if (sizeof($unremoved_occurs) == 1) {
$text = __("Could not remove occurrence");
} else {
$text = __("Could not remove occurrences");
}
$text .= ': ' . implode(', ', $unremoved_occurs);
$html->add(tag('p', $text));
}
if (sizeof($permission_denied) > 0) {
if (sizeof($permission_denied) == 1) {
$text = __("You do not have permission to remove the occurrence.");
} else {
$text = __("You do not have permission to remove occurrences.");
}
$text .= ': ' . implode(', ', $permission_denied);
$html->add(tag('p', $text));
}
return message_redirect($html, "{$phpc_script}?action=display_event&phpcid={$phpcid}&eid={$eid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:60,代码来源:occurrence_delete.php
示例11: header
function header()
{
$out[] = '<table id="pagetop" cellpadding="0" cellspacing="0">' . n . '<tr id="branding"><td><h1 id="textpattern">Textpattern</h1></td><td id="navpop">' . navPop(1) . '</td></tr>' . n . '<tr id="nav-primary"><td align="center" class="tabs" colspan="2">';
if (!$this->is_popup) {
$out[] = '<table cellpadding="0" cellspacing="0" align="center">' . n . '<tr><td id="messagepane"> ' . $this->announce($this->message) . '</td>';
$secondary = '';
foreach ($this->menu as $tab) {
$tc = $tab['active'] ? 'tabup' : 'tabdown';
$atts = ' class="' . $tc . '"';
$hatts = ' href="?event=' . $tab['event'] . '" class="plain"';
$out[] = tda(tag($tab['label'], 'a', $hatts), $atts);
if ($tab['active'] && !empty($tab['items'])) {
$secondary = '</td></tr><tr id="nav-secondary"><td align="center" class="tabs" colspan="2">' . n . '<table cellpadding="0" cellspacing="0" align="center">' . n . '<tr>';
foreach ($tab['items'] as $item) {
$tc = $item['active'] ? 'tabup' : 'tabdown2';
$secondary .= '<td class="' . $tc . '"><a href="?event=' . $item['event'] . '" class="plain">' . $item['label'] . '</a></td>';
}
$secondary .= '</tr></table>';
}
}
$out[] = '<td id="view-site" class="tabdown"><a href="' . hu . '" class="plain" target="_blank">' . gTxt('tab_view_site') . '</a></td>';
$out[] = '</tr></table>';
$out[] = $secondary;
}
$out[] = '</td></tr></table>';
return join(n, $out);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:27,代码来源:classic.php
示例12: file_download_list
function file_download_list($atts)
{
global $thisfile;
extract(lAtts(array('break' => br, 'category' => '', 'class' => __FUNCTION__, 'form' => 'files', 'label' => '', 'labeltag' => '', 'limit' => '10', 'offset' => '0', 'sort' => 'filename asc', 'wraptag' => '', 'status' => '4'), $atts));
if (!is_numeric($status)) {
$status = getStatusNum($status);
}
$where = array('1=1');
if ($category) {
$where[] = "category IN ('" . join("','", doSlash(do_list($category))) . "')";
}
if ($status) {
$where[] = "status = '" . doSlash($status) . "'";
}
$qparts = array('order by ' . doSlash($sort), $limit ? 'limit ' . intval($offset) . ', ' . intval($limit) : '');
$rs = safe_rows_start('*, unix_timestamp(created) as created, unix_timestamp(modified) as modified', 'txp_file', join(' and ', $where) . ' ' . join(' ', $qparts));
if ($rs) {
$out = array();
while ($thisfile = nextRow($rs)) {
$out[] = parse_form($form);
$thisfile = '';
}
if ($out) {
if ($wraptag == 'ul' or $wraptag == 'ol') {
return doLabel($label, $labeltag) . doWrap($out, $wraptag, $break, $class);
}
return $wraptag ? tag(join($break, $out), $wraptag) : join(n, $out);
}
}
return '';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:31,代码来源:tag_file.php
示例13: __toString
public function __toString()
{
$label = $this->getPropertyValue('label', $this->identifier);
$id = $this->getId();
$class = $this->getPropertyValue('class', 'plainbtn');
return tag('input', array('type' => $this->getPropertyValue('type', 'button'), 'class' => $class, 'id' => $id, 'name' => $this->getPropertyValue('name', $id), 'onmouseover' => "this.className='{$class} {$class}hov'", 'onmouseout' => "this.className='{$class}'", 'value' => __($label)));
}
开发者ID:THM068,项目名称:orangehrm,代码行数:7,代码来源:Button.php
示例14: jmd_example
/**
* @name jmd_example
* @description A glorified "Hello, World".
* @author Jon-Michael Deldin
* @author_uri http://jmdeldin.com
* @version 0.1
* @type 0
* @order 5
*/
function jmd_example($attrs, $thing)
{
$js = <<<EOF
//inc <example.js>
EOF;
return tag($js, 'script', ' type="text/javascript"');
}
开发者ID:jmdeldin,项目名称:txpc,代码行数:16,代码来源:example.php
示例15: thumbnail
function thumbnail($img, $options = array(), $attributes = array())
{
// Maintains Backwards Compatibility - you can pass a string or an array with [profile] set to pull
// from YAML, or you can just pass the options in array format
if (is_array($options)) {
if (isset($options['profile'])) {
$profile = $options['profile'];
unset($options['profile']);
} else {
$profile = '';
}
} else {
$profile = $options;
$options = array();
}
//If a profile is set, pull the profile from YAML. Else, just use the options
//Note: you can override anything set in a profile by passing the overriden argument in options
if ($profile) {
$options = array_merge(getImageCacheProfile($profile), $options);
// You can also set attributes in your imagecache profile
if (isset($options['attributes'])) {
$attributes = array_merge($attributes, $options['attributes']);
}
}
$attributes['src'] = thumbnail_path($img, $options);
return tag('img', $attributes);
}
开发者ID:bshaffer,项目名称:Symplist,代码行数:27,代码来源:ThumbnailHelper.php
示例16: user_enable
function user_enable()
{
global $vars, $phpcid, $phpcdb, $phpc_script;
$html = tag('div', attributes('class="phpc-container"'));
if (!is_admin()) {
$html->add(tag('p', __('You must be an admin to enable users.')));
return $html;
}
if (empty($vars["uid"])) {
$html->add(tag('p', __('No user selected.')));
return $html;
}
if (is_array($vars["uid"])) {
$ids = $vars["uid"];
} else {
$ids = array($vars["uid"]);
}
foreach ($ids as $id) {
if ($phpcdb->enable_user($id)) {
$html->add(tag('p', __("Enabled user: {$id}")));
} else {
$html->add(tag('p', __("Could not enable user: {$id}")));
}
}
return message_redirect($html, "{$phpc_script}?action=admin&phpcid={$phpcid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:26,代码来源:user_enable.php
示例17: calendar_delete
function calendar_delete()
{
global $vars, $phpcdb, $phpc_script;
$html = tag('div', attributes('class="phpc-container"'));
if (empty($vars["cid"])) {
$html->add(tag('p', __('No calendar selected.')));
return $html;
}
$id = $vars["cid"];
$calendar = $phpcdb->get_calendar($id);
if (empty($calendar)) {
soft_error(__("Invalid calendar ID."));
}
if (empty($vars["confirm"])) {
$html->add(tag('p', __('Confirm you want to delete calendar:') . $calendar->get_title()));
$html->add(" [ ", create_action_link(__('Confirm'), "calendar_delete", array("cid" => $id, "confirm" => "1")), " ] ");
$html->add(" [ ", create_action_link(__('Deny'), "display_month"), " ] ");
return $html;
}
if (!$calendar->can_admin()) {
$html->add(tag('p', __("You do not have permission to remove calendar") . ": {$id}"));
return $html;
}
if ($phpcdb->delete_calendar($id)) {
$html->add(tag('p', __("Removed calendar") . ": {$id}"));
} else {
$html->add(tag('p', __("Could not remove calendar") . ": {$id}"));
}
return message_redirect($html, "{$phpc_script}?action=admin");
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:30,代码来源:calendar_delete.php
示例18: tooltip_div
/**
* Builds open div tag ready with inforamtion for tooltip.js
*
* Example:
* <code>
* <?php echo tooltip_div('my_element_id', 'css_class_for_it', array('style' => 'visibility: hidden')) ?>
* </code>
*
* @param string HTML id of the element this tooltip is for
* @param css_class CSS class to skin tooltip in (if not default)
* @param array Other attributes for the tag. You can also pass string suitable for _parse_attributes()
*
* @return string An HTML div string
*
*/
function tooltip_div($element_id, $css_class = '', $options = array())
{
$options = _parse_attributes($options);
$options['class'] = $css_class.' tooltip for_'.$element_id;
return tag('div', $options, true);
}
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:22,代码来源:TooltipHelper.php
示例19: category_delete
function category_delete()
{
global $vars, $phpcdb, $phpcid, $phpc_script;
$html = tag('div', attributes('class="phpc-container"'));
if (empty($vars["catid"])) {
return message_redirect(__('No category selected.'), "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
}
if (is_array($vars["catid"])) {
$ids = $vars["catid"];
} else {
$ids = array($vars["catid"]);
}
$categories = array();
foreach ($ids as $id) {
$categories[] = $phpcdb->get_category($id);
}
foreach ($categories as $category) {
if (empty($category['cid']) && !is_admin() || !$phpcdb->get_calendar($category['cid'])->can_admin()) {
$html->add(tag('p', __("You do not have permission to delete category: ") . $category['catid']));
continue;
}
if ($phpcdb->delete_category($category['catid'])) {
$html->add(tag('p', __("Removed category: ") . $category['catid']));
} else {
$html->add(tag('p', __("Could not remove category: ") . $category['catid']));
}
}
return message_redirect($html, "{$phpc_script}?action=cadmin&phpcid={$phpcid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:29,代码来源:category_delete.php
示例20: translate
function translate()
{
global $phpc_locale_path;
if (!is_admin()) {
permission_error(__('Need to be admin'));
exit;
}
$handle = opendir($phpc_locale_path);
if (!$handle) {
return soft_error("Error reading locale directory.");
}
$output_tag = tag('div', tag('h2', __('Translate')));
while (($filename = readdir($handle)) !== false) {
$pathname = "{$phpc_locale_path}/{$filename}";
if (strncmp($filename, ".", 1) == 0 || !is_dir($pathname)) {
continue;
}
$msgs_path = "{$pathname}/LC_MESSAGES";
$hash = parse_po_file("{$msgs_path}/messages.po");
if ($hash === FALSE) {
print nl2br("Error reading '{$msgs_path}/messages.po', aborted.\n");
} else {
$out = "{$msgs_path}/messages.mo";
write_mo_file($hash, $out);
}
$output_tag->add(tag('div', sprintf(__('Translated "%s"'), $filename)));
}
closedir($handle);
return $output_tag;
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:30,代码来源:translate.php
注:本文中的tag函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论