public function GenerateOutput() { global $langmessage; \gp\tool::ShowingGallery(); echo '<h2>'; echo \gp\tool\Output::ReturnText('galleries'); echo '</h2>'; $wrap = \gp\admin\Tools::CanEdit($this->page->gp_index); if ($wrap) { echo \gp\tool\Output::EditAreaLink($edit_index, 'Admin/Galleries', $langmessage['edit']); echo '<div class="editable_area cf" id="ExtraEditArea' . $edit_index . '">'; // class="edit_area" added by javascript } $image_text = \gp\tool\Output::ReturnText('image'); $images_text = \gp\tool\Output::ReturnText('images'); $list = ''; $shown = 0; foreach ($this->galleries as $title => $info) { //page is hidden if (!$this->GalleryVisible($title, $info)) { continue; } $count = ''; if (is_array($info)) { $icon = $info['icon']; if ($info['count'] == 1) { $count = $info['count'] . ' ' . \gp\tool\Output::ReturnText('image'); } elseif ($info['count'] > 1) { $count = $info['count'] . ' ' . \gp\tool\Output::ReturnText('images'); } } else { $icon = $info; } if (empty($icon)) { continue; } $icon = rawurldecode($icon); //prevent double encoding if (strpos($icon, '/thumbnails/') === false) { $thumbPath = \gp\tool::GetDir('/data/_uploaded/image/thumbnails' . $icon . '.jpg'); } else { $thumbPath = \gp\tool::GetDir('/data/_uploaded' . $icon); } $label = \gp\tool::GetLabel($title); $title_attr = ' title="' . \gp\tool::GetBrowserTitle($title) . '"'; $label_img = ' <img src="' . $thumbPath . '" alt=""/>'; $list .= '<li>' . \gp\tool::Link($title, $label_img, '', $title_attr) . '<div>' . \gp\tool::Link($title, $label, '', $title_attr) . '<p>' . $count . '</p>' . '</div>' . '</li>'; } if (!empty($list)) { echo '<ul class="gp_gallery gp_galleries">'; echo $list; echo '</ul>'; } if ($wrap) { echo '</div>'; } $this->PostSave(); }
/** * Start the link attributes array * */ protected function MenuAttributesA() { global $gp_titles; $attributes = array('href' => '', 'attr' => '', 'value' => '', 'title' => '', 'class' => array()); //external if (isset($this->curr_info['url'])) { if (empty($this->curr_info['title_attr'])) { $this->curr_info['title_attr'] = strip_tags($this->curr_info['label']); } $attributes['href'] = $this->curr_info['url']; $attributes['value'] = $this->curr_info['label']; $attributes['title'] = $this->curr_info['title_attr']; if (isset($this->curr_info['new_win'])) { $attributes['target'] = '_blank'; } //internal link } else { $title = \gp\tool::IndexToTitle($this->curr_key); $attributes['href'] = \gp\tool::GetUrl($title); $attributes['value'] = \gp\tool::GetLabel($title); $attributes['title'] = \gp\tool::GetBrowserTitle($title); //get valid rel attr if (!empty($gp_titles[$this->curr_key]['rel'])) { $rel = explode(',', $gp_titles[$this->curr_key]['rel']); $attributes['rel'] = array_intersect(array('alternate', 'author', 'bookmark', 'help', 'icon', 'license', 'next', 'nofollow', 'noreferrer', 'prefetch', 'prev', 'search', 'stylesheet', 'tag'), $rel); } } return $attributes; }
/** * Add the <title> tag to the page * return the value * */ public static function MetaTitle() { global $page, $config; echo "\n<title>"; $page_title = ''; if (!empty($page->TitleInfo['browser_title'])) { $page_title = $page->TitleInfo['browser_title']; } elseif (!empty($page->label)) { $page_title = strip_tags($page->label); } elseif (isset($page->title)) { $page_title = \gp\tool::GetBrowserTitle($page->title); } echo $page_title; if (!empty($page_title) && !empty($config['title'])) { echo ' - '; } echo $config['title'] . '</title>'; return $page_title; }