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


PHP Tags::getActiveTags方法代码示例

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


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

示例1: run

 public function run($id)
 {
     $controller = $this->getController();
     //get The job Id
     if (empty($id)) {
         throw new CTKException(Yii::t("job", "The job posting id is mandatory to retrieve the job posting !"));
     }
     if (empty($_POST["mode"])) {
         $mode = "view";
     } else {
         $mode = $_POST["mode"];
     }
     if ($mode == "insert") {
         $job = array();
         $controller->title = Yii::t("job", "New Job Offer");
         $controller->subTitle = Yii::t("job", "Fill the form");
     } else {
         $job = Job::getById($id);
         $controller->title = $job["title"];
         $controller->subTitle = isset($job["description"]) ? $job["description"] : (isset($job["type"]) ? "Type " . $job["type"] : "");
     }
     $tags = json_encode(Tags::getActiveTags());
     $organizations = Authorisation::listUserOrganizationAdmin(Yii::app()->session["userId"]);
     $controller->pageTitle = Yii::t("job", "Job Posting");
     Rest::json(array("result" => true, "content" => $controller->renderPartial("jobSV", array("job" => $job, "tags" => $tags, "organizations" => $organizations, "mode" => $mode), true)));
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:26,代码来源:PublicAction.php

示例2: filterAndSaveNewTags

 /**
  * From an array of tags (String), the new tags will be saved 
  * Filter the array and return all the valid tags
  * @param array of tags (String)
  * @return all the valid tags 
  */
 public static function filterAndSaveNewTags($tags)
 {
     $res = array();
     $existingTags = Tags::getActiveTags();
     if (!empty($tags)) {
         foreach ($tags as $tag) {
             if (!in_array($tag, $existingTags)) {
                 //TODO : Add here how to define if a tag is valid or not
                 PHDB::update(PHType::TYPE_LISTS, array("name" => "tags"), array('$push' => array("list" => $tag)));
             }
             array_push($res, $tag);
         }
     }
     return $res;
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:21,代码来源:Tags.php

示例3: run

 /**
  * 
  */
 public function run($id)
 {
     $controller = $this->getController();
     $params = array();
     //get The organization Id
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The Parent organization doesn't exist !"));
     }
     $params["parentOrganization"] = Organization::getPublicData($id);
     $lists = Lists::get(array("organisationTypes", "typeIntervention", "public"));
     if (!isset($lists["organisationTypes"]) || !isset($lists["typeIntervention"]) || !isset($lists["public"])) {
         throw new CTKException(Yii::t("organisation", Yii::t("organisation", "Missing List data in 'lists' collection, must have organisationTypes, typeIntervention, public")));
     }
     $params["types"] = $lists["organisationTypes"];
     $params["listTypeIntervention"] = $lists["typeIntervention"];
     $params["listPublic"] = $lists["public"];
     $params["tags"] = Tags::getActiveTags();
     $controller->layout = "//layouts/mainSimple";
     $controller->render("join", $params);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:23,代码来源:JoinAction.php

示例4: run

 public function run($type = null, $id = null)
 {
     $controller = $this->getController();
     $organization = null;
     if (isset($id)) {
         $organization = Organization::getById($id);
         //make sure conected user is the owner
         if ($organization["email"] != Yii::app()->session["userEmail"] || isset($organization["ph:owner"]) && $organization["ph:owner"] != Yii::app()->session["userEmail"]) {
             $organization = null;
         }
     }
     $types = PHDB::findOne(PHType::TYPE_LISTS, array("name" => "organisationTypes"), array('list'));
     $tags = Tags::getActiveTags();
     $detect = new Mobile_Detect();
     $isMobile = $detect->isMobile();
     $params = array("organization" => $organization, 'type' => $type, 'types' => $types['list'], 'tags' => json_encode($tags));
     if ($isMobile) {
         $controller->layout = "//layouts/mainSimple";
         $controller->render("addOrganizationMobile", $params);
     } else {
         $controller->renderPartial("addOrganizationSV", $params);
     }
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:23,代码来源:AddOrganizationFormAction.php

示例5: run

 /**
  * Dashboard Organization
  */
 public function run($id)
 {
     $controller = $this->getController();
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The organization id is mandatory to retrieve the organization !"));
     }
     $organization = Organization::getPublicData($id);
     $events = Organization::listEventsPublicAgenda($id);
     $members = array("citoyens" => array(), "organizations" => array());
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->subTitle = isset($organization["shortDescripion"]) ? $organization["shortDescripion"] : "";
     $controller->pageTitle = "Organization " . $controller->title . " - " . $controller->subTitle;
     if (isset($organization["_id"]) && isset(Yii::app()->session["userId"]) && Link::isLinked((string) $organization["_id"], Organization::COLLECTION, Yii::app()->session["userId"])) {
         $controller->toolbarMBZ = array("<li id='linkBtns'><a href='javascript:;' class='removeMemberBtn text-red tooltips' data-name='" . $organization["name"] . "' data-memberof-id='" . $organization["_id"] . "' data-member-type='" . Person::COLLECTION . "' data-member-id='" . Yii::app()->session["userId"] . "' data-placement='top' data-original-title='Remove from my Organizations' ><i class='disconnectBtnIcon fa fa-unlink'></i>NOT MEMBER</a></li>");
     } else {
         $controller->toolbarMBZ = array("<li id='linkBtns'><a href='javascript:;' class='connectBtn tooltips ' id='addMeAsMemberInfo' data-placement='top' data-original-title='I'm member of this organization' ><i class=' connectBtnIcon fa fa-link '></i>I'M MEMBER</a></li>");
     }
     $contentKeyBase = Yii::app()->controller->id . "." . Yii::app()->controller->action->id;
     $limit = array(Document::IMG_PROFIL => 1, Document::IMG_MEDIA => 5);
     $images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
     $params = array("organization" => $organization);
     $params["contentKeyBase"] = $contentKeyBase;
     $params["images"] = $images;
     $params["events"] = $events;
     $contextMap = array();
     $contextMap["organization"] = $organization;
     $contextMap["events"] = array();
     $contextMap["organizations"] = array();
     $contextMap["people"] = array();
     $organizations = Organization::getMembersByOrganizationId($id, Organization::COLLECTION);
     $people = Organization::getMembersByOrganizationId($id, Person::COLLECTION);
     foreach ($organizations as $key => $value) {
         $newOrga = Organization::getById($key);
         array_push($contextMap["organizations"], $newOrga);
         array_push($members["organizations"], $newOrga);
     }
     foreach ($events as $key => $value) {
         $newEvent = Event::getById($key);
         array_push($contextMap["events"], $newEvent);
     }
     foreach ($people as $key => $value) {
         $newCitoyen = Person::getById($key);
         $profil = Document::getLastImageByKey($key, Person::COLLECTION, Document::IMG_PROFIL);
         if ($profil != "") {
             $newCitoyen["imagePath"] = $profil;
         }
         array_push($contextMap["people"], $newCitoyen);
         array_push($members["citoyens"], $newCitoyen);
     }
     $params["members"] = $members;
     $params["contextMap"] = $contextMap;
     //list
     $params["tags"] = Tags::getActiveTags();
     $lists = Lists::get(array("public", "typeIntervention", "organisationTypes"));
     $params["public"] = $lists["public"];
     $params["organizationTypes"] = $lists["organisationTypes"];
     $params["typeIntervention"] = $lists["typeIntervention"];
     $params["countries"] = OpenData::getCountriesList();
     //Plaquette de présentation
     $listPlaquette = Document::listDocumentByCategory($id, Organization::COLLECTION, Document::CATEGORY_PLAQUETTE, array('created' => 1));
     $params["plaquette"] = reset($listPlaquette);
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->render("dashboard", $params);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:67,代码来源:DashboardAction.php


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