示例#1
0
 protected function renderSpecialView($position)
 {
     $views = OpenSms::getViews($position);
     foreach ($views as $view) {
         switch ($view->type) {
             case OpenSms::VIEW_TYPE_STYLE:
                 echo html_entity_decode("<link href='" . OpenSms::getBaseUrl() . OpenSms::DESIGN_PATH . $view->content . "' rel='stylesheet'/>");
                 break;
             case OpenSms::VIEW_TYPE_SCRIPT:
                 echo html_entity_decode("<script src='" . OpenSms::getBaseUrl() . OpenSms::DESIGN_PATH . $view->content . "' type='text/javascript'></script>");
                 break;
             case OpenSms::VIEW_TYPE_HTML:
             case OpenSms::VIEW_TYPE_RAW:
                 if ($view->isFile) {
                     require_once OpenSms::DESIGN_PATH . $view->content;
                 } else {
                     echo $view->type == OpenSms::VIEW_TYPE_HTML ? html_entity_decode($view->content) : $view->content;
                 }
                 break;
         }
     }
 }