Example #1
0
 function getEmailParams(&$params, $withLoad = TRUE, $withOwner = TRUE, $extraParams = TRUE, $excludeAttr = 0)
 {
     global $item_typ;
     if ($withLoad) {
         $this->getCid();
         $this->activateVariableFields();
         load($this);
     }
     if ($extraParams) {
         $title = $this->getTitle(FALSE);
         $ctrl = $this->getLinkCtrl($title);
         $navBarPieces = $this->getNavBarPieces(TRUE, TRUE);
         // absolute
         $params = array("listing" => htmlspecialchars($title), "plainTitle" => htmlspecialchars($title), "title" => $ctrl->generAnchor($title, "", TRUE, "", TRUE), "breadcrumb" => Roll::composeNavBarPieces($navBarPieces), "wholeCatName" => htmlspecialchars($this->getWholeCatName()), "daysLeft" => !isset($this->expirationTime) || !is_object($this->expirationTime) || $this->expirationTime->isEmpty() ? "" : round($this->expirationTime->getDayDiff()), "description" => $this->getDescription(), "url" => $ctrl->makeUrl(TRUE), "category" => htmlspecialchars($this->getCatName()), "status" => $this->showListVal("status"));
     } else {
         $params = array("category" => htmlspecialchars($this->getCatName()), "status" => $this->showListVal("status"));
     }
     if ($withOwner) {
         $owner = User::createObject();
         $owner->id = $this->ownerId;
         $owner->getEmailParams($params["owner"]);
     }
     $this->getEmailParamsCore($params, $excludeAttr);
     if ($withOwner) {
         return $owner->email;
     }
 }
Example #2
0
 function assignCurrentUserFields()
 {
     global $gorumuser, $gorumrecognised;
     if ($gorumrecognised) {
         $user = User::createObject();
         $user->activateVariableFields();
         G::load($user, $gorumuser->id, "user");
         View::assign("loggedIn", 1);
         $userArr = array();
         foreach ($user->getFields() as $field) {
             if (!isset($user->{$field->columnIndex}) || in_array($field->columnIndex, array("password", "passwordCopy", "newPassword", "rememberPassword", "remindPasswordLink"))) {
                 continue;
             } elseif ($field->columnIndex == "name" || $field->columnIndex == "email") {
                 $userArr[$field->columnIndex . "Link"] = $user->showListVal($field->columnIndex, "", TRUE);
                 $userArr[$field->columnIndex] = $userArr[$field->name] = htmlspecialchars($user->{$field->columnIndex});
             } elseif ($field->type == customfield_picture) {
                 $userArr[$field->name] = $userArr[$field->columnIndex] = $user->{$field->columnIndex} ? $user->showListVal($field->columnIndex, "", FALSE) : "";
             } elseif ($field->type != customfield_separator) {
                 $userArr[$field->name] = $user->{$field->columnIndex} = $user->showListVal($field->columnIndex, "", TRUE);
             }
         }
         View::assign("isAdmin", $user->isAdm);
         View::assign("currentUser", $userArr);
     } else {
         View::assign("loggedIn", 0);
         View::assign("isAdmin", 0);
         View::assign("currentUser", 0);
     }
 }