本文整理汇总了PHP中Ibos::app方法的典型用法代码示例。如果您正苦于以下问题:PHP Ibos::app方法的具体用法?PHP Ibos::app怎么用?PHP Ibos::app使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ibos
的用法示例。
在下文中一共展示了Ibos::app方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addLog
public function addLog($assignmentId, $type, $content)
{
$uid = Ibos::app()->user->uid;
$realname = User::model()->fetchRealnameByUid($uid);
$data = array("assignmentid" => $assignmentId, "uid" => $uid, "time" => TIMESTAMP, "ip" => EnvUtil::getClientIp(), "type" => $type, "content" => $realname . $content);
return $this->add($data);
}
示例2: republicAll
public function republicAll()
{
if (LOCAL) {
$except = array("image", "css", "font", "js", ".", "..");
$basePath = $this->getBasePath();
$dir = @opendir($basePath);
while ($entry = @readdir($dir)) {
$file = $basePath . DIRECTORY_SEPARATOR . $entry;
if (!in_array($entry, array_merge($this->excludeFiles, $except))) {
if (is_dir($file)) {
FileUtil::clearDirs($file . "/");
}
}
}
closedir($dir);
$modules = Ibos::app()->getEnabledModule();
foreach ($modules as $module) {
$path = Yii::getPathOfAlias("application.modules.{$module["module"]}.static");
if (is_dir($path)) {
$this->publish($path, false, -1, true);
}
}
}
return true;
}
示例3: actionFileUp
public function actionFileUp()
{
$config = array("savePath" => "data/editor/file/" . Ibos::app()->user->uid . "/", "allowFiles" => array(".rar", ".doc", ".docx", ".zip", ".pdf", ".txt", ".swf", ".wmv"), "maxSize" => 5000);
$up = new EditorUploader("upfile", $config);
$info = $up->getFileInfo();
echo "{\"url\":\"" . $info["url"] . "\",\"fileType\":\"" . $info["type"] . "\",\"original\":\"" . $info["originalName"] . "\",\"state\":\"" . $info["state"] . "\"}";
}
示例4: renderIndex
public function renderIndex()
{
$return = array();
$viewAlias = "application.modules.report.views.indexapi.report";
$uid = Ibos::app()->user->uid;
$reports = Report::model()->fetchAllRepByUids($uid);
if (!empty($reports)) {
$reports = $this->handleIconUrl($reports);
}
$subUidArr = User::model()->fetchSubUidByUid($uid);
$subUidStr = implode(",", $subUidArr);
$subReports = Report::model()->fetchAll("FIND_IN_SET(`uid`, '{$subUidStr}') OR FIND_IN_SET({$uid}, `toid`)");
if (!empty($subReports)) {
$subReports = $this->handleIconUrl($subReports, true);
}
$data = array("reports" => $reports, "subReports" => $subReports, "lang" => Ibos::getLangSource("report.default"), "assetUrl" => Yii::app()->assetManager->getAssetsUrl("report"));
foreach ($this->_indexTab as $tab) {
$data["tab"] = $tab;
if ($tab == "reportPersonal") {
$return[$tab] = Yii::app()->getController()->renderPartial($viewAlias, $data, true);
} else {
if ($tab == "reportAppraise" && (0 < count($subUidArr) || !empty($subReports))) {
$return[$tab] = Yii::app()->getController()->renderPartial($viewAlias, $data, true);
}
}
}
return $return;
}
示例5: 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;
}
}
示例6: 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);
}
}
示例7: run
public function run()
{
$attr = $this->getAttributes();
$map = array("module" => $this->getModule(), "table" => $this->getTable(), "rowid" => $attr["rowid"], "isdel" => 0);
$attr["count"] = Comment::model()->countByAttributes($map);
$list = $this->getCommentList();
$isAdministrator = Ibos::app()->user->isadministrator;
$uid = Ibos::app()->user->uid;
foreach ($list as &$cm) {
$cm["isCommentDel"] = $isAdministrator || $uid === $cm["uid"];
$cm["replys"] = intval(Comment::model()->countByAttributes(array("module" => "message", "table" => "comment", "rowid" => $cm["cid"], "isdel" => 0)));
}
$attr["comments"] = $list;
$attr["lang"] = Ibos::getLangSources(array("message.default"));
$content = $this->render($this->getParseView("comment"), $attr, true);
$ajax = $attr["inAjax"];
$count = $attr["count"];
unset($attr);
$return = array("isSuccess" => true, "data" => $content, "count" => $count);
if ($ajax == 1) {
$this->getOwner()->ajaxReturn($return);
} else {
echo $return["data"];
}
}
示例8: 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;
}
示例9: getIsNeedReset
protected function getIsNeedReset()
{
$neededReset = false;
if ($this->account["expiration"] != 0) {
if (Ibos::app()->user->lastchangepass == 0) {
$neededReset = true;
} else {
$time = TIMESTAMP - Ibos::app()->user->lastchangepass;
switch ($this->account["expiration"]) {
case "1":
if (30 < $time / 86400) {
$neededReset = true;
}
break;
case "2":
if (60 < $time / 86400) {
$neededReset = true;
}
break;
case "3":
if (180 < $time / 86400) {
$neededReset = true;
}
break;
default:
break;
}
}
}
return $neededReset;
}
示例10: getNews
public function getNews($id)
{
$gUid = Ibos::app()->user->uid;
$article = Article::model()->fetchByPk($id);
$attribute = ICArticle::getShowData($article);
return $attribute;
}
示例11: actionIndex
public function actionIndex()
{
$op = EnvUtil::getRequest("op");
$op = in_array($op, array("dept", "letter")) ? $op : "dept";
$params = array();
if ($op == "letter") {
$params["datas"] = $this->getDataByLetter();
} else {
$params["datas"] = $this->getDataByDept();
}
$userDatas = array();
if (!empty($params["datas"])) {
foreach ($params["datas"] as $datas) {
$userDatas = $op == "dept" ? array_merge($userDatas, $datas["users"]) : array_merge($userDatas, $datas);
}
}
$params["uids"] = implode(",", ConvertUtil::getSubByKey($userDatas, "uid"));
$uid = Ibos::app()->user->uid;
$params["cuids"] = Contact::model()->fetchAllConstantByUid($uid);
$this->setPageTitle(Ibos::lang("Contact"));
$this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Contact"), "url" => $this->createUrl("defalut/index")), array("name" => Ibos::lang("Company contact"))));
$view = $op == "letter" ? "letter" : "dept";
$params["allLetters"] = $this->allLetters;
$this->render($view, $params);
}
示例12: loadNewArticle
private function loadNewArticle($num = 3)
{
$uid = Ibos::app()->user->uid;
$allDeptId = Ibos::app()->user->alldeptid . "";
$allPosId = Ibos::app()->user->allposid . "";
$deptCondition = "";
$deptIdArr = explode(",", $allDeptId);
if (0 < count($deptIdArr)) {
foreach ($deptIdArr as $deptId) {
$deptCondition .= "FIND_IN_SET('{$deptId}',deptid) OR ";
}
$deptCondition = substr($deptCondition, 0, -4);
} else {
$deptCondition = "FIND_IN_SET('',deptid)";
}
$condition = " ( ((deptid='alldept' OR {$deptCondition} OR FIND_IN_SET('{$allPosId}',positionid) OR FIND_IN_SET('{$uid}',uid)) OR (deptid='' AND positionid='' AND uid='') OR (author='{$uid}') OR (approver='{$uid}')) ) AND `status`='1'";
$criteria = array("select" => "articleid,subject,content,addtime,type", "condition" => $condition, "order" => "`istop` DESC, `addtime` DESC", "offset" => 0, "limit" => $num);
$articles = Article::model()->fetchAll($criteria);
if (!empty($articles)) {
foreach ($articles as &$article) {
$read = ArticleReader::model()->fetchByAttributes(array("articleid" => $article["articleid"], "uid" => $uid));
$readStatus = $read ? 1 : 0;
if ($readStatus) {
$article["iconStyle"] = $this->iconReadStyle[$article["type"]];
} else {
$article["iconStyle"] = $this->iconNormalStyle[$article["type"]];
}
}
}
return $articles;
}
示例13: checkVote
public static function checkVote($relatedModule, $relatedId, $uid = 0)
{
$result = false;
$uid = empty($uid) ? Ibos::app()->user->uid : $uid;
$condition = "relatedmodule=:relatedmodule AND relatedid=:relatedid";
$params = array(":relatedmodule" => $relatedModule, ":relatedid" => $relatedId);
$vote = Vote::model()->fetch($condition, $params);
if (!empty($vote)) {
$voteid = $vote["voteid"];
$voteItemList = VoteItem::model()->fetchAll("voteid=:voteid", array(":voteid" => $voteid));
foreach ($voteItemList as $voteItem) {
$itemid = $voteItem["itemid"];
$itemCountList = VoteItemCount::model()->fetchAll("itemid=:itemid", array(":itemid" => $itemid));
if (!empty($itemCountList) && 0 < count($itemCountList)) {
foreach ($itemCountList as $itemCount) {
if ($itemCount["uid"] == $uid) {
$result = true;
break;
}
}
}
}
}
return $result;
}
示例14: 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);
}
示例15: update
public static function update($cacheName = "")
{
$updateList = empty($cacheName) ? array() : (is_array($cacheName) ? $cacheName : array($cacheName));
if (!$updateList) {
$cacheDir = Ibos::getPathOfAlias(self::CACHE_ALIAS);
$cacheDirHandle = dir($cacheDir);
while ($entry = $cacheDirHandle->read()) {
$isProviderFile = preg_match("/^([\\_\\w]+)CacheProvider\\.php\$/", $entry, $matches) && substr($entry, -4) == ".php" && is_file($cacheDir . "/" . $entry);
if (!in_array($entry, array(".", "..")) && $isProviderFile) {
$class = basename($matches[0], ".php");
if (class_exists($class)) {
Ibos::app()->attachBehavior("onUpdateCache", array("class" => self::CACHE_ALIAS . "." . $class));
}
}
}
} else {
foreach ($updateList as $entry) {
$owner = ucfirst($entry) . "CacheProvider";
if (class_exists($owner)) {
Ibos::app()->attachBehavior("onUpdateCache", array("class" => self::CACHE_ALIAS . "." . $owner));
}
}
}
if (Ibos::app()->hasEventHandler("onUpdateCache")) {
Ibos::app()->raiseEvent("onUpdateCache", new CEvent(Ibos::app()));
}
}