コード例 #1
0
ファイル: Index.php プロジェクト: rafasashi/sd-laravel
 public function index_onOpenTemplate()
 {
     $this->validateRequestTheme();
     $type = Request::input('type');
     $template = $this->loadTemplate($type, Request::input('path'));
     $widget = $this->makeTemplateFormWidget($type, $template);
     $this->vars['templatePath'] = Request::input('path');
     if ($type == 'page') {
         $router = new RainRouter();
         $this->vars['pageUrl'] = $router->urlFromPattern($template->url);
     }
     return ['tabTitle' => $this->getTabTitle($type, $template), 'tab' => $this->makePartial('form_page', ['form' => $widget, 'templateType' => $type, 'templateTheme' => $this->theme->getDirName(), 'templateMtime' => $template->mtime])];
 }
コード例 #2
0
 /**
  * Returns the URL from a page object, including current parameter values.
  * @return string
  */
 protected function makeLocaleUrlFromPage($locale)
 {
     $page = $this->getPage();
     /*
      * Static Page
      */
     if (isset($page->apiBag['staticPage'])) {
         $staticPage = $page->apiBag['staticPage'];
         $staticPage->rewriteTranslatablePageUrl($locale);
         $localeUrl = array_get($staticPage->attributes, 'viewBag.url');
     } else {
         $page->rewriteTranslatablePageUrl($locale);
         $router = new RainRouter();
         $params = $this->getRouter()->getParameters();
         $localeUrl = $router->urlFromPattern($page->url, $params);
     }
     return $localeUrl;
 }