本文整理汇总了PHP中StringUtil类的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil类的具体用法?PHP StringUtil怎么用?PHP StringUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StringUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getStaticStrings
/**
* Loads all the static strings from either the cache or the ini files. Note that ini files in modules are not verified for outdatedness, so if they were updated, just clear all the caches or hard reload a page
* This method should not be called directly from outsite TranslationPeer except for testing and debugging purposes
*/
public static function getStaticStrings($sLanguageId)
{
if (!isset(self::$STATIC_STRINGS[$sLanguageId])) {
$oCache = new Cache($sLanguageId, DIRNAME_LANG);
$aLanguageFiles = ResourceFinder::create()->addPath(DIRNAME_LANG, "{$sLanguageId}.ini")->all()->baseFirst()->find();
if ($oCache->entryExists() && !$oCache->isOutdated($aLanguageFiles)) {
self::$STATIC_STRINGS[$sLanguageId] = $oCache->getContentsAsVariable();
} else {
self::$STATIC_STRINGS[$sLanguageId] = array();
//Get default strings
foreach ($aLanguageFiles as $sLanguageFile) {
self::$STATIC_STRINGS[$sLanguageId] = array_merge(self::$STATIC_STRINGS[$sLanguageId], parse_ini_file($sLanguageFile));
}
//Get strings for modules
foreach (ResourceFinder::create()->addExpression(DIRNAME_MODULES, ResourceFinder::ANY_NAME_OR_TYPE_PATTERN, ResourceFinder::ANY_NAME_OR_TYPE_PATTERN, DIRNAME_LANG, "{$sLanguageId}.ini")->all()->baseFirst()->find() as $sLanguageFile) {
self::$STATIC_STRINGS[$sLanguageId] = array_merge(self::$STATIC_STRINGS[$sLanguageId], parse_ini_file($sLanguageFile));
}
//Fix string encoding
foreach (self::$STATIC_STRINGS[$sLanguageId] as $sStringKey => $sValue) {
self::$STATIC_STRINGS[$sLanguageId][$sStringKey] = StringUtil::encodeForDbFromFile($sValue);
}
$oCache->setContents(self::$STATIC_STRINGS[$sLanguageId]);
}
}
return self::$STATIC_STRINGS[$sLanguageId];
}
开发者ID:rapila,项目名称:cms-base,代码行数:30,代码来源:TranslationPeer.php
示例2: getOptionsForUser
/**
* Returns the image sizes for the given user suitable for widgets.
*
* @param BackendUser $user
*
* @return array
*/
public function getOptionsForUser(BackendUser $user)
{
$this->loadOptions();
$event = new ImageSizesEvent($user->isAdmin ? $this->options : $this->filterOptions(\StringUtil::deserialize($user->imageSizes, true)), $user);
$this->eventDispatcher->dispatch(ContaoCoreEvents::IMAGE_SIZES_USER, $event);
return $event->getImageSizes();
}
开发者ID:qzminski,项目名称:contao-core-bundle,代码行数:14,代码来源:ImageSizes.php
示例3: readParameters
/**
* @see Page::readParameters()
*/
public function readParameters()
{
parent::readParameters();
if (isset($_REQUEST['q'])) {
$this->input = StringUtil::trim($_REQUEST['q']);
}
}
开发者ID:Biggerskimo,项目名称:WOT-Game,代码行数:10,代码来源:MessageUserSuggestPage.class.php
示例4: sanitize
/**
* Elimina acento y reemplaza espacio con '-'
*
* @param String word
*/
public static function sanitize($word)
{
$word = StringUtil::eliminateUnwantedChars($word);
$word = str_replace(" ", "-", $word);
$word = strtolower($word);
return $word;
}
开发者ID:Kenneth058,项目名称:adminclubinnova,代码行数:12,代码来源:UrlSanitizer.php
示例5: actionIndex
public function actionIndex()
{
if (isset($_GET["pagesize"])) {
$this->setListPageSize($_GET["pagesize"]);
}
$key = StringUtil::filterCleanHtml(EnvUtil::getRequest("keyword"));
$fields = array("frp.runid", "frp.processid", "frp.flowprocess", "frp.flag", "frp.opflag", "frp.processtime", "ft.freeother", "ft.flowid", "ft.name as typeName", "ft.type", "ft.listfieldstr", "fr.name as runName", "fr.beginuser", "fr.begintime", "fr.endtime", "fr.focususer");
$sort = "frp.processtime";
$group = "frp.runid";
$condition = array("and", "fr.delflag = 0", "frp.childrun = 0", sprintf("frp.uid = %d", $this->uid), sprintf("FIND_IN_SET(fr.focususer,'%s')", $this->uid));
if ($key) {
$condition[] = array("like", "fr.runid", "%{$key}%");
$condition[] = array("or like", "fr.name", "%{$key}%");
}
$count = Ibos::app()->db->createCommand()->select("count(*) as count")->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->group($group)->queryScalar();
$pages = PageUtil::create($count, $this->getListPageSize());
if ($key && $count) {
$pages->params = array("keyword" => $key);
}
$offset = $pages->getOffset();
$limit = $pages->getLimit();
$list = Ibos::app()->db->createCommand()->select($fields)->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->order($sort)->group($group)->offset($offset)->limit($limit)->queryAll();
$data = array_merge(array("pages" => $pages), $this->handleList($list));
$this->setPageTitle(Ibos::lang("My focus"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang(Ibos::lang("My focus")), "url" => $this->createUrl("focus/index")), array("name" => Ibos::lang("List"))));
$this->render("index", $data);
}
开发者ID:AxelPanda,项目名称:ibos,代码行数:27,代码来源:FocusController.php
示例6: actionEdit
public function actionEdit()
{
if (EnvUtil::submitCheck("emailSubmit")) {
$setting = array();
foreach ($this->_fields as $field) {
if (array_key_exists($field, $_POST)) {
$setting[$field] = intval($_POST[$field]);
} else {
$setting[$field] = 0;
}
}
$roles = array();
if (isset($_POST["role"])) {
foreach ($_POST["role"] as $role) {
if (!empty($role["positionid"]) && !empty($role["size"])) {
$positionId = StringUtil::getId($role["positionid"]);
$roles[implode(",", $positionId)] = intval($role["size"]);
}
}
}
$setting["emailroleallocation"] = serialize($roles);
foreach ($setting as $key => $value) {
Setting::model()->updateSettingValueByKey($key, $value);
}
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
}
开发者ID:AxelPanda,项目名称:ibos,代码行数:28,代码来源:DashboardController.php
示例7: compile
/**
* Generate the module
*/
protected function compile()
{
$this->Template->src = $this->singleSRC;
$this->Template->href = $this->source == 'external' ? $this->url : $this->singleSRC;
$this->Template->alt = $this->altContent;
$this->Template->var = 'swf' . $this->id;
$this->Template->transparent = $this->transparent ? true : false;
$this->Template->interactive = $this->interactive ? true : false;
$this->Template->flashId = $this->flashID ?: 'swf_' . $this->id;
$this->Template->fsCommand = ' ' . preg_replace('/[\\n\\r]/', "\n ", \StringUtil::decodeEntities($this->flashJS));
$this->Template->flashvars = 'URL=' . \Environment::get('base');
$this->Template->version = $this->version ?: '6.0.0';
$size = \StringUtil::deserialize($this->size);
$this->Template->width = $size[0];
$this->Template->height = $size[1];
$intMaxWidth = TL_MODE == 'BE' ? 320 : \Config::get('maxImageWidth');
// Adjust movie size
if ($intMaxWidth > 0 && $size[0] > $intMaxWidth) {
$this->Template->width = $intMaxWidth;
$this->Template->height = floor($intMaxWidth * $size[1] / $size[0]);
}
if (strlen($this->flashvars)) {
$this->Template->flashvars .= '&' . \StringUtil::decodeEntities($this->flashvars);
}
}
开发者ID:contao,项目名称:core-bundle,代码行数:28,代码来源:ModuleFlash.php
示例8: testGetByContentTypeReturnsDefaultWithNoneSet
/**
* @depends testGetByContentTypeReturnsNullWithNoneSetAndNoDefault
*/
public function testGetByContentTypeReturnsDefaultWithNoneSet()
{
$isHtmlContent = false;
$unsubscribeUrlPlaceHolder = static::resolveUnsubscribeMergeTagContent($isHtmlContent);
$manageSubscriptionsUrlPlaceHolder = static::resolveManageSubscriptionMergeTagContent($isHtmlContent);
$recipientMention = 'This email was sent to [[PRIMARY^EMAIL]].';
StringUtil::prependNewLine($unsubscribeUrlPlaceHolder, $isHtmlContent);
StringUtil::prependNewLine($manageSubscriptionsUrlPlaceHolder, $isHtmlContent);
StringUtil::prependNewLine($recipientMention, $isHtmlContent);
$defaultFooter = $unsubscribeUrlPlaceHolder . $manageSubscriptionsUrlPlaceHolder . $recipientMention;
$plainTextFooter = GlobalMarketingFooterUtil::getContentByType($isHtmlContent);
$this->assertNotNull($plainTextFooter);
$this->assertEquals($defaultFooter, $plainTextFooter);
$isHtmlContent = true;
$unsubscribeUrlPlaceHolder = static::resolveUnsubscribeMergeTagContent($isHtmlContent);
$manageSubscriptionsUrlPlaceHolder = static::resolveManageSubscriptionMergeTagContent($isHtmlContent);
$recipientMention = 'This email was sent to [[PRIMARY^EMAIL]].';
StringUtil::prependNewLine($unsubscribeUrlPlaceHolder, $isHtmlContent);
StringUtil::prependNewLine($manageSubscriptionsUrlPlaceHolder, $isHtmlContent);
StringUtil::prependNewLine($recipientMention, $isHtmlContent);
$defaultFooter = $unsubscribeUrlPlaceHolder . $manageSubscriptionsUrlPlaceHolder . $recipientMention;
$richTextFooter = GlobalMarketingFooterUtil::getContentByType($isHtmlContent);
$this->assertNotNull($richTextFooter);
$this->assertEquals($defaultFooter, $richTextFooter);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:28,代码来源:GlobalMarketingFooterUtilTest.php
示例9: save
/**
* @see Form::save()
*/
public function save()
{
parent::save();
// send content type
header('Content-Type: text/' . $this->fileType . '; charset=' . CHARSET);
header('Content-Disposition: attachment; filename="export.' . $this->fileType . '"');
if ($this->fileType == 'xml') {
echo "<?xml version=\"1.0\" encoding=\"" . CHARSET . "\"?>\n<addresses>\n";
}
// get users
$sql = "SELECT\t\temail\n\t\t\tFROM\t\twcf" . WCF_N . "_user\n\t\t\tWHERE\t\tuserID IN (" . $this->userIDs . ")\n\t\t\tORDER BY\temail";
$result = WCF::getDB()->sendQuery($sql);
$i = 0;
$j = WCF::getDB()->countRows($result) - 1;
while ($row = WCF::getDB()->fetchArray($result)) {
if ($this->fileType == 'xml') {
echo "<address><![CDATA[" . StringUtil::escapeCDATA($row['email']) . "]]></address>\n";
} else {
echo $this->textSeparator . $row['email'] . $this->textSeparator . ($i < $j ? $this->separator : '');
}
$i++;
}
if ($this->fileType == 'xml') {
echo "</addresses>";
}
UserEditor::unmarkAll();
$this->saved();
exit;
}
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:32,代码来源:UserEmailAddressExportForm.class.php
示例10: loadTodo
private function loadTodo($num = 4)
{
$uid = Ibos::app()->user->uid;
$fields = array("frp.runid", "frp.processid", "frp.flowprocess", "ft.type", "frp.flag", "ft.flowid", "fr.name as runName", "fr.beginuser", "fr.focususer");
$condition = array("and", "fr.delflag = 0", "frp.childrun = 0", sprintf("frp.uid = %d", $uid));
$condition[] = array("in", "frp.flag", array(1, 2));
$sort = "frp.createtime DESC";
$group = "frp.id";
$runProcess = Ibos::app()->db->createCommand()->select($fields)->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->order($sort)->group($group)->offset(0)->limit($num)->queryAll();
$allProcess = FlowProcess::model()->fetchAllProcessSortByFlowId();
foreach ($runProcess as &$run) {
$run["user"] = User::model()->fetchByUid($run["beginuser"]);
if ($run["type"] == 1) {
if (isset($allProcess[$run["flowid"]][$run["flowprocess"]]["name"])) {
$run["stepname"] = $allProcess[$run["flowid"]][$run["flowprocess"]]["name"];
} else {
$run["stepname"] = Ibos::lang("Process steps already deleted", "workflow.default");
}
} else {
$run["stepname"] = Ibos::lang("Step", "", array("{step}" => $run["processid"]));
}
$run["focus"] = StringUtil::findIn($uid, $run["focususer"]);
$param = array("runid" => $run["runid"], "flowid" => $run["flowid"], "processid" => $run["processid"], "flowprocess" => $run["flowprocess"]);
$run["key"] = WfCommonUtil::param($param);
}
return $runProcess;
}
开发者ID:AxelPanda,项目名称:ibos,代码行数:27,代码来源:WorkflowApi.php
示例11: cutText
/**
* Cuts the given text to a specific lenght and adds ... at the and
*
* @param string $_text
* @param int $_lenght
* @param bool $_isFoldable (for unfolding / folding longer texts)
* @return string
*/
public static function cutText($_text, $_length, $_isFoldable = false)
{
$_text = strip_tags($_text);
if (function_exists("mb_strlen")) {
$length = mb_strlen($_text, "utf-8");
} else {
$length = strlen($_text);
}
if ($length > $_length) {
$cutLength = max(1, $_length - 3);
if (function_exists("mb_substr")) {
$text = mb_substr($_text, 0, $cutLength, "utf-8");
$textRest = mb_substr($_text, $cutLength, mb_strlen($_text, "utf-8"), "utf-8");
} else {
$text = substr($_text, 0, $cutLength);
$textRest = substr($_text, $cutLength);
}
if (!$_isFoldable) {
$text .= "...";
} else {
$id = "more_" . StringUtil::getRandom(5);
$text .= " " . "<a style=\"text-decoration: none; font-size: 0.8em;\" id=\"show_" . $id . "\" href=" . CURRENT_PAGE_QS . "/# onclick=\"getById('" . $id . "').style.display = 'inline'; showHide('show_" . $id . "'); showHide('hide_" . $id . "'); return false;\">(" . Lang::get("global.w.more") . ")</a>" . "<b style=\"margin: 0px; font-weight: normal; display: none;\" id=\"" . $id . "\">" . $textRest . "</b>" . "<a style=\"text-decoration: none; font-size: 0.8em; float: left; display: none;\" id=\"hide_" . $id . "\" href=" . CURRENT_PAGE_QS . "/# onclick=\"getById('" . $id . "').style.display = 'none'; showHide('hide_" . $id . "'); showHide('show_" . $id . "'); return false;\">(" . Lang::get("global.w.less") . ")</a>";
}
return $text;
} else {
return $_text;
}
}
开发者ID:cebe,项目名称:chive,代码行数:36,代码来源:StringUtil.php
示例12: compile
/**
* Generate the content element
*/
protected function compile()
{
/** @var \PageModel $objPage */
global $objPage;
// Clean RTE output
if ($objPage->outputFormat == 'xhtml') {
$this->text = \StringUtil::toXhtml($this->text);
} else {
$this->text = \StringUtil::toHtml5($this->text);
}
$this->Template->text = \StringUtil::encodeEmail($this->text);
$this->Template->addImage = false;
// Add an image
if ($this->addImage && $this->singleSRC != '') {
$objModel = \FilesModel::findByUuid($this->singleSRC);
if ($objModel === null) {
if (!\Validator::isUuid($this->singleSRC)) {
$this->Template->text = '<p class="error">' . $GLOBALS['TL_LANG']['ERR']['version2format'] . '</p>';
}
} elseif (is_file(TL_ROOT . '/' . $objModel->path)) {
$this->singleSRC = $objModel->path;
$this->addImageToTemplate($this->Template, $this->arrData);
}
}
$classes = deserialize($this->mooClasses);
$this->Template->toggler = $classes[0] ?: 'toggler';
$this->Template->accordion = $classes[1] ?: 'accordion';
$this->Template->headlineStyle = $this->mooStyle;
$this->Template->headline = $this->mooHeadline;
}
开发者ID:bytehead,项目名称:contao-core,代码行数:33,代码来源:ContentAccordion.php
示例13: getOutput
/**
* @see UserOptionOutput::getOutput()
*/
public function getOutput(User $user, $optionData, $value)
{
if (empty($value) || $value == '0') {
$value = 0.0;
}
return StringUtil::formatDouble($value, 2);
}
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:10,代码来源:UserOptionOutputFloat.class.php
示例14: geturl
function geturl()
{
$phpself = getscripturl();
$isHTTPS = isset($_SERVER["HTTPS"]) && strtolower($_SERVER["HTTPS"]) != "off" ? true : false;
$url = StringUtil::ihtmlSpecialChars("http" . ($isHTTPS ? "s" : "") . "://" . $_SERVER["HTTP_HOST"] . $phpself);
return $url;
}
开发者ID:AxelPanda,项目名称:ibos,代码行数:7,代码来源:open.php
示例15: readParameters
/**
* @see Action::readParameters()
*/
public function readParameters()
{
parent::readParameters();
if (!MODULE_MODERATED_USER_GROUP || !MODULE_PM) {
throw new IllegalLinkException();
}
if (isset($_POST['groupID'])) {
$this->groupID = intval($_POST['groupID']);
}
$this->group = new Group($this->groupID);
if (!$this->group->groupID) {
throw new IllegalLinkException();
}
// check permission
if (!GroupApplicationEditor::isGroupLeader(WCF::getUser(), $this->groupID)) {
throw new PermissionDeniedException();
}
if (isset($_POST['subject'])) {
$this->subject = StringUtil::trim($_POST['subject']);
}
if (isset($_POST['text'])) {
$this->text = StringUtil::trim($_POST['text']);
}
if (empty($this->subject) || empty($this->text)) {
throw new IllegalLinkException();
}
}
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:30,代码来源:UserGroupPMAction.class.php
示例16: getData
/**
* @see CacheBuilder::getData()
*/
public function getData($cacheResource)
{
list($cache, $packageID) = explode('-', $cacheResource['cache']);
$data = array('actions' => array('user' => array(), 'admin' => array()), 'inheritedActions' => array('user' => array(), 'admin' => array()));
// get all listeners and filter options with low priority
$sql = "SELECT\t\tlistener.*, package.packageDir\n\t\t\tFROM\t\twcf" . WCF_N . "_package_dependency package_dependency,\n\t\t\t\t\twcf" . WCF_N . "_event_listener listener\n\t\t\tLEFT JOIN\twcf" . WCF_N . "_package package\n\t\t\tON\t\t(package.packageID = listener.packageID)\n\t\t\tWHERE \t\tlistener.packageID = package_dependency.dependency\n\t\t\t\t\tAND package_dependency.packageID = " . $packageID . "\n\t\t\tORDER BY\tpackage_dependency.priority";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
$row['listenerClassName'] = StringUtil::getClassName($row['listenerClassFile']);
// distinguish between inherited actions and non-inherited actions
if (!$row['inherit']) {
$data['actions'][$row['environment']][EventHandler::generateKey($row['eventClassName'], $row['eventName'])][] = $row;
} else {
if (!isset($data['inheritedActions'][$row['environment']][$row['eventClassName']])) {
$data['inheritedActions'][$row['eventClassName']] = array();
}
$data['inheritedActions'][$row['environment']][$row['eventClassName']][$row['eventName']][] = $row;
}
}
// sort data by class name
foreach ($data['actions'] as $environment => $listenerMap) {
foreach ($listenerMap as $key => $listeners) {
uasort($data['actions'][$environment][$key], array('CacheBuilderEventListener', 'sortListeners'));
}
}
foreach ($data['inheritedActions'] as $environment => $listenerMap) {
foreach ($listenerMap as $class => $listeners) {
foreach ($listeners as $key => $val) {
uasort($data['inheritedActions'][$environment][$class][$key], array('CacheBuilderEventListener', 'sortListeners'));
}
}
}
return $data;
}
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:37,代码来源:CacheBuilderEventListener.class.php
示例17: __construct
public function __construct($data, $boxname = "")
{
$this->TopData['templatename'] = "topthreads";
$this->getBoxStatus($data);
$this->TopData['boxID'] = $data['boxID'];
if (!defined('TOPTHREADS_COUNT')) {
define('TOPTHREADS_COUNT', 10);
}
if (!defined('TOPTHREADS_TITLELENGTH')) {
define('TOPTHREADS_TITLELENGTH', 25);
}
if (!defined('TOPTHREADS_SBCOLOR_ACP')) {
define('TOPTHREADS_SBCOLOR_ACP', 2);
}
require_once WBB_DIR . 'lib/data/board/Board.class.php';
$boardIDs = Board::getAccessibleBoards();
if (!empty($boardIDs)) {
$sql = "SELECT thread.*" . "\n FROM wbb" . WBB_N . "_thread thread" . "\n WHERE thread.boardID IN (0" . $boardIDs . ")" . "\n ORDER BY thread.replies DESC" . "\n LIMIT 0, " . TOPTHREADS_COUNT;
$result = WBBCore::getDB()->sendQuery($sql);
while ($row = WBBCore::getDB()->fetchArray($result)) {
$row['replies'] = StringUtil::formatInteger($row['replies']);
$row['title'] = StringUtil::encodeHTML($row['topic']) . ' - ' . $row['replies'];
if (TOPTHREADS_TITLELENGTH != 0 && strlen($row['topic']) > TOPTHREADS_TITLELENGTH) {
$row['topic'] = StringUtil::substring($row['topic'], 0, TOPTHREADS_TITLELENGTH - 3) . '...';
}
$row['topic'] = StringUtil::encodeHTML($row['topic']);
$this->TopData['threads'][] = $row;
}
}
}
开发者ID:Maggan22,项目名称:wbb3addons,代码行数:30,代码来源:TopThreads.class.php
示例18: getData
/**
* @see CacheBuilder::getData()
*/
public function getData($cacheResource)
{
$sql = "SELECT *\r\n\t\t\t\tFROM ugml_stat_type\r\n\t\t\t\tGROUP BY ugml_stat_type.statTypeID";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
$sql = "SELECT DISTINCT `time`\r\n\t\t\t\t\tFROM ugml_stat_entry_archive\r\n\t\t\t\t\tWHERE statTypeID = " . $row['statTypeID'];
$result2 = WCF::getDB()->sendQuery($sql);
while ($row2 = WCF::getDB()->fetchArray($result2)) {
$row['times'][] = $row2['time'];
}
// range
$sql = "SELECT MAX(rank)\r\n\t\t\t\t\t\tAS max\r\n\t\t\t\t\tFROM ugml_stat_entry\r\n\t\t\t\t\tWHERE statTypeID = " . $row['statTypeID'];
$row += WCF::getDB()->getFirstRow($sql);
$this->data[$row['statTypeID']] = $row;
}
$this->data = array('byStatTypeID' => $this->data, 'byTypeName' => array());
foreach ($this->data['byStatTypeID'] as $statTypeID => $row) {
$name = StringUtil::firstCharToUpperCase($row['type']) . StringUtil::firstCharToUpperCase($row['name']);
$this->data['byTypeName'][$name] = $row;
}
// get the names and the types
$sql = "SELECT GROUP_CONCAT(DISTINCT type)\r\n\t\t\t\t\t\t\tAS types,\r\n\t\t\t\t\t\tGROUP_CONCAT(DISTINCT name)\r\n\t\t\t\t\t\t\tAS names\r\n\t\t\t\tFROM ugml_stat_type\r\n\t\t\t\tGROUP BY NULL";
$row = WCF::getDB()->getFirstRow($sql);
$this->data['types'] = explode(',', $row['types']);
$this->data['names'] = explode(',', $row['names']);
return $this->data;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:30,代码来源:CacheBuilderStatTypes.class.php
示例19: parseQ
private function parseQ ()
{
if (empty ($this->q) || $this->q == '*')
{
$this->displaySearchStr = CLUtil::getLabelForType ($this->type);
$this->clVars['query'] = null;
}
else
{
$tokens = StringUtil::tokenize ($this->q);
$qParts = array ();
foreach ($tokens as $token)
{
if (preg_match ('/^(srchType|minAsk|maxAsk|hasPic|addTwo):(.*)/i', $token, $matches))
{
$this->clVars[strtolower ($matches[1])] = $matches[2];
}
else
{
$qParts[] = $token;
}
}
$this->displaySearchStr = implode (' ' , $qParts);
$this->clVars['query'] = trim (preg_replace ('/ {2,}/', ' ', strtolower (implode (' ' , $qParts))));
}
}
开发者ID:phatduckk,项目名称:craigslittlebuddy.com,代码行数:28,代码来源:ClSearchOptions.php
示例20: actionDestroy
public function actionDestroy()
{
$id = EnvUtil::getRequest("id");
$runId = StringUtil::filterStr(StringUtil::filterCleanHtml($id));
WfHandleUtil::destroy($runId);
$this->ajaxReturn(array("isSuccess" => true));
}
开发者ID:AxelPanda,项目名称:ibos,代码行数:7,代码来源:RecycleController.php
注:本文中的StringUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论