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


PHP TikiLib::strtoupper方法代码示例

本文整理汇总了PHP中TikiLib::strtoupper方法的典型用法代码示例。如果您正苦于以下问题:PHP TikiLib::strtoupper方法的具体用法?PHP TikiLib::strtoupper怎么用?PHP TikiLib::strtoupper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TikiLib的用法示例。


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

示例1: die

/**
 * @package tikiwiki
 */
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require 'tiki-setup.php';
if (!isset($_POST['page'], $_POST['content'], $_POST['index'], $_POST['type'], $_SERVER['HTTP_REFERER'])) {
    die('Missing parameters');
}
$page = $_POST['page'];
$plugin = strtolower(basename($_POST['type']));
$type = TikiLib::strtoupper($plugin);
if (empty($parserlib)) {
    $parserlib = TikiLib::lib('parser');
}
if (!($meta = $parserlib->plugin_info($plugin))) {
    exit;
}
if (!isset($_POST['message'])) {
    $_POST['message'] = (isset($meta['name']) ? tra($meta['name']) : $plugin) . ' ' . tra('Plugin modified by editor.');
}
$info = $tikilib->get_page_info($page);
$tikilib->get_perm_object($page, 'wiki page', $info, true);
if ($tiki_p_edit != 'y') {
    header("Location: {$_SERVER['HTTP_REFERER']}");
    exit;
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:30,代码来源:tiki-wikiplugin_edit.php

示例2: wikiplugin_dbreport_parse

function wikiplugin_dbreport_parse(&$code)
{
    global $debug, $wikiplugin_dbreport_fields_allowed;
    // code properties
    $len = strlen($code);
    $pos = 0;
    // FSM state
    $parse_state = 0;
    $parse_link_return = 0;
    $parse_line_return = 0;
    $parse_cell_return = 0;
    $parse_object;
    $parse_text;
    $parse_line;
    $parse_cell;
    $span_mode;
    unset($parse_report);
    $parse_report = new WikipluginDBReport();
    // parse the code
    while (true) {
        // get the next token
        $token = wikiplugin_dbreport_next_token($code, $len, $pos);
        $pos = $token->after;
        // repeat while we have an unconsumed token
        while (isset($token)) {
            $next_token = $token;
            switch ($parse_state) {
                case 0:
                    // next keyword
                    switch ($token->type) {
                        case 'eof':
                            if (!isset($parse_report->sql)) {
                                return wikiplugin_dbreport_parse_error($token, "Unexpected End.");
                            }
                            return $parse_report;
                            break;
                        case 'key':
                            switch (TikiLib::strtoupper($token->content)) {
                                case 'SQL':
                                    $parse_state = 1;
                                    // switch state
                                    unset($next_token);
                                    // consume the token
                                    $wikiplugin_dbreport_fields_allowed = false;
                                    // no fields in sql
                                    break;
                                case 'PARAM':
                                    // create the parameter object
                                    unset($parse_object);
                                    $parse_object = new WikipluginDBReportParameter($token);
                                    $parse_report->params[] =& $parse_object;
                                    $parse_state = 2;
                                    // switch state
                                    unset($next_token);
                                    // consume the token
                                    $wikiplugin_dbreport_fields_allowed = false;
                                    // no fields in sql params
                                    break;
                                case 'GROUP':
                                    // create the group object
                                    unset($parse_object);
                                    $parse_object = new WikipluginDBReportGroup();
                                    $parse_report->groups[] =& $parse_object;
                                    $parse_state = 3;
                                    // switch state
                                    unset($next_token);
                                    // consume the token
                                    $wikiplugin_dbreport_fields_allowed = true;
                                    // we can now parse fields
                                    break;
                                case 'TABLE':
                                    // create the table object
                                    unset($parse_object);
                                    $parse_object = new WikipluginDBReportTable();
                                    $parse_report->table =& $parse_object;
                                    $parse_state = 4;
                                    // switch state
                                    unset($next_token);
                                    // consume the token
                                    $wikiplugin_dbreport_fields_allowed = true;
                                    // we can now parse fields
                                    break;
                                case 'FAIL':
                                    // create the fail object
                                    unset($parse_object);
                                    $parse_object = new WikipluginDBReportFail();
                                    $parse_report->fail =& $parse_object;
                                    $parse_state = 10;
                                    // switch state
                                    unset($next_token);
                                    // consume the token
                                    $wikiplugin_dbreport_fields_allowed = false;
                                    // no fields in fail message
                                    break;
                                default:
                                    return wikiplugin_dbreport_parse_error($token, "Invalid keyword '{$token->content}'");
                            }
                            break;
                        default:
                            return wikiplugin_dbreport_parse_error($token, "Unexpected " . $token->type . " '" . $token->content . "' at " . $token->start);
//.........这里部分代码省略.........
开发者ID:linuxwhy,项目名称:tiki-1,代码行数:101,代码来源:wikiplugin_dbreport.php

示例3: parseColor

	/**
	 * Convert rgb() color definiton to hex color definiton
	 * 
	 * @param unknown_type $col
	 * @return The hex representation
	 */
	function parseColor(&$col)
	{
		
		if (preg_match("/^rgb\( *(\d+) *, *(\d+) *, *(\d+) *\)$/", $col, $parts) ) {
			$hex = str_pad(dechex($parts[1]), 2, '0', STR_PAD_LEFT)
			     . str_pad(dechex($parts[2]), 2, '0', STR_PAD_LEFT)
				 . str_pad(dechex($parts[3]), 2, '0', STR_PAD_LEFT);
			$hex = '#' . TikiLib::strtoupper($hex);
		} else {
			$hex = $col;
		}
		
		return $hex;
	}
开发者ID:railfuture,项目名称:tiki-website,代码行数:20,代码来源:editlib.php

示例4: validate_user_tiki

	function validate_user_tiki($user, $pass, $challenge, $response, $validate_phase = false)
	{
		global $prefs;

		// first verify that the user exists
		$query = 'select * from `users_users` where binary `login` = ?';
		$result = $this->query($query, array($user));

		if (!$result->numRows()) {
			$query = 'select * from `users_users` where upper(`login`) = ?';
			$result = $this->query($query, array(TikiLib::strtoupper($user)));

			switch ($result->numRows()) {
				case 0:
					return array(USER_NOT_FOUND, $user);

				case 1:
								break;

				default:
					return array(USER_AMBIGOUS, $user);
			}
		}


		$res = $result->fetchRow();
		$user = $res['login'];

		// next verify the password with every hashes methods
		if ($prefs['feature_challenge'] == 'n' || empty($response)) {
			if (!empty($res['valid']) && $pass == $res['valid']) // used for validation of user account before activation
				return array(USER_VALID, $user);

			if ($res['waiting'] == 'u')
				return array(ACCOUNT_WAITING_USER, $user);
			if ($res['waiting'] == 'a')
				return array(ACCOUNT_DISABLED, $user);

			if ($res['hash'] == md5($user.$pass.trim($res['email']))) // very old method md5(user.pass.email), for compatibility
				return array(USER_VALID, $user);

			if ($res['hash'] == md5($user.$pass)) // old method md5(user.pass), for compatibility
				return array(USER_VALID, $user);

			if ($res['hash'] == md5($pass)) // normal method md5(pass)
				return array(USER_VALID, $user);

			if ($this->hash_pass($pass, $res['hash']) == $res['hash']) // new method (crypt-md5) and tikihash method (md5(pass))
				return array(USER_VALID, $user);

			return array(PASSWORD_INCORRECT, $user);
		} else {
			// Use challenge-reponse method
			// Compare pass against md5(user,challenge,hash)
			$hash = $this->getOne('select `hash` from `users_users` where binary `login`=?', array($user));

			if (!isset($_SESSION["challenge"]))
				return array(false, $user);

			//print("pass: $pass user: $user hash: $hash <br />");
			//print("challenge: ".$_SESSION["challenge"]." challenge: $challenge<br />");
			//print("response : $response<br />");
			if ($response == md5($user . $hash . $_SESSION["challenge"])) {
				$this->update_lastlogin($user);
				return array(USER_VALID, $user);
			} else {
				return array(false, $user);
			}
		}

		return array(PASSWORD_INCORRECT, $user);
	}
开发者ID:railfuture,项目名称:tiki-website,代码行数:72,代码来源:userslib.php

示例5: cmpcatname

 static function cmpcatname($a, $b)
 {
     $a = TikiLib::strtoupper(TikiLib::take_away_accent($a));
     $b = TikiLib::strtoupper(TikiLib::take_away_accent($b));
     return strcmp($a, $b);
 }
开发者ID:rjsmelo,项目名称:tiki,代码行数:6,代码来源:categlib.php

示例6: convert_plugin_for_ckeditor

 private function convert_plugin_for_ckeditor($name, $args, $plugin_result, $data, $info = array())
 {
     $ck_editor_plugin = '{' . (empty($data) ? $name : TikiLib::strtoupper($name) . '(') . ' ';
     $arg_str = '';
     // not using http_build_query() as it converts spaces into +
     if (!empty($args)) {
         foreach ($args as $argKey => $argValue) {
             if (is_array($argValue)) {
                 if (isset($info['params'][$argKey]['separator'])) {
                     $sep = $info['params'][$argKey]['separator'];
                 } else {
                     $sep = ',';
                 }
                 $ck_editor_plugin .= $argKey . '="' . implode($sep, $argValue) . '" ';
                 // process array
                 $arg_str .= $argKey . '=' . implode($sep, $argValue) . '&';
             } else {
                 $ck_editor_plugin .= $argKey . '="' . $argValue . '" ';
                 $arg_str .= $argKey . '=' . $argValue . '&';
             }
         }
     }
     if (substr($ck_editor_plugin, -1) === ' ') {
         $ck_editor_plugin = substr($ck_editor_plugin, 0, -1);
     }
     if (!empty($data)) {
         $ck_editor_plugin .= ')}' . $data . '{' . TikiLib::strtoupper($name) . '}';
     } else {
         $ck_editor_plugin .= '}';
     }
     // work out if I'm a nested plugin and return empty if so
     $stack = debug_backtrace();
     $plugin_nest_level = 0;
     foreach ($stack as $st) {
         if ($st['function'] === 'parse_first') {
             $plugin_nest_level++;
             if ($plugin_nest_level > 1) {
                 return '';
             }
         }
     }
     $arg_str = rtrim($arg_str, '&');
     $icon = isset($info['icon']) ? $info['icon'] : 'img/icons/wiki_plugin_edit.png';
     // some plugins are just too flakey to do wysiwyg, so show the "source" for them ;(
     if (in_array($name, array('trackerlist', 'kaltura', 'toc', 'freetagged', 'draw', 'googlemap'))) {
         $plugin_result = '&nbsp;&nbsp;&nbsp;&nbsp;' . $ck_editor_plugin;
     } else {
         // Tiki 7+ adds ~np~ to plugin output so remove them
         $plugin_result = preg_replace('/~[\\/]?np~/ms', '', $plugin_result);
         $plugin_result = $this->parse_data($plugin_result, array('is_html' => false, 'suppress_icons' => true, 'ck_editor' => true, 'noparseplugins' => true));
         // remove hrefs and onclicks
         $plugin_result = preg_replace('/\\shref\\=/i', ' tiki_href=', $plugin_result);
         $plugin_result = preg_replace('/\\sonclick\\=/i', ' tiki_onclick=', $plugin_result);
         $plugin_result = preg_replace('/<script.*?<\\/script>/mi', '', $plugin_result);
     }
     if (!in_array($name, array('html'))) {
         // remove <p> and <br>s from non-html
         $data = str_replace(array('<p>', '</p>', "\t"), '', $data);
         $data = str_replace('<br />', "\n", $data);
     }
     if ($this->contains_html_block($plugin_result)) {
         $elem = 'div';
     } else {
         $elem = 'span';
     }
     $elem_style = 'position:relative;';
     if (in_array($name, array('img', 'div')) && preg_match('/<' . $name . '[^>]*style="(.*?)"/i', $plugin_result, $m)) {
         if (count($m)) {
             $elem_style .= $m[1];
         }
     }
     $ret = '~np~<' . $elem . ' class="tiki_plugin" plugin="' . $name . '" style="' . $elem_style . '"' . ' syntax="' . htmlentities($ck_editor_plugin, ENT_QUOTES, 'UTF-8') . '"' . ' args="' . htmlentities($arg_str, ENT_QUOTES, 'UTF-8') . '"' . ' body="' . htmlentities($data, ENT_QUOTES, 'UTF-8') . '">' . '<img src="' . $icon . '" width="16" height="16" style="float:left;position:relative;z-index:10001" />' . $plugin_result . '<!-- end tiki_plugin --></' . $elem . '>~/np~';
     return $ret;
 }
开发者ID:railfuture,项目名称:tiki-website,代码行数:74,代码来源:parserlib.php

示例7: convert_plugin_for_ckeditor

 private function convert_plugin_for_ckeditor($name, $args, $plugin_result, $data, $info = array())
 {
     $ck_editor_plugin = '{' . (empty($data) ? $name : TikiLib::strtoupper($name) . '(') . ' ';
     $arg_str = '';
     // not using http_build_query() as it converts spaces into +
     if (!empty($args)) {
         foreach ($args as $argKey => $argValue) {
             if (is_array($argValue)) {
                 if (isset($info['params'][$argKey]['separator'])) {
                     $sep = $info['params'][$argKey]['separator'];
                 } else {
                     $sep = ',';
                 }
                 $ck_editor_plugin .= $argKey . '="' . implode($sep, $argValue) . '" ';
                 // process array
                 $arg_str .= $argKey . '=' . implode($sep, $argValue) . '&';
             } else {
                 // even though args are now decoded we still need to escape double quotes
                 $argValue = addslashes($argValue);
                 $ck_editor_plugin .= $argKey . '="' . $argValue . '" ';
                 $arg_str .= $argKey . '=' . $argValue . '&';
             }
         }
     }
     if (substr($ck_editor_plugin, -1) === ' ') {
         $ck_editor_plugin = substr($ck_editor_plugin, 0, -1);
     }
     if (!empty($data)) {
         $ck_editor_plugin .= ')}' . $data . '{' . TikiLib::strtoupper($name) . '}';
     } else {
         $ck_editor_plugin .= '}';
     }
     // work out if I'm a nested plugin and return empty if so
     $stack = debug_backtrace();
     $plugin_nest_level = 0;
     foreach ($stack as $st) {
         if ($st['function'] === 'parse_first') {
             $plugin_nest_level++;
             if ($plugin_nest_level > 1) {
                 return '';
             }
         }
     }
     $arg_str = rtrim($arg_str, '&');
     $icon = isset($info['icon']) ? $info['icon'] : 'img/icons/wiki_plugin_edit.png';
     // some plugins are just too fragile to do wysiwyg, so show the "source" for them ;(
     $excluded = array('tracker', 'trackerlist', 'trackerfilter', 'kaltura', 'toc', 'freetagged', 'draw', 'googlemap', 'include', 'module', 'list', 'custom_search', 'iframe', 'map', 'calendar', 'file', 'files', 'mouseover', 'sort', 'slideshow', 'convene', 'redirect', 'galleriffic');
     $ignore = null;
     $enabled = $this->plugin_enabled($name, $ignore);
     if (in_array($name, $excluded) || !$enabled) {
         $plugin_result = '&nbsp;&nbsp;&nbsp;&nbsp;' . $ck_editor_plugin;
     } else {
         if (!isset($info['format']) || $info['format'] !== 'html') {
             $oldOptions = $this->option;
             $plugin_result = $this->parse_data($plugin_result, array('is_html' => false, 'suppress_icons' => true, 'ck_editor' => true, 'noparseplugins' => true));
             $this->setOptions($oldOptions);
             // reset the noparseplugins option, to allow for proper display in CkEditor
             $this->option['noparseplugins'] = false;
         } else {
             $plugin_result = preg_replace('/~[\\/]?np~/ms', '', $plugin_result);
             // remove no parse tags otherwise they get nested later (bad)
         }
         if (!getCookie('wysiwyg_inline_edit', 'preview', false)) {
             // remove hrefs and onclicks
             $plugin_result = preg_replace('/\\shref\\=/i', ' tiki_href=', $plugin_result);
             $plugin_result = preg_replace('/\\sonclick\\=/i', ' tiki_onclick=', $plugin_result);
             $plugin_result = preg_replace('/<script.*?<\\/script>/mi', '', $plugin_result);
             // remove hidden inputs
             $plugin_result = preg_replace('/<input.*?type=[\'"]?hidden[\'"]?.*>/mi', '', $plugin_result);
         }
     }
     if (!in_array($name, array('html'))) {
         // remove <p> and <br>s from non-html
         $data = str_replace(array('<p>', '</p>', "\t"), '', $data);
         $data = str_replace('<br />', "\n", $data);
     }
     if ($this->contains_html_block($plugin_result)) {
         $elem = 'div';
     } else {
         $elem = 'span';
     }
     $elem_style = 'position:relative;';
     if (!$enabled) {
         $elem_style .= 'opacity:0.3;';
     }
     if (in_array($name, array('img', 'div')) && preg_match('/<' . $name . '[^>]*style="(.*?)"/i', $plugin_result, $m)) {
         if (count($m)) {
             $elem_style .= $m[1];
         }
     }
     $ret = '~np~<' . $elem . ' contenteditable="false" unselectable="on" class="tiki_plugin" data-plugin="' . $name . '" style="' . $elem_style . '"' . ' data-syntax="' . htmlentities($ck_editor_plugin, ENT_QUOTES, 'UTF-8') . '"' . ' data-args="' . htmlentities($arg_str, ENT_QUOTES, 'UTF-8') . '"' . ' data-body="' . htmlentities($data, ENT_QUOTES, 'UTF-8') . '">' . '<img src="' . $icon . '" width="16" height="16" class="plugin_icon" />' . $plugin_result . '<!-- end tiki_plugin --></' . $elem . '>~/np~';
     return $ret;
 }
开发者ID:ameoba32,项目名称:tiki,代码行数:93,代码来源:parserlib.php

示例8: get_plugin_description

 public function get_plugin_description($name, &$enabled, $area_id = 'editwiki')
 {
     $tikilib = TikiLib::lib('tiki');
     $parserlib = TikiLib::lib('parser');
     if (!($info = $parserlib->plugin_info($name)) && $parserlib->plugin_exists($name, true)) {
         $enabled = true;
         $func_name = "wikiplugin_{$name}_help";
         if (!function_exists($func_name)) {
             return false;
         }
         $ret = $func_name();
         return $tikilib->parse_data($ret);
     } else {
         $smarty = TikiLib::lib('smarty');
         $enabled = true;
         $ret = $info;
         if (isset($ret['prefs'])) {
             global $prefs;
             // If the plugin defines required preferences, they should all be to 'y'
             foreach ($ret['prefs'] as $pref) {
                 if (!isset($prefs[$pref]) || $prefs[$pref] != 'y') {
                     $enabled = false;
                     return;
                 }
             }
         }
         if (isset($ret['documentation']) && ctype_alnum($ret['documentation'])) {
             $ret['documentation'] = "http://doc.tiki.org/{$ret['documentation']}";
         }
         $smarty->assign('area_id', $area_id);
         $smarty->assign('plugin', $ret);
         $smarty->assign('plugin_name', TikiLib::strtoupper($name));
         return $smarty->fetch('tiki-plugin_help.tpl');
     }
 }
开发者ID:ameoba32,项目名称:tiki,代码行数:35,代码来源:wikilib.php

示例9: other_user_has_email

 function other_user_has_email($user, $email)
 {
     $query = 'select `login` from `users_users` where upper(`email`)=? and `login`!=?';
     $pass = $this->getOne($query, array(TikiLib::strtoupper($email), $user));
     return $pass;
 }
开发者ID:rjsmelo,项目名称:tiki,代码行数:6,代码来源:userslib.php


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