Esempio n. 1
0
<?php

$site->setArray($_POST, false);
$site->save();
if ($site['masterid']) {
    $masterPages = new Model_Site_Master_Page();
    $masterPages->where('masterid = ?', $site['masterid']);
    foreach ($masterPages->select() as $mp) {
        $realPages = new Model_Page();
        $realPages->where('siteid = ?', $site['id']);
        $realPages->where('uri = ?', $mp['uri']);
        $realPage = $realPages->getFirst();
        if (!$realPage->exists()) {
            $realPage = Model_Page::Create();
            $realPage['siteid'] = $site['id'];
        }
        $realPage->setArray($mp->getArray(), false);
        $realPage->save();
    }
}
Esempio n. 2
0
File: add.php Progetto: ssrsfs/blg
<?php

$master = Model_Site_Master::Get($_REQUEST['masterid']);
if ($master->exists()) {
    $pm->setVariable('master', $master);
    $page = Model_Site_Master_Page::Create();
    include 'options.inc.php';
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        include 'update.inc.php';
        Typeframe::Redirect('Page created.', Typeframe::CurrentPage()->applicationUri() . '/masters/pages?masterid=' . $master['id']);
    }
} else {
    Typeframe::Redirect('Invalid master specified.', Plugin_Breadcrumbs::SavedState(Typeframe::CurrentPage()->applicationUri() . '/master'));
}
Esempio n. 3
0
<?php

$pageid = @$_REQUEST['pageid'];
$page = Model_Site_Master_Page::Get($pageid);
if ($page->exists()) {
    $settings = $page->get('settings');
    if ($settings) {
        $pm->addLoop('settings', $settings);
    }
}
$name = $_REQUEST['application'];
$application = Typeframe::Registry()->application($name);
if ($application && $application->admin()) {
    if (file_exists(TYPEF_SOURCE_DIR . '/scripts' . $application->admin() . '/settings.php')) {
        Typeframe::IncludeScript($application->admin() . '/settings.php');
    }
}
Esempio n. 4
0
File: edit.php Progetto: ssrsfs/blg
<?php

$master = Model_Site_Master::Get($_REQUEST['masterid']);
if ($master->exists()) {
    $pm->setVariable('master', $master);
    $page = Model_Site_Master_Page::Get($_REQUEST['pageid']);
    include 'options.inc.php';
    if ($page->exists()) {
        $pm->setVariable('page', $page);
        $pm->setVariable('pageid', $page->get('id'));
        $settings = $page->get('settings');
        $pm->setVariable('settings', $settings);
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
            include 'update.inc.php';
            Typeframe::Redirect('Page updated.', Typeframe::CurrentPage()->applicationUri() . '/masters/pages?masterid=' . $master['id']);
        }
    } else {
        Typeframe::Redirect('Invalid page specified.', Typeframe::CurrentPage()->applicationUri() . '/masters/pages?masterid=' . $master['id']);
    }
} else {
    Typeframe::Redirect('Invalid master specified.', Plugin_Breadcrumbs::SavedState(Typeframe::CurrentPage()->applicationUri() . '/masters'));
}
Esempio n. 5
0
File: index.php Progetto: ssrsfs/blg
<?php

$master = Model_Site_Master::Get($_REQUEST['masterid']);
if ($master->exists()) {
    $pm->setVariable('master', $master);
    $pages = new Model_Site_Master_Page();
    $pages->where('masterid = ?', $master['id']);
    $pm->setVariable('pages', $pages);
} else {
    Typeframe::Redirect('Invalid master specified.', Plugin_Breadcrumbs::SavedState(Typeframe::CurrentPage()->applicationUri() . '/master'));
}