本文整理汇总了PHP中freelancer::statusToStr方法的典型用法代码示例。如果您正苦于以下问题:PHP freelancer::statusToStr方法的具体用法?PHP freelancer::statusToStr怎么用?PHP freelancer::statusToStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类freelancer
的用法示例。
在下文中一共展示了freelancer::statusToStr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SaveStatus
function SaveStatus($text, $statusType, $login = NULL)
{
session_start();
$freelancer = new freelancer();
$text = addslashes(substr(stripslashes(trim($text)), 0, 200));
close_tags($text, 's');
$freelancer->status_text = antispam(htmlspecialchars(htmlspecialchars_decode(change_q_x(trim($text), true, false), ENT_QUOTES), ENT_QUOTES));
$freelancer->status_type = intval($statusType);
if ($freelancer->statusToStr($statusType)) {
$stdStatus = "";
$objResponse = new xajaxResponse();
$uid = hasPermissions('users') && $login != $_SESSION['login'] ? $freelancer->GetUid($err, $login) : get_uid(false);
$pro = hasPermissions('users') && $login != $_SESSION['login'] ? is_pro(true, $uid) : is_pro();
$error = $freelancer->Update($uid, $res);
if (!$freelancer->status_text) {
$freelancer->status_text = $stdStatus;
}
$freelancer->status_text = stripslashes($freelancer->status_text);
switch ($freelancer->status_type) {
case 1:
$status_cls = 'b-status b-status_busy';
break;
case 2:
$status_cls = 'b-status b-status_abs';
break;
case -1:
$status_cls = 'b-status b-status_no';
break;
default:
$status_cls = 'b-status b-status_free';
}
if (!$noassign) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
$stop_words = new stop_words(hasPermissions('users'));
$sStatusText = $pro ? $freelancer->status_text : $stop_words->replace($freelancer->status_text);
//$GLOBALS['xajax']->setCharEncoding("windows-1251");
$jsobj = json_encode(array('data' => iconv('CP1251', 'UTF8', $freelancer->status_text)));
$objResponse->assign("statusText", "innerHTML", $freelancer->status_text == $stdStatus ? "" : reformat($sStatusText, 40, 0, 1, 25));
$objResponse->assign("statusTitle", "innerHTML", $freelancer->statusToStr($statusType));
// $objResponse->assign("statusTitle", "style.display", $statusType > -1 ? '' : 'none');
$objResponse->script("statusType = {$statusType};\n\t\t\t statusTxt = document.getElementById('statusText').innerHTML;\n\t\t\t statusTxtSrc = {$jsobj};");
}
$objResponse->script("\$('bstatus').erase('class');\n \$('bstatus').addClass('{$status_cls}');");
}
return $objResponse;
}