protected function getTplInfo(UHEADER_BOL_Template $template)
 {
     $canvas = $template->getCanvas(self::CANVAS_WIDTH);
     $previewCanvas = $template->getCanvas(self::ITEM_WIDTH);
     $css = $template->getCss();
     $cssStr = $template->getCssString();
     return array("id" => $template->id, "default" => (bool) $template->default, "src" => $this->service->getTemplateUrl($template), "data" => $template->getSettings(), "css" => $css, "cssStr" => $cssStr, "canvas" => $canvas, "previewCss" => $css, "previewCssStr" => $cssStr, "previewCanvas" => $previewCanvas, "users" => rand(1, 100));
 }
Beispiel #2
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $templateList = $this->service->findTemplateListForUserId($this->userId);
     $tplTemplates = array();
     foreach ($templateList as $tpl) {
         /*@var $tpl UHEADER_BOL_Template */
         $settings = $tpl->getSettings();
         $template = array("id" => $tpl->id, "src" => $this->service->getTemplateUrl($tpl), "css" => $tpl->getCssString(), "canvas" => $tpl->getCanvas(self::ITEM_WIDTH));
         $tplTemplates[] = $template;
     }
     $this->assign("templates", $tplTemplates);
     $this->assign("dimensions", $this->dimensions);
     $js = UTIL_JsGenerator::composeJsString('UHEADER.GallerySwitcher.registerTab({$tabKey}, new UHEADER.TemplateGallery({$params}, _scope));', array('params' => array('userId' => $this->userId, 'tabKey' => $this->tabKey, "dimensions" => $this->dimensions), "tabKey" => $this->tabKey));
     OW::getDocument()->addOnloadScript($js);
 }
Beispiel #3
0
 private function getTplInfo(UHEADER_BOL_Template $template)
 {
     $canvas = $template->getCanvas();
     $previewCanvas = $template->getCanvas(self::ITEM_WIDTH);
     $css = $template->getCss();
     $cssStr = $template->getCssString();
     $roles = $this->service->getRoleIdsForTemplateId($template->id);
     return array("id" => $template->id, "default" => (bool) $template->default, "src" => $this->service->getTemplateUrl($template), "data" => $template->getSettings(), "css" => $css, "cssStr" => $cssStr, "canvas" => $canvas, "previewCss" => $css, "previewCssStr" => $cssStr, "previewCanvas" => $previewCanvas, "users" => $this->service->findTemplateUsageCount($template->id), "roles" => $roles, "url" => OW::getRouter()->urlForRoute("uheader-settings-gallery-item", array("tplId" => $template->id)));
 }