示例#1
0
 public function get_array_tpl_vars()
 {
     $category = $this->get_category();
     $contents = FormatingHelper::second_parse($this->contents);
     $description = $this->get_real_short_contents();
     $user = $this->get_author_user();
     $user_group_color = User::get_group_color($user->get_groups(), $user->get_level(), true);
     $number_comments = CommentsService::get_number_comments('web', $this->id);
     return array('C_VISIBLE' => $this->is_visible(), 'C_EDIT' => $this->is_authorized_to_edit(), 'C_DELETE' => $this->is_authorized_to_delete(), 'C_READ_MORE' => !$this->is_short_contents_enabled() && $description != $contents && strlen($description) >= WebConfig::NUMBER_CARACTERS_BEFORE_CUT, 'C_USER_GROUP_COLOR' => !empty($user_group_color), 'C_IS_PARTNER' => $this->is_partner(), 'C_HAS_PARTNER_PICTURE' => $this->has_partner_picture(), 'C_IS_PRIVILEGED_PARTNER' => $this->is_privileged_partner(), 'ID' => $this->id, 'NAME' => $this->name, 'URL' => $this->url->absolute(), 'CONTENTS' => $contents, 'DESCRIPTION' => $description, 'DATE' => $this->creation_date->format(Date::FORMAT_DAY_MONTH_YEAR), 'DATE_DAY' => $this->creation_date->get_day(), 'DATE_MONTH' => $this->creation_date->get_month(), 'DATE_YEAR' => $this->creation_date->get_year(), 'DATE_ISO8601' => $this->creation_date->format(Date::FORMAT_ISO8601), 'STATUS' => $this->get_status(), 'C_AUTHOR_EXIST' => $user->get_id() !== User::VISITOR_LEVEL, 'PSEUDO' => $user->get_display_name(), 'USER_LEVEL_CLASS' => UserService::get_level_class($user->get_level()), 'USER_GROUP_COLOR' => $user_group_color, 'NUMBER_VIEWS' => $this->number_views, 'L_VISITED_TIMES' => StringVars::replace_vars(LangLoader::get_message('visited_times', 'common', 'web'), array('number_visits' => $this->number_views)), 'STATIC_NOTATION' => NotationService::display_static_image($this->get_notation()), 'NOTATION' => NotationService::display_active_image($this->get_notation()), 'C_COMMENTS' => !empty($number_comments), 'L_COMMENTS' => CommentsService::get_lang_comments('web', $this->id), 'NUMBER_COMMENTS' => CommentsService::get_number_comments('web', $this->id), 'C_ROOT_CATEGORY' => $category->get_id() == Category::ROOT_CATEGORY, 'CATEGORY_ID' => $category->get_id(), 'CATEGORY_NAME' => $category->get_name(), 'CATEGORY_DESCRIPTION' => $category->get_description(), 'CATEGORY_IMAGE' => $category->get_image()->rel(), 'U_EDIT_CATEGORY' => $category->get_id() == Category::ROOT_CATEGORY ? WebUrlBuilder::configuration()->rel() : WebUrlBuilder::edit_category($category->get_id())->rel(), 'U_SYNDICATION' => SyndicationUrlBuilder::rss('web', $this->id_category)->rel(), 'U_AUTHOR_PROFILE' => UserUrlBuilder::profile($this->get_author_user()->get_id())->rel(), 'U_LINK' => WebUrlBuilder::display($category->get_id(), $category->get_rewrited_name(), $this->id, $this->rewrited_name)->rel(), 'U_VISIT' => WebUrlBuilder::visit($this->id)->rel(), 'U_DEADLINK' => WebUrlBuilder::dead_link($this->id)->rel(), 'U_CATEGORY' => WebUrlBuilder::display_category($category->get_id(), $category->get_rewrited_name())->rel(), 'U_EDIT' => WebUrlBuilder::edit($this->id)->rel(), 'U_DELETE' => WebUrlBuilder::delete($this->id)->rel(), 'U_PARTNER_PICTURE' => $this->partner_picture->rel(), 'U_COMMENTS' => WebUrlBuilder::display_comments($category->get_id(), $category->get_rewrited_name(), $this->id, $this->rewrited_name)->rel());
 }