/** * Get the default design and show the design admin panel form * * @return void */ function showForm() { $this->design = Design::siteDesign(); $form = new DesignAdminPanelForm($this); $form->show(); return; }
/** * A design for this action * * @return Design a design object to use */ function getDesign() { return Design::siteDesign(); }
/** * Content area of the page * * Shows a form for changing the design * * @return void */ function showContent() { $design = $this->getWorkingDesign(); if (empty($design)) { $design = Design::siteDesign(); } $this->showDesignForm($design); }
function twitterUserArray($profile, $get_notice = false) { $twitter_user = array(); $twitter_user['id'] = intval($profile->id); $twitter_user['name'] = $profile->getBestName(); $twitter_user['screen_name'] = $profile->nickname; $twitter_user['location'] = $profile->location ? $profile->location : null; $twitter_user['description'] = $profile->bio ? $profile->bio : null; $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); $twitter_user['profile_image_url'] = $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE); $twitter_user['url'] = $profile->homepage ? $profile->homepage : null; $twitter_user['protected'] = false; # not supported by StatusNet yet $twitter_user['followers_count'] = $profile->subscriberCount(); $design = null; $user = $profile->getUser(); // Note: some profiles don't have an associated user $defaultDesign = Design::siteDesign(); if (!empty($user)) { $design = $user->getDesign(); } if (empty($design)) { $design = $defaultDesign; } $color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor); $twitter_user['profile_background_color'] = $color == null ? '' : '#' . $color->hexValue(); $color = Design::toWebColor(empty($design->textcolor) ? $defaultDesign->textcolor : $design->textcolor); $twitter_user['profile_text_color'] = $color == null ? '' : '#' . $color->hexValue(); $color = Design::toWebColor(empty($design->linkcolor) ? $defaultDesign->linkcolor : $design->linkcolor); $twitter_user['profile_link_color'] = $color == null ? '' : '#' . $color->hexValue(); $color = Design::toWebColor(empty($design->sidebarcolor) ? $defaultDesign->sidebarcolor : $design->sidebarcolor); $twitter_user['profile_sidebar_fill_color'] = $color == null ? '' : '#' . $color->hexValue(); $twitter_user['profile_sidebar_border_color'] = ''; $twitter_user['friends_count'] = $profile->subscriptionCount(); $twitter_user['created_at'] = $this->dateTwitter($profile->created); $twitter_user['favourites_count'] = $profile->faveCount(); // British spelling! $timezone = 'UTC'; if (!empty($user) && $user->timezone) { $timezone = $user->timezone; } $t = new DateTime(); $t->setTimezone(new DateTimeZone($timezone)); $twitter_user['utc_offset'] = $t->format('Z'); $twitter_user['time_zone'] = $timezone; $twitter_user['profile_background_image_url'] = empty($design->backgroundimage) ? '' : $design->disposition & BACKGROUND_ON ? Design::url($design->backgroundimage) : ''; $twitter_user['profile_background_tile'] = empty($design->disposition) ? '' : $design->disposition & BACKGROUND_TILE ? 'true' : 'false'; $twitter_user['statuses_count'] = $profile->noticeCount(); // Is the requesting user following this user? $twitter_user['following'] = false; $twitter_user['notifications'] = false; if (isset($this->auth_user)) { $twitter_user['following'] = $this->auth_user->isSubscribed($profile); // Notifications on? $sub = Subscription::pkeyGet(array('subscriber' => $this->auth_user->id, 'subscribed' => $profile->id)); if ($sub) { $twitter_user['notifications'] = $sub->jabber || $sub->sms; } } if ($get_notice) { $notice = $profile->getCurrentNotice(); if ($notice) { # don't get user! $twitter_user['status'] = $this->twitterStatusArray($notice, false); } } return $twitter_user; }