本文整理汇总了PHP中Person::getPublicData方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::getPublicData方法的具体用法?PHP Person::getPublicData怎么用?PHP Person::getPublicData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::getPublicData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$events = array();
$organization = Organization::getPublicData($id);
if (isset($organization["links"]["events"])) {
foreach ($organization["links"]["events"] as $key => $value) {
$event = Event::getPublicData($key);
$events[$key] = $event;
}
}
foreach ($organization["links"]["members"] as $newId => $e) {
if ($e["type"] == Organization::COLLECTION) {
$member = Organization::getPublicData($newId);
} else {
$member = Person::getPublicData($newId);
}
if (isset($member["links"]["events"])) {
foreach ($member["links"]["events"] as $key => $value) {
$event = Event::getPublicData($key);
$events[$key] = $event;
}
}
}
Rest::json($events);
}
示例2: actionSimple
public function actionSimple()
{
$this->layout = "//layouts/mainSimple";
$params = array();
//get The person Id
$id = Yii::app()->session["userId"];
/* **************************************
* PERSON
***************************************** */
$person = Person::getPublicData($id);
$this->title = (isset($person["name"]) ? $person["name"] : "") . "'s Directory";
$this->subTitle = isset($person["description"]) ? $person["description"] : "";
$this->pageTitle = ucfirst($this->module->id) . " - " . $this->title;
/* **************************************
* EVENTS
***************************************** */
$events = Authorisation::listEventsIamAdminOf($id);
$eventsAttending = Event::listEventAttending($id);
foreach ($eventsAttending as $key => $value) {
$eventId = (string) $value["_id"];
if (!isset($events[$eventId])) {
$events[$eventId] = $value;
}
}
//TODO - SBAR : Pour le dashboard person, affiche t-on les événements des associations dont je suis memebre ?
//Get the organization where i am member of;
/* **************************************
* ORGANIZATIONS
***************************************** */
$organizations = array();
if (isset($person["links"]) && isset($person["links"]["memberOf"])) {
foreach ($person["links"]["memberOf"] as $key => $member) {
$organization;
if ($member['type'] == Organization::COLLECTION) {
$organization = Organization::getPublicData($key);
$profil = Document::getLastImageByKey($key, Organization::COLLECTION, Document::IMG_PROFIL);
if ($profil != "") {
$organization["imagePath"] = $profil;
}
array_push($organizations, $organization);
}
if (isset($organization["links"]["events"])) {
foreach ($organization["links"]["events"] as $keyEv => $valueEv) {
$event = Event::getPublicData($keyEv);
$profil = Document::getLastImageByKey($keyEv, Event::COLLECTION, Document::IMG_PROFIL);
if ($profil != "") {
$event["imagePath"] = $profil;
}
$events[$keyEv] = $event;
}
}
}
//$randomOrganizationId = array_rand($subOrganizationIds);
//$randomOrganization = Organization::getById( $subOrganizationIds[$randomOrganizationId] );
//$params["randomOrganization"] = $randomOrganization;
}
/* **************************************
* PEOPLE
***************************************** */
$people = array();
if (isset($person["links"]) && isset($person["links"]["knows"])) {
foreach ($person["links"]["knows"] as $key => $member) {
if ($member['type'] == Person::COLLECTION) {
$citoyen = Person::getPublicData($key);
$profil = Document::getLastImageByKey($key, Person::COLLECTION, Document::IMG_PROFIL);
if ($profil != "") {
$citoyen["imagePath"] = $profil;
}
array_push($people, $citoyen);
}
}
}
/* **************************************
* PROJECTS
***************************************** */
$projects = array();
if (isset($person["links"]["projects"])) {
foreach ($person["links"]["projects"] as $key => $value) {
$project = Project::getPublicData($key);
array_push($projects, $project);
}
}
$params["person"] = $person;
$params["organizations"] = $organizations;
$params["projects"] = $projects;
$params["events"] = $events;
$params["people"] = $people;
$this->render("index", $params);
}
示例3: run
public function run($id)
{
$controller = $this->getController();
$project = Project::getPublicData($id);
$controller->sidebar1 = array(array('label' => "ACCUEIL", "key" => "home", "iconClass" => "fa fa-home", "href" => "communecter/project/dashboard/id/" . $id));
$controller->title = isset($project["name"]) ? $project["name"] : "";
if (isset($project["_id"]) && isset(Yii::app()->session["userId"]) && Link::isLinked($project["_id"], Project::COLLECTION, Yii::app()->session['userId'])) {
$htmlFollowBtn = "<li id='linkBtns'><a href='javascript:;' class='disconnectBtn text-red tooltips' data-name='" . $project["name"] . "' data-id='" . $project["_id"] . "' data-type='" . Project::COLLECTION . "' data-member-id='" . Yii::app()->session["userId"] . "' data-ownerlink='" . Link::person2projects . "' data-targetlink='" . Link::project2person . "' data-placement='top' data-original-title='No more Attendee' ><i class='disconnectBtnIcon fa fa-unlink'></i>UNCONTRIBUTE</a></li>";
} else {
$htmlFollowBtn = "<li id='linkBtns'><a href='javascript:;' class='connectBtn tooltips ' id='addKnowsRelation' data-placement='top' data-ownerlink='" . Link::person2projects . "' data-targetlink='" . Link::project2person . "' data-original-title='I know this person' ><i class=' connectBtnIcon fa fa-link '></i>CONTRIBUTE</a></li>";
}
$controller->toolbarMBZ = array("<a href='" . Yii::app()->createUrl("/" . $controller->module->id . "/news/index/type/projects/id/" . $id) . "'><i class='fa fa-rss fa-2x'></i>TIMELINE</a>", "<a href='" . Yii::app()->createUrl("/" . $controller->module->id . "/discuss/index/type/projects/id/" . $id) . "'><i class='fa fa-comments-o fa-2x'></i>DISCUSS</a>", $htmlFollowBtn);
$controller->subTitle = isset($project["description"]) ? $project["description"] : "";
$controller->pageTitle = "Communecter - Informations sur le projet " . $controller->title;
$organizations = array();
$people = array();
//$admins = array();
$contributors = array();
$properties = array();
$contentKeyBase = $controller->id . "." . $controller->action->id;
$images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE);
if (!empty($project)) {
$params = array();
if (isset($project["links"])) {
foreach ($project["links"]["contributors"] as $id => $e) {
if ($e["type"] == Organization::COLLECTION) {
$organization = Organization::getPublicData($id);
if (!empty($organization)) {
array_push($organizations, $organization);
$organization["type"] = "organization";
array_push($contributors, $organization);
}
} else {
if ($e["type"] == PHType::TYPE_CITOYEN) {
$citoyen = Person::getPublicData($id);
if (!empty($citoyen)) {
array_push($people, $citoyen);
$citoyen["type"] = "citoyen";
array_push($contributors, $citoyen);
}
}
}
/*if(isset($e["isAdmin"]) && $e["isAdmin"]==true){
array_push($admins, $e);
}*/
}
}
if (isset($project["properties"])) {
$properties = $project["properties"];
}
}
$lists = Lists::get(array("organisationTypes"));
$params["countries"] = OpenData::getCountriesList();
$params["tags"] = Tags::getActiveTags();
$params["organizationTypes"] = $lists["organisationTypes"];
$params["images"] = $images;
$params["contentKeyBase"] = $contentKeyBase;
$params["contributors"] = $contributors;
$params["project"] = $project;
$params["organizations"] = $organizations;
$params["people"] = $people;
$params["properties"] = $properties;
//$params["admins"] = $admins;
$controller->render("dashboard", $params);
}
示例4: run
public function run($insee = null)
{
$controller = $this->getController();
//get The person Id
if (empty($id)) {
if (empty(Yii::app()->session["userId"])) {
$controller->redirect(Yii::app()->homeUrl);
} else {
$id = Yii::app()->session["userId"];
}
}
$person = Person::getPublicData($id);
$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("person" => $person);
$params['images'] = $images;
$params["contentKeyBase"] = $contentKeyBase;
$controller->sidebar1 = array(array('label' => "ACCUEIL", "key" => "home", "iconClass" => "fa fa-home", "href" => "communecter/person/dashboard/id/" . $id));
$controller->title = "City Dashboard : " . $insee;
$controller->subTitle = isset($person["description"]) ? $person["description"] : "";
$controller->pageTitle = ucfirst($controller->module->id) . " - Informations publiques de " . $controller->title;
//Get Projects
$projects = array();
if (isset($person["links"]["projects"])) {
foreach ($person["links"]["projects"] as $key => $value) {
$project = Project::getPublicData($key);
array_push($projects, $project);
}
}
//Get the Events
$events = Authorisation::listEventsIamAdminOf($id);
$eventsAttending = Event::listEventAttending($id);
foreach ($eventsAttending as $key => $value) {
$eventId = (string) $value["_id"];
if (!isset($events[$eventId])) {
$events[$eventId] = $value;
}
}
$tags = PHDB::findOne(PHType::TYPE_LISTS, array("name" => "tags"), array('list'));
//TODO - SBAR : Pour le dashboard person, affiche t-on les événements des associations dont je suis memebre ?
//Get the organization where i am member of;
$organizations = array();
if (isset($person["links"]) && isset($person["links"]["memberOf"])) {
foreach ($person["links"]["memberOf"] as $key => $member) {
$organization;
if ($member['type'] == Organization::COLLECTION) {
$organization = Organization::getPublicData($key);
$profil = Document::getLastImageByKey($key, Organization::COLLECTION, Document::IMG_PROFIL);
if ($profil != "") {
$organization["imagePath"] = $profil;
}
array_push($organizations, $organization);
}
if (isset($organization["links"]["events"])) {
foreach ($organization["links"]["events"] as $keyEv => $valueEv) {
$event = Event::getPublicData($keyEv);
$events[$keyEv] = $event;
}
}
}
//$randomOrganizationId = array_rand($subOrganizationIds);
//$randomOrganization = Organization::getById( $subOrganizationIds[$randomOrganizationId] );
//$params["randomOrganization"] = $randomOrganization;
}
$people = array();
if (isset($person["links"]) && isset($person["links"]["knows"])) {
foreach ($person["links"]["knows"] as $key => $member) {
$citoyen;
if ($member['type'] == PHType::TYPE_CITOYEN) {
$citoyen = Person::getPublicData($key);
$profil = Document::getLastImageByKey($key, Person::COLLECTION, Document::IMG_PROFIL);
if ($profil != "") {
$citoyen["imagePath"] = $profil;
}
array_push($people, $citoyen);
}
}
}
$params["tags"] = $tags;
$params["organizations"] = $organizations;
$params["projects"] = $projects;
$params["events"] = $events;
$params["people"] = $people;
$params["insee"] = $insee;
$controller->render("dashboard", $params);
}
示例5: run
/**
* Dashboard Organization
*/
public function run($id)
{
$controller = $this->getController();
//get The organization Id
if (empty($id)) {
throw new CTKException(Yii::t("organisation", "The organization id is mandatory to retrieve the organization !"));
}
$organization = Organization::getPublicData($id);
$params = array("organization" => $organization);
$controller->title = isset($organization["name"]) ? $organization["name"] : "";
$controller->subTitle = isset($organization["shortDescripion"]) ? $organization["shortDescripion"] : "";
$controller->pageTitle = ucfirst($controller->module->id) . " - Informations publiques de " . $controller->title;
//Same content Key base as the dashboard
$contentKeyBase = Yii::app()->controller->id . ".dashboard";
$params["contentKeyBase"] = $contentKeyBase;
if (isset($organization["links"]) && isset($organization["links"]["members"])) {
$memberData;
$subOrganizationIds = array();
$members = array("citoyens" => array(), "organizations" => array());
foreach ($organization["links"]["members"] as $key => $member) {
if ($member['type'] == Organization::COLLECTION) {
array_push($subOrganizationIds, $key);
$memberData = Organization::getPublicData($key);
array_push($members[Organization::COLLECTION], $memberData);
} elseif ($member['type'] == PHType::TYPE_CITOYEN) {
$memberData = Person::getPublicData($key);
array_push($members[PHType::TYPE_CITOYEN], $memberData);
}
}
if (count($subOrganizationIds) != 0) {
$randomOrganizationId = array_rand($subOrganizationIds);
$randomOrganization = Organization::getById($subOrganizationIds[$randomOrganizationId]);
//Load the images
$limit = array(Document::IMG_PROFIL => 1, Document::IMG_LOGO => 1);
$images = Document::getListDocumentsURLByContentKey((string) $randomOrganization["_id"], $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
$randomOrganization["images"] = $images;
$params["randomOrganization"] = $randomOrganization;
}
$params["members"] = $members;
}
$limit = array(Document::IMG_PROFIL => 1, Document::IMG_MEDIA => 5);
$images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
$params["images"] = $images;
$events = Organization::listEventsPublicAgenda($id);
$params["events"] = $events;
$lists = Lists::get(array("organisationTypes"));
$params["organizationTypes"] = $lists["organisationTypes"];
$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);
}
foreach ($events as $key => $value) {
$newEvent = Event::getById($key);
array_push($contextMap["events"], $newEvent);
}
foreach ($people as $key => $value) {
$newCitoyen = Person::getById($key);
array_push($contextMap["people"], $newCitoyen);
}
$params["contextMap"] = $contextMap;
$controller->render("dashboardMember", $params);
}