コード例 #1
0
ファイル: AdminPage.php プロジェクト: gingerP/shop
 public function AdminPage()
 {
     /*if (AuthManager::isCurrentUserAuthenticate()) {*/
     if (1) {
         $mainTag = new Html();
         $head = new Head();
         $head->addChild("\n            <title>Admin page</title>\n            <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n            <link rel='shortcut icon' href='images/system/favicon.ico' type='image/x-icon'/>\n            <link rel='stylesheet' type='text/css' href='/src/front/style/style-less.css'/>\n            <script type='text/javascript' src='/src/front/js/fixies.js'></script>\n            <script type='text/javascript' src='/src/front/js/ext/jquery.js'></script>\n            <script type='text/javascript' src='/src/front/js/v-utils.js'></script>\n            <script type='text/javascript' src='/src/front/js/admin.js'></script>\n            ");
         $body = new Body();
         $body->addChild($this->getPreparedDom());
         echo TagUtils::buildHtml($mainTag->addChildList([$head, $body]), new Num(0));
     } else {
         $mainTag = $this->getPreAuthPage();
         echo TagUtils::buildHtml($mainTag, new Num(0));
     }
 }
コード例 #2
0
ファイル: TagUtils.php プロジェクト: gingerP/shop
 public static function buildHtml($tag, Num &$depth)
 {
     try {
         $tabs = "";
         //implode("", array_fill(0, $depth->_inc()->getNum(), "  "));
         $html = "";
         if ($tag instanceof Tag) {
             $beginTag = "{$tabs}<" . $tag->getTagName();
             $tagContent = "";
             $endTag = "{$tabs}</" . $tag->getTagName() . ">";
             $id = "";
             $class = "";
             $attributes = "";
             if (!Utils::isNullOrEmptyString($tag->getId())) {
                 $id = TagLabels::ID . "='" . $tag->getId() . "'";
             }
             if (count($tag->getClassList()) > 0) {
                 $class = TagLabels::_CLASS . "='";
                 for ($index = 0, $max = count($tag->getClassList()); $index < $max; $index++) {
                     $class .= $tag->getClassList()[$index] . " ";
                 }
                 $class .= "'";
             }
             if (count($tag->getAttributeList()) > 0) {
                 foreach ($tag->getAttributeList() as $key => $value) {
                     $attributes .= " {$key}=\"{$value}\" ";
                 }
             }
             $beginTag .= " " . $id . " " . $class . " " . $attributes . " >";
             if (!$tag instanceof SingleTag) {
                 for ($index = 0, $max = count($tag->getChildList()); $index < $max; $index++) {
                     $tagContent .= TagUtils::buildHtml($tag->getChildList()[$index], $depth);
                     $depth->_dec();
                 }
                 $html = $beginTag . $tagContent . $endTag;
             } else {
                 $html = $beginTag;
             }
         } else {
             if (is_string($tag) || is_numeric($tag)) {
                 return $tag;
             }
         }
     } catch (Exception $e) {
         log::info("Caught exception: ',  {$e->getMessage}()");
     }
     return $html;
 }
コード例 #3
0
ファイル: Tag.php プロジェクト: gingerP/shop
 public function getHtml()
 {
     return TagUtils::buildHtml($this, new Num(0));
 }