本文整理汇总了PHP中Ibos::lang方法的典型用法代码示例。如果您正苦于以下问题:PHP Ibos::lang方法的具体用法?PHP Ibos::lang怎么用?PHP Ibos::lang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ibos
的用法示例。
在下文中一共展示了Ibos::lang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
public static function export($idstr)
{
$idArr = is_array($idstr) ? $idstr : explode(",", $idstr);
if (1 < count($idArr)) {
$zip = new Zip();
$exportFileName = Ibos::lang("Form export file pack", "workflow.default", array("{date}" => date("Y-m-d")));
$zipFileName = FileUtil::getTempPath() . "/" . TIMESTAMP . ".zip";
foreach ($idArr as $id) {
$form = self::handleExportSingleForm($id);
$zip->addFile($form["content"], sprintf("%s.html", ConvertUtil::iIconv($form["title"], CHARSET, "gbk")));
}
$fp = fopen($zipFileName, "w");
if (@fwrite($fp, $zip->file()) !== false) {
header("Cache-control: private");
header("Content-type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Content-Length: " . sprintf("%u", FileUtil::fileSize($zipFileName)));
header("Content-Disposition: attachment; filename=" . $exportFileName . ".zip");
readfile($zipFileName);
exit;
}
} else {
$id = implode(",", $idArr);
$form = self::handleExportSingleForm($id);
ob_end_clean();
header("Cache-control: private");
header("Content-type: text/plain");
header("Accept-Ranges: bytes");
header("Accept-Length: " . strlen($form["content"]));
header("Content-Disposition: attachment; filename=" . $form["title"] . ".html");
echo $form["content"];
}
}
示例2: actionEdit
public function actionEdit()
{
$id = intval(EnvUtil::getRequest("id"));
if ($id) {
if (EnvUtil::submitCheck("formhash")) {
$this->beforeSave();
unset($_POST["id"]);
$data = FlowPermission::model()->create();
$status = FlowPermission::model()->modify($id, $data);
$this->ajaxReturn(array("isSuccess" => !!$status));
} else {
$per = FlowPermission::model()->fetchByPk($id);
if (!empty($per)) {
if ($per["deptid"] == "alldept") {
$users = "c_0";
} else {
$users = StringUtil::wrapId($per["uid"], "u") . "," . StringUtil::wrapId($per["deptid"], "d") . "," . StringUtil::wrapId($per["positionid"], "p");
}
$isCustom = !in_array($per["scope"], array("selforg", "alldept", "selfdeptall", "selfdept"));
$data = array("per" => $per, "lang" => Ibos::getLangSources(), "custom" => $isCustom, "users" => StringUtil::filterStr($users));
$this->renderPartial("edit", $data);
} else {
$this->ajaxReturn(Ibos::lang("Parameters error", "error"), "eval");
}
}
}
}
示例3: actionPost
public function actionPost()
{
if (EnvUtil::submitCheck("formhash")) {
$return = array("data" => Ibos::lang("Operation succeed", "message"), "IsSuccess" => true);
if (empty($_POST["touid"])) {
$return["data"] = Ibos::lang("Message receiver cannot be empty");
$return["IsSuccess"] = false;
$this->ajaxReturn($return);
}
if (trim(StringUtil::filterCleanHtml($_POST["content"])) == "") {
$return["data"] = Ibos::lang("Message content cannot be empty");
$return["IsSuccess"] = false;
$this->ajaxReturn($return);
}
$_POST["touid"] = implode(",", StringUtil::getUid($_POST["touid"]));
if (isset($_POST["type"])) {
!in_array($_POST["type"], array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT)) && ($_POST["type"] = null);
} else {
$_POST["type"] = null;
}
$_POST["content"] = StringUtil::filterDangerTag($_POST["content"]);
$res = MessageContent::model()->postMessage($_POST, Yii::app()->user->uid);
if ($res) {
$this->ajaxReturn($return);
} else {
$return["IsSuccess"] = false;
$return["data"] = MessageContent::model()->getError("message");
$this->ajaxReturn($return);
}
}
}
示例4: actionDel
public function actionDel()
{
if (Ibos::app()->request->isAjaxRequest) {
$typeid = intval(EnvUtil::getRequest("typeid"));
if (empty($typeid)) {
$this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Parameters error", "error")));
}
$removeSuccess = ReportType::model()->remove($typeid);
if ($removeSuccess) {
$reports = Report::model()->fetchRepidAndAidByTypeids($typeid);
if (!empty($reports)) {
if ($reports["aids"]) {
AttachUtil::delAttach($reports["aids"]);
}
ReportRecord::model()->deleteAll("repid IN('{$reports["repids"]}')");
Report::model()->deleteAll("repid IN('{$reports["repids"]}')");
}
$return["isSuccess"] = true;
$return["msg"] = Ibos::lang("Del succeed", "message");
} else {
$return["isSuccess"] = false;
$return["msg"] = Ibos::lang("Del failed", "message");
}
$this->ajaxReturn($return);
}
}
示例5: updateKey
public function updateKey($key, $nums, $add = true, $uid = "")
{
if ($nums == 0) {
$this->addError("updateKey", Ibos::lang("Dont need to modify", "message.default"));
return false;
}
$nums < 0 && ($add = false);
$key = StringUtil::filterCleanHtml($key);
$data = $this->getUserData($uid);
if (empty($data) || !$data) {
$data = array();
$data[$key] = $nums;
} else {
$data[$key] = $add ? (int) @$data[$key] + abs($nums) : (int) @$data[$key] - abs($nums);
}
$data[$key] < 0 && ($data[$key] = 0);
$map["uid"] = empty($uid) ? Ibos::app()->user->uid : $uid;
$map["key"] = $key;
$this->deleteAll("`key` = :key AND uid = :uid", array(":key" => $key, ":uid" => $map["uid"]));
$map["value"] = $data[$key];
$map["mtime"] = date("Y-m-d H:i:s");
$this->add($map);
CacheUtil::rm("userData_" . $map["uid"]);
return $data;
}
示例6: actionSetup
public function actionSetup()
{
if (EnvUtil::submitCheck("formhash")) {
$_POST["wbpostfrequency"] = 5 < intval($_POST["wbpostfrequency"]) ? $_POST["wbpostfrequency"] : 5;
$_POST["wbnums"] = 140 <= intval($_POST["wbnums"]) ? $_POST["wbnums"] : 140;
$wbwatermark = isset($_POST["wbwatermark"]) ? 1 : 0;
$wbwcenabled = isset($_POST["wbwcenabled"]) ? 1 : 0;
$postType = array("image" => 0, "topic" => 0, "praise" => 0);
if (isset($_POST["wbposttype"])) {
foreach ($postType as $key => &$val) {
if (isset($_POST["wbposttype"][$key])) {
$val = 1;
}
}
}
if (isset($_POST["wbmovements"])) {
} else {
$_POST["wbmovements"] = array();
}
$data = array("wbnums" => $_POST["wbnums"], "wbpostfrequency" => $_POST["wbpostfrequency"], "wbposttype" => $postType, "wbwatermark" => $wbwatermark, "wbwcenabled" => $wbwcenabled, "wbmovement" => $_POST["wbmovements"]);
foreach ($data as $key => $value) {
Setting::model()->updateSettingValueByKey($key, $value);
}
CacheUtil::update("setting");
$this->success(Ibos::lang("Operation succeed", "message"));
} else {
$data = array("config" => WbCommonUtil::getSetting(), "movementModule" => WbCommonUtil::getMovementModules());
$this->render("setup", $data);
}
}
示例7: getData
private function getData()
{
$id = EnvUtil::getRequest("id");
$aidString = base64_decode(rawurldecode($id));
if (empty($aidString)) {
$this->error(Ibos::lang("Parameters error", "error"), "", array("autoJump" => 0));
}
$salt = Ibos::app()->user->salt;
$decodeString = StringUtil::authCode($aidString, "DECODE", $salt);
$decodeArr = explode("|", $decodeString);
$count = count($decodeArr);
if ($count < 3) {
$this->error(Ibos::lang("Data type invalid", "error"), "", array("autoJump" => 0));
} else {
$aid = $decodeArr[0];
$tableId = $decodeArr[1];
if (0 <= $tableId && $tableId < 10) {
$attach = AttachmentN::model()->fetch($tableId, $aid);
}
$return = array("decodeArr" => $decodeArr, "attach" => array());
if (!empty($attach)) {
$return["attach"] = $attach;
}
return $return;
}
}
示例8: getIncentiveWord
public static function getIncentiveWord()
{
$words = Ibos::getLangSource("incentiveword");
$luckyOne = array_rand($words);
$source = $words[$luckyOne];
return Ibos::lang("Custom title", "main.default") . $source[array_rand($source)];
}
示例9: actionIndex
public function actionIndex()
{
$unit = Setting::model()->fetchSettingValueByKey("unit");
$formSubmit = EnvUtil::submitCheck("unitSubmit");
if ($formSubmit) {
$postData = array();
if (!empty($_FILES["logo"]["name"])) {
!empty($unit["logourl"]) && FileUtil::deleteFile($unit["logourl"]);
$postData["logourl"] = $this->imgUpload("logo");
} elseif (!empty($_POST["logourl"])) {
$postData["logourl"] = $_POST["logourl"];
} else {
$postData["logourl"] = "";
}
$keys = array("phone", "fullname", "shortname", "fax", "zipcode", "address", "adminemail", "systemurl");
foreach ($keys as $key) {
if (isset($_POST[$key])) {
$postData[$key] = StringUtil::filterCleanHtml($_POST[$key]);
} else {
$postData[$key] = "";
}
}
Setting::model()->updateSettingValueByKey("unit", $postData);
CacheUtil::update(array("setting"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$license = Setting::model()->fetchSettingValueByKey("license");
$data = array("unit" => unserialize($unit), "license" => $license);
$this->render("index", $data);
}
}
示例10: handleListData
protected function handleListData(&$list)
{
foreach ($list as &$ver) {
$ver["value"] = $ver["id"];
$ver["text"] = Ibos::lang("Form version text", "", array("{num}" => $ver["mark"], "{date}" => date("Y-m-d H:i:s", $ver["time"])));
}
}
示例11: actionRule
public function actionRule()
{
$formSubmit = EnvUtil::submitCheck("creditRuleSubmit");
if ($formSubmit) {
$cycles = $_POST["cycles"];
$credits = $_POST["credits"];
$rewardNums = $_POST["rewardnums"];
$rulesParam = array();
foreach ($cycles as $ruleId => $cycle) {
$rulesParam[$ruleId]["cycletype"] = $cycle;
}
foreach ($credits as $ruleId => $credit) {
foreach ($credit as $extcreditOffset => $creditValue) {
$rulesParam[$ruleId]["extcredits" . $extcreditOffset] = $creditValue;
}
}
foreach ($rewardNums as $ruleId => $rewardNum) {
$rulesParam[$ruleId]["rewardnum"] = $rewardNum;
}
foreach ($rulesParam as $ruleId => $updateValue) {
CreditRule::model()->modify($ruleId, $updateValue);
}
CacheUtil::update(array("creditRule"));
$this->success(Ibos::lang("Save succeed", "message"));
} else {
$rules = CreditRule::model()->fetchAll();
$credits = Credit::model()->fetchAll();
$data = array("rules" => $rules, "credits" => $credits);
$this->render("rule", $data);
}
}
示例12: getShowData
public static function getShowData($data)
{
$data["subject"] = stripslashes($data["subject"]);
if (!empty($data["author"])) {
$data["authorDeptName"] = Department::model()->fetchDeptNameByUid($data["author"]);
}
if ($data["approver"] != 0) {
$data["approver"] = User::model()->fetchRealNameByUid($data["approver"]);
} else {
$data["approver"] = Ibos::lang("None");
}
$data["addtime"] = ConvertUtil::formatDate($data["addtime"], "u");
$data["uptime"] = empty($data["uptime"]) ? "" : ConvertUtil::formatDate($data["uptime"], "u");
$data["categoryName"] = ArticleCategory::model()->fetchCateNameByCatid($data["catid"]);
if (empty($data["deptid"]) && empty($data["positionid"]) && empty($data["uid"])) {
$data["departmentNames"] = Ibos::lang("All");
$data["positionNames"] = $data["uidNames"] = "";
} elseif ($data["deptid"] == "alldept") {
$data["departmentNames"] = Ibos::lang("All");
$data["positionNames"] = $data["uidNames"] = "";
} else {
$department = DepartmentUtil::loadDepartment();
$data["departmentNames"] = ArticleUtil::joinStringByArray($data["deptid"], $department, "deptname", "、");
$position = PositionUtil::loadPosition();
$data["positionNames"] = ArticleUtil::joinStringByArray($data["positionid"], $position, "posname", "、");
if (!empty($data["uid"])) {
$users = User::model()->fetchAllByUids(explode(",", $data["uid"]));
$data["uidNames"] = ArticleUtil::joinStringByArray($data["uid"], $users, "realname", "、");
} else {
$data["uidNames"] = "";
}
}
return $data;
}
示例13: actionUpdate
public function actionUpdate()
{
if (EnvUtil::submitCheck("formhash")) {
$fieldArr = array("reporttypemanage" => "", "stampenable" => 0, "stampdetails" => "", "pointsystem" => 5, "autoreview" => 0, "autoreviewstamp" => 1);
foreach ($_POST as $key => $value) {
if (in_array($key, array_keys($fieldArr))) {
$fieldArr[$key] = $value;
}
}
$stampStr = "";
if (!empty($fieldArr["stampdetails"])) {
foreach ($fieldArr["stampdetails"] as $score => $stampId) {
$stampId = empty($stampId) ? 0 : $stampId;
$stampStr .= $stampId . ":" . $score . ",";
}
}
$fieldArr["stampdetails"] = rtrim($stampStr, ",");
$apprise = EnvUtil::getRequest("apprise");
if (empty($_POST["stampdetails"][$apprise])) {
$fieldArr["autoreview"] = 0;
} else {
$fieldArr["autoreviewstamp"] = $_POST["stampdetails"][$apprise];
}
Setting::model()->modify("reportconfig", array("svalue" => serialize($fieldArr)));
CacheUtil::update("setting");
$this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
}
}
示例14: 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"));
}
}
示例15: init
public function init()
{
$mainConfig = Ibos::engine()->getMainConfig();
$config = $mainConfig["cache"];
$this->_config = $config;
$this->setExtension();
$this->_prefix = empty($config["prefix"]) ? substr(md5($_SERVER["HTTP_HOST"]), 0, 6) . "_" : $config["prefix"];
foreach (array("eaccelerator", "apc", "xcache", "wincache", "filecache") as $cache) {
if (!is_object($this->_instance) && $this->_extension[$cache] && $this->config[strtolower($cache)]) {
$className = ucfirst($cache);
$this->_instance = new $className();
$this->_instance->init(null);
break;
}
}
if (is_object($this->_instance)) {
$this->enable = true;
$this->type = get_class($this->_instance);
if (strtolower($this->type) == "filecache") {
$this->_prefix = "";
}
} else {
throw new EnvException(Ibos::lang("Cache init error", "error"));
}
}