示例#1
0
 public function generate()
 {
     $content = ob_get_clean();
     $content = SiteLinks($content);
     // if plain, outputting data
     if ($this->plainOutput) {
         echo $content;
         return;
     }
     // otherwise - if output type is set to skinned
     $config =& Watermelon::$config;
     // head tags
     $headTags = array();
     $siteName = Watermelon::$config->siteName;
     if (Watermelon::$appType == Watermelon::Admin) {
         $title = empty($this->pageTitle) ? 'Panel Admina - ' . $siteName : $this->pageTitle . ' - Panel Admina - ' . $siteName;
     } elseif (Watermelon::$appType == Watermelon::Installer) {
         $title = 'Watermelon';
     } else {
         $title = empty($pageTitle) ? $siteName : $this->pageTitle . ' - ' . $siteName;
     }
     $headTags[] = '<title>' . $title . '</title>';
     $headTags[] = "<script>SystemURL = '" . SystemURL . "'; SiteURL = '" . SiteURL . "'</script>";
     if (Watermelon::$appType == Watermelon::Site) {
         $headTags[] = '<link rel="alternate" type="application/atom+xml" href="' . SiteURL . 'feed.atom"/>';
     }
     if (!empty($config->headTags)) {
         $headTags[] = $config->headTags;
     }
     foreach (Watermelon::$headTags as $tag) {
         $headTags[] = $tag;
     }
     // tail tags
     $tailTags = array();
     $tailTags[] = $config->tailTags;
     foreach (Watermelon::$tailTags as $tag) {
         $tailTags[] = $tag;
     }
     // loading skin
     include SkinPath . 'skin.php';
     if (Watermelon::$appType == Watermelon::Admin) {
         $className = 'ACPSkin';
     } else {
         $className = $config->skin . '_skin';
     }
     // setting configuration
     $messages = $_SESSION['wmelon.messages'];
     $_SESSION['wmelon.messages'] = array();
     $skin->content =& $content;
     $skin->pageTitle = $pageTitle;
     $skin->noHeader = $this->noHeader;
     $skin->siteName = htmlspecialchars($siteName);
     $skin->footer = SiteLinks($config->footer);
     $skin->messages =& $messages;
     $skin->headTags =& $headTags;
     $skin->tailTags =& $tailTags;
     $skin->textMenus =& $config->textMenus;
     $skin->data = $this->data;
     new $className($skin, SkinPath . 'index.php');
 }
示例#2
0
文件: Skin.php 项目: radex/Watermelon
 public function drawMessages()
 {
     foreach ($this->messages as $message) {
         list($type, $messageString) = $message;
         echo '<div class="' . $type . '">' . SiteLinks($messageString) . '</div>';
     }
 }