Пример #1
0
 /**
  * Get the Typeframe response for the specified path.
  * @param string $uri
  * @return \Typeframe_Response
  */
 public function responseAt($uri)
 {
     return Typeframe_Response::At($uri);
 }
Пример #2
0
//if (!$page->exists() || ('Content' != $page->get('application')) || $page['siteid'] != Typeframe::CurrentPage()->siteid())
if (!$page->exists() || $page['siteid'] != Typeframe::CurrentPage()->siteid()) {
    Typeframe::Redirect('Invalid page.', $typef_app_dir, -1);
    return;
}
if ($page['application'] == 'Content') {
    // get template from settings; expand to its full value
    $settings = $page['settings'];
    $template = @$settings['template'];
    if (!$template) {
        $template = 'generic.html';
    }
    $template = "/content/{$template}";
    $full_template = TYPEF_SOURCE_DIR . "/templates{$template}";
} else {
    $response = Typeframe_Response::At(TYPEF_WEB_DIR . $page['uri']);
    $template = $response->getPageTemplate();
    $full_template = Typeframe_Skin::TemplatePath($template, $response->applicationUri());
}
// cannot edit content if template does not exist
if (!file_exists($full_template)) {
    Typeframe::Redirect("Unable to find page template ({$template}).", $typef_app_dir, -1);
    return;
}
$skin = Typeframe_Skin::At(TYPEF_WEB_DIR . $page['uri']);
$stylesheets = Typeframe_Skin::StylesheetsFor($template, TYPEF_WEB_DIR . $page['uri']);
$pm->setVariable('stylesheets', $stylesheets);
// load inserts and groups for template
$inserts = Insertable::ElementsFrom($full_template, TYPEF_WEB_DIR . $page['uri']);
$groups = Insertable::GroupsFrom($full_template, null, $skin);
// get revision id, if any