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


PHP io::strtoupper方法代码示例

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


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

示例1: formatBytes

function formatBytes($val, $digits = 3, $mode = "SI", $bB = "B")
{
    $si = array("", "K", "M", "G", "T", "P", "E", "Z", "Y");
    $iec = array("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi");
    switch (io::strtoupper($mode)) {
        case "SI":
            $factor = 1000;
            $symbols = $si;
            break;
        case "IEC":
            $factor = 1024;
            $symbols = $iec;
            break;
        default:
            $factor = 1000;
            $symbols = $si;
            break;
    }
    switch ($bB) {
        case "b":
            $val *= 8;
            break;
        default:
            $bB = "B";
            break;
    }
    for ($i = 0; $i < count($symbols) - 1 && $val >= $factor; $i++) {
        $val /= $factor;
    }
    $p = io::strpos($val, ".");
    if ($p !== false && $p > $digits) {
        $val = round($val);
    } elseif ($p !== false) {
        $val = round($val, $digits - $p);
    }
    return round($val, $digits) . " " . $symbols[$i] . $bB;
}
开发者ID:davidmottet,项目名称:automne,代码行数:37,代码来源:templates-files-nodes.php

示例2: getDefaultLanguageCodename

 /** 
  * Get the default language code for this module
  * Comes from parameters or Constant
  * Upgrades constant with parameter found
  *
  * @return String the language codename
  * @access public
  */
 function getDefaultLanguageCodename()
 {
     if (!defined("MOD_" . io::strtoupper($this->getCodename()) . "_DEFAULT_LANGUAGE")) {
         $polymodLanguages = CMS_object_i18nm::getAvailableLanguages();
         define("MOD_" . io::strtoupper($this->getCodename()) . "_DEFAULT_LANGUAGE", $polymodLanguages[0]);
     }
     return constant("MOD_" . io::strtoupper($this->getCodename()) . "_DEFAULT_LANGUAGE");
 }
开发者ID:davidmottet,项目名称:automne,代码行数:16,代码来源:modulePolymodValidation.php

示例3: _formRequirementsTag

    /**
     * Compute an atm-form-required or atm-form-malformed tag
     *
     * @param array $tag : the reference atm-form-required or atm-form-malformed tag to compute
     * @return string the PHP / HTML content computed
     * @access private
     */
    protected function _formRequirementsTag(&$tag)
    {
        //check tags requirements
        if (!$this->checkTagRequirements($tag, array('form' => 'alphanum'))) {
            return;
        }
        $tagType = $tag['nodename'] == 'atm-form-required' ? 'required' : 'malformed';
        $uniqueID = CMS_XMLTag::getUniqueID();
        $return = '
		//FORM ' . io::strtoupper($tagType) . ' TAG START ' . $uniqueID . '
		if (isset($polymodFormsError[\'' . $tag['attributes']['form'] . '\'][\'' . $tagType . '\'])) {
			$object_' . $uniqueID . ' = $object[$objectDefinition_' . $tag['attributes']['form'] . ']; //save previous object search if any
			$replace_' . $uniqueID . ' = $replace; //save previous replace vars if any
			$count_' . $uniqueID . ' = 0;
			$content_' . $uniqueID . ' = $content; //save previous content var if any
			$max' . $tagType . ' = sizeof($polymodFormsError[\'' . $tag['attributes']['form'] . '\'][\'' . $tagType . '\']);
			foreach ($polymodFormsError[\'' . $tag['attributes']['form'] . '\'][\'' . $tagType . '\'] as $' . $tagType . 'FieldID) {
				$content = "";
				$replace["atm-form-' . $tagType . '"] = array (
					"{first' . $tagType . '}" => (!$count_' . $uniqueID . ') ? 1 : 0,
					"{last' . $tagType . '}" 	=> ($count_' . $uniqueID . ' == sizeof($polymodFormsError[\'' . $tag['attributes']['form'] . '\'][\'' . $tagType . '\'])-1) ? 1 : 0,
					"{' . $tagType . 'count}" => ($count_' . $uniqueID . '+1),
					"{max' . $tagType . '}" 	=> $max' . $tagType . ',
					"{' . $tagType . 'name}" 	=> $object_' . $uniqueID . '->objectValues($' . $tagType . 'FieldID)->getFieldLabel($cms_language),
					"{' . $tagType . 'field}" 	=> $' . $tagType . 'FieldID,
				);
				' . $this->computeTags($tag['childrens']) . '
				$count_' . $uniqueID . '++;
				//do all result vars replacement
				$content_' . $uniqueID . '.= CMS_polymod_definition_parsing::replaceVars($content, $replace);
			}
			$content = $content_' . $uniqueID . '; //retrieve previous content var if any
			unset($content_' . $uniqueID . ');
			$replace = $replace_' . $uniqueID . '; //retrieve previous replace vars if any
			unset($replace_' . $uniqueID . ');
		}
		//FORM ' . io::strtoupper($tagType) . ' TAG END ' . $uniqueID . '
		';
        return $return;
    }
开发者ID:davidmottet,项目名称:automne,代码行数:47,代码来源:poly_definition_parsing.php

示例4: getDefaultLanguageCodename

 /**
  * Get the default language code for this module
  * Comes from parameters or Constant
  * Upgrades constant with parameter found
  *
  * @return String the language codename
  * @access public
  */
 function getDefaultLanguageCodename()
 {
     if ($this->hasParameters() && ($s = $this->getParameters(io::strtolower("default_language")))) {
         define("MOD_" . io::strtoupper($this->getCodename()) . "_DEFAULT_LANGUAGE", io::strtolower($s));
     } else {
         define("MOD_" . io::strtoupper($this->getCodename()) . "_DEFAULT_LANGUAGE", APPLICATION_DEFAULT_LANGUAGE);
     }
     return constant("MOD_" . io::strtoupper($this->getCodename()) . "_DEFAULT_LANGUAGE");
 }
开发者ID:davidmottet,项目名称:automne,代码行数:17,代码来源:module.php

示例5: foreach

//This file is an admin file. Interface must be secure
$view->setSecure();
//check user rights
if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITUSERS)) {
    CMS_grandFather::raiseError('User has no users management rights ...');
    $view->show();
}
//get records / pages
$recordsPerPage = CMS_session::getRecordsPerPage();
//groups letters
$letters = CMS_profile_usersGroupsCatalog::getLettersForTitle();
//$letters = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$lettersButtons = '';
foreach ($letters as $letter) {
    $lettersButtons .= '{
		text:			\'' . io::strtoupper($letter) . '\',
		enableToggle:	true,
		handler:		clickLetter
	},';
}
//remove last comma
$lettersButtons = io::substr($lettersButtons, 0, -1);
$jscontent = <<<END
\tvar groupsWindow = Ext.getCmp('{$winId}');
\tvar fatherWindow = Ext.getCmp('{$fatherId}');
\t
\t//groups store
\tvar store = new Automne.JsonStore({
\t\turl: \t\t\t'groups-datas.php',
\t\troot: \t\t\t'groups',
\t\ttotalProperty:\t'totalCount',
开发者ID:davidmottet,项目名称:automne,代码行数:31,代码来源:groups.php

示例6: getModuleValidationLabel

 /** 
  * Get the module message constants
  *
  * @param string, the constant name to get
  * @return the constant value
  * @access public
  */
 function getModuleValidationLabel($label)
 {
     $labels = array("edition" => constant("MESSAGE_MOD_" . io::strtoupper($this->getCodename()) . "_VALIDATION_EDITION"), "editionOfResource" => constant("MESSAGE_MOD_" . io::strtoupper($this->getCodename()) . "_VALIDATION_EDITION_OFRESOURCE"), "URLPreviz" => constant("MESSAGE_MOD_" . io::strtoupper($this->getCodename()) . "_URL_PREVIZ"), "locationChange" => constant("MESSAGE_MOD_" . io::strtoupper($this->getCodename()) . "_VALIDATION_LOCATIONCHANGE"), "locationChangeOfResource" => constant("MESSAGE_MOD_" . io::strtoupper($this->getCodename()) . "_VALIDATION_LOCATIONCHANGE_OFRESOURCE"));
     if ($labels[$label]) {
         return $labels[$label];
     } else {
         $this->raiseError("Unknown label or constant not set : " . $label);
         return false;
     }
 }
开发者ID:davidmottet,项目名称:automne,代码行数:17,代码来源:moduleValidation.php

示例7: treatWantedTag


//.........这里部分代码省略.........
             switch ($tag->getName()) {
                 case "atm-main-url":
                     return CMS_websitesCatalog::getMainURL();
                     break;
                 case "atm-keywords":
                     return '<meta name="keywords" content="' . SensitiveIO::sanitizeHTMLString($treatedObject->getKeywords($visualizationMode == PAGE_VISUALMODE_HTML_PUBLIC)) . '" />';
                     break;
                 case "atm-description":
                     return '<meta name="description" content="' . SensitiveIO::sanitizeHTMLString($treatedObject->getDescription($visualizationMode == PAGE_VISUALMODE_HTML_PUBLIC)) . '" />';
                     break;
                 case "atm-last-update":
                     $lastlog = CMS_log_catalog::getByResourceAction(MOD_STANDARD_CODENAME, $treatedObject->getID(), array(CMS_log::LOG_ACTION_RESOURCE_SUBMIT_DRAFT, CMS_log::LOG_ACTION_RESOURCE_DIRECT_VALIDATION), 1);
                     if (!$lastlog || !is_object($lastlog[0])) {
                         return '';
                     }
                     $user = $lastlog[0]->getUser();
                     $date = $lastlog[0]->getDateTime();
                     $dateformat = $tag->getAttribute("format") ? $tag->getAttribute("format") : 'Y-m-d';
                     $replace = array('{{date}}' => date($dateformat, $date->getTimestamp()), '{{firstname}}' => $user->getFirstName(), '{{lastname}}' => $user->getLastName());
                     return str_replace(array_keys($replace), $replace, $tag->getInnerContent());
                     break;
                 case "atm-print-link":
                     if ($treatedObject->getPrintStatus()) {
                         $template = $tag->getInnerContent();
                         if ($tag->getAttribute("keeprequest") == 'true') {
                             return '<?php echo \'' . str_replace("{{href}}", $treatedObject->getURL(true) . '\'.($_SERVER["QUERY_STRING"] ? \'?\'.$_SERVER["QUERY_STRING"] : \'\').\'', str_replace("\\\\'", "\\'", str_replace("'", "\\'", $template))) . '\' ?>';
                         } else {
                             return str_replace("{{href}}", $treatedObject->getURL(true), $template);
                         }
                     }
                     return '';
                     break;
                 case "atm-constant":
                     $const = SensitiveIO::stripPHPTags(io::strtoupper($tag->getAttribute("name")));
                     if (defined($const)) {
                         return constant($const);
                     }
                     return '';
                     break;
                 case "head":
                     $headCode = '<?php' . "\n" . '$atmHost = null;' . "\n" . '$atmPort = null;' . "\n" . 'if(isset($_SERVER["HTTP_HOST"])) {' . "\n" . '	$atmHost = @parse_url($_SERVER["HTTP_HOST"], PHP_URL_HOST) ? @parse_url($_SERVER["HTTP_HOST"], PHP_URL_HOST) : $_SERVER["HTTP_HOST"];' . "\n" . '	$atmPort = @parse_url($_SERVER[\'HTTP_HOST\'], PHP_URL_PORT) ? \':\'.@parse_url($_SERVER[\'HTTP_HOST\'], PHP_URL_PORT) : \'\';' . "\n" . '}' . "\n" . 'echo "\\t".\'<base href="//\'.$atmHost.$atmPort.PATH_REALROOT_WR.\'/" />\'."\\n";' . "\n" . ' ?>';
                     //Append base code
                     return preg_replace('#<head([^>]*)>#', '<head\\1>' . "\n" . $headCode, $tag->getContent());
                     break;
                 case "body":
                     $statsCode = '<?php if (SYSTEM_DEBUG && STATS_DEBUG) {echo CMS_stats::view();} ?>';
                     //Append stats code
                     return preg_replace('#</body>$#', $statsCode . "\n" . '</body>', $tag->getContent());
                     break;
                 case "html":
                     //Append DTD
                     return '<?php if (defined(\'APPLICATION_XHTML_DTD\')) echo APPLICATION_XHTML_DTD."\\n"; ?>' . "\n" . $tag->getContent();
                     break;
             }
             return '';
             break;
         case MODULE_TREATMENT_PAGEHEADER_TAGS:
             if (!$treatedObject instanceof CMS_page) {
                 $this->raiseError('$treatedObject must be a CMS_page object');
                 return false;
             }
             switch ($tag->getName()) {
                 case "atm-linx":
                     if ($visualizationMode == PAGE_VISUALMODE_CLIENTSPACES_FORM || $visualizationMode == PAGE_VISUALMODE_FORM) {
                         //direct linx are visible even if target pages are not published (edited tree)
                         //all other linx are only visible if they are published (public tree)
开发者ID:davidmottet,项目名称:automne,代码行数:67,代码来源:standard.php


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