class Page
Methods for working with CMS pages Source code (128 results)/modules/HomePage/Controllers/Admin/HomePageAdminController.php Highlighted file source
Line 14: namespace SproutModules\Karmabunny\HomePage\Controllers\Admin; Line 17: use Sprout\Controllers\Admin\PageAdminController; Line 22: * Showing and editing of the home page Line 24: class HomePageAdminController extends ManagedAdminController Line 26: protected $controller_name = 'home_page'; Line 27: protected $friendly_name = 'Home page'; Line 28: protected $navigation_name = 'Pages'; Line 29: protected $table_name = 'homepages'; Line 51: * Proxies navigation to the 'page' controller. Line 55: $pages = new PageAdminController(); Line 56: return $pages->_getNavigation(); Line 61: * Proxies tools to the 'page' controller. Line 65: $ctlr = new PageAdminController(); Line 75: return 'page';
/modules/HomePage/Controllers/HomePageController.php Highlighted file source
Line 14: namespace SproutModules\Karmabunny\HomePage\Controllers; Line 19: use SproutModules\Karmabunny\HomePage\Helpers\HomePages; Line 26: * Handles requests for the home page Line 28: class HomePageController extends Controller Line 31: * Renders the home page Line 37: $page = HomePages::getForSubSite(0); Line 42: if (!empty($page['alt_browser_title'])) $browser_title = $page['alt_browser_title']; Line 43: if (!empty($page['meta_keywords'])) Needs::addMeta('keywords', $page['meta_keywords']); Line 44: if (!empty($page['meta_description'])) Needs::addMeta('description', $page['meta_description']); Line 70: $view->page = $page;
/modules/HomePage/Helpers/HomePages.php Highlighted file source
Line 14: namespace SproutModules\Karmabunny\HomePage\Helpers; Line 21: * Functions for dealing with promo and banner images on the home page(s) Line 23: class HomePages Line 26: * Return home page record for given sub-site Line 37: FROM ~homepages AS home Line 45: * Return list of active banners for given home page Line 47: * @param int $homepage_id Home page record ID Line 51: public static function getActiveBanners($homepage_id, $limit = 0) Line 62: ~homepage_banners AS banner Line 68: AND banner.homepage_id = ? Line 76: return Pdb::query($q, [$homepage_id], 'arr'); Line 81: * Return list of active promos for given home page Line 83: * @param int $homepage_id Home page record ID Line 87: public static function getActivePromos($homepage_id, $limit) Line 98: ~homepage_promos AS promo Line 104: AND promo.homepage_id = ? Line 112: return Pdb::query($q, [$homepage_id], 'arr'); Line 117: * Return a randomly selected active banner for given home page Line 119: * @param int $homepage_id Home page record ID Line 123: public static function getRandomActiveBanner($homepage_id) Line 132: ~homepage_banners AS banner Line 138: AND banner.homepage_id = ? Line 145: return Pdb::query($q, [$homepage_id], 'row');
/modules/Welcome/Controllers/WelcomeController.php Highlighted file source
Line 55: * Redirect home page traffic to the welcome checklist Line 181: $q = "SELECT * FROM ~pages LIMIT 1"; Line 202: $q = "SELECT COUNT(*) FROM ~pages LIMIT 1"; Line 203: $num_pages = Pdb::query($q, [], 'val'); Line 204: return [$num_pages > 0]; Line 631: $num_pages = Pdb::query("SELECT COUNT(*) FROM ~pages LIMIT 1", [], 'val'); Line 639: if ($num_pages or $num_files) { Line 645: $this->addSamplePages(); Line 646: $this->addSampleHomePage(); Line 658: Pdb::query("DELETE FROM ~page_widgets", [], 'null'); Line 659: Pdb::query("DELETE FROM ~page_revisions", [], 'null'); Line 660: Pdb::query("DELETE FROM ~pages", [], 'null'); Line 661: Pdb::query("DELETE FROM ~homepage_banners", [], 'null'); Line 662: Pdb::query("DELETE FROM ~homepage_promos", [], 'null'); Line 715: * Add sample files from sample_content/pages.xml Line 717: private function addSamplePages() Line 719: $xml = file_get_contents(DOCROOT . 'modules/Welcome/sample_content/pages.xml'); Line 722: $page_id = 0; Line 724: foreach ($xml->page as $elem) { Line 728: $page_id += 1; Line 737: $data['id'] = $page_id; Line 747: Pdb::insert('pages', $data); Line 748: $parent_lookup[$name] = $page_id; Line 751: $data['page_id'] = $page_id; Line 754: $data['modified_editor'] = 'Sample pages tool'; Line 755: $data['changes_made'] = 'Added sample page'; Line 758: $revision_id = Pdb::insert('page_revisions', $data); Line 761: $data['page_revision_id'] = $revision_id; Line 767: Pdb::insert('page_widgets', $data); Line 773: * Updates to home page - hardcoded rather than an xml file Line 775: private function addSampleHomePage() Line 780: Pdb::update('homepages', $data, ['id' => 1]); Line 783: $data['homepage_id'] = 1; Line 788: $data['link'] = json_encode(['class' => '\Sprout\Helpers\LinkSpecPage', 'data' => '3']); Line 790: Pdb::insert('homepage_banners', $data); Line 793: $data['homepage_id'] = 1; Line 799: $data['link'] = json_encode(['class' => '\Sprout\Helpers\LinkSpecPage', 'data' => '4']); Line 800: Pdb::insert('homepage_promos', $data); Line 803: $data['homepage_id'] = 1; Line 809: $data['link'] = json_encode(['class' => '\Sprout\Helpers\LinkSpecPage', 'data' => '9']); Line 811: Pdb::insert('homepage_promos', $data); Line 814: $data['homepage_id'] = 1; Line 820: $data['link'] = json_encode(['class' => '\Sprout\Helpers\LinkSpecPage', 'data' => '10']); Line 821: Pdb::insert('homepage_promos', $data);
/sprout/config/routes.php Highlighted file source
Line 25: $config['_default'] = 'SproutModules\Karmabunny\HomePage\Controllers\HomePageController'; Line 95: $config['page/view_by_name/([^/]+)'] = 'Sprout\\Controllers\\PageController/viewByName/$1'; Line 96: $config['page/view_by_id/([0-9]+)'] = 'Sprout\\Controllers\\PageController/viewById/$1'; Line 97: $config['page/view_specific_rev/([0-9]+)/([0-9]+(?:/[a-zA-Z0-9]+)?)'] = 'Sprout\\Controllers\\PageController/viewSpecificRev/$1/$2'; Line 98: $config['page/preview_store/([0-9]+)'] = 'Sprout\\Controllers\\PageController/previewStore/$1'; Line 99: $config['page/preview/([0-9]+)'] = 'Sprout\\Controllers\\PageController/preview/$1'; Line 100: $config['page/additional_css/([0-9]+)/([^/]+)'] = 'Sprout\\Controllers\\PageController/additionalCss/$1/$2'; Line 101: $config['page/additional_css/([0-9]+)'] = 'Sprout\\Controllers\\PageController/additionalCss/$1'; Line 102: $config['page/front_end_search/([0-9]+)/([^/]+)/([^/]+)'] = 'Sprout\\Controllers\\PageController/frontEndSearch/$1/$2/$3'; Line 103: $config['page/review/([0-9]+)'] = 'Sprout\\Controllers\\PageController/review/$1';
/sprout/config/routes.php Highlighted file source
Line 25: $config['_default'] = 'SproutModules\Karmabunny\HomePage\Controllers\HomePageController'; Line 95: $config['page/view_by_name/([^/]+)'] = 'Sprout\\Controllers\\PageController/viewByName/$1'; Line 96: $config['page/view_by_id/([0-9]+)'] = 'Sprout\\Controllers\\PageController/viewById/$1'; Line 97: $config['page/view_specific_rev/([0-9]+)/([0-9]+(?:/[a-zA-Z0-9]+)?)'] = 'Sprout\\Controllers\\PageController/viewSpecificRev/$1/$2'; Line 98: $config['page/preview_store/([0-9]+)'] = 'Sprout\\Controllers\\PageController/previewStore/$1'; Line 99: $config['page/preview/([0-9]+)'] = 'Sprout\\Controllers\\PageController/preview/$1'; Line 100: $config['page/additional_css/([0-9]+)/([^/]+)'] = 'Sprout\\Controllers\\PageController/additionalCss/$1/$2'; Line 101: $config['page/additional_css/([0-9]+)'] = 'Sprout\\Controllers\\PageController/additionalCss/$1'; Line 102: $config['page/front_end_search/([0-9]+)/([^/]+)/([^/]+)'] = 'Sprout\\Controllers\\PageController/frontEndSearch/$1/$2/$3'; Line 103: $config['page/review/([0-9]+)'] = 'Sprout\\Controllers\\PageController/review/$1';
/sprout/Controllers/Admin/ExtraPageAdminController.php Highlighted file source
Line 27: * Handles most processing for Extra pages Line 29: class ExtraPageAdminController extends ManagedAdminController Line 31: protected $controller_name = 'extra_page'; Line 32: protected $friendly_name = 'Snippet pages'; Line 45: $this->extra_page_types = Register::getExtraPages(); Line 49: 'Type' => array(new ColModifierLookupArray($this->extra_page_types), 'type'), Line 56: $this->refine_bar->addWidget(new RefineWidgetSelect('type', 'Type', $this->extra_page_types)); Line 75: FROM ~extra_pages Line 82: if (isset($this->extra_page_types[$row['type']])) { Line 83: $snippets[$row['id']] = $this->extra_page_types[$row['type']]; Line 87: $view = new View('sprout/admin/extra_page_sidebar'); Line 135: $types = Register::getExtraPages(); Line 138: FROM ~extra_pages Line 183: $item_id = Pdb::insert('extra_pages', $update_fields); Line 185: $res = $this->logAdd('extra_pages', $item_id); Line 243: $logdata = $this->loadRecord('extra_pages', $item_id); Line 245: Pdb::update('extra_pages', $update_fields, ['id' => $item_id]); Line 247: $res = $this->logEdit('extra_pages', $item_id, $logdata); Line 263: $labels = Register::getExtraPages();
/sprout/Controllers/Admin/ExtraPageAdminController.php Highlighted file source
Line 27: * Handles most processing for Extra pages Line 29: class ExtraPageAdminController extends ManagedAdminController Line 31: protected $controller_name = 'extra_page'; Line 32: protected $friendly_name = 'Snippet pages'; Line 45: $this->extra_page_types = Register::getExtraPages(); Line 49: 'Type' => array(new ColModifierLookupArray($this->extra_page_types), 'type'), Line 56: $this->refine_bar->addWidget(new RefineWidgetSelect('type', 'Type', $this->extra_page_types)); Line 75: FROM ~extra_pages Line 82: if (isset($this->extra_page_types[$row['type']])) { Line 83: $snippets[$row['id']] = $this->extra_page_types[$row['type']]; Line 87: $view = new View('sprout/admin/extra_page_sidebar'); Line 135: $types = Register::getExtraPages(); Line 138: FROM ~extra_pages Line 183: $item_id = Pdb::insert('extra_pages', $update_fields); Line 185: $res = $this->logAdd('extra_pages', $item_id); Line 243: $logdata = $this->loadRecord('extra_pages', $item_id); Line 245: Pdb::update('extra_pages', $update_fields, ['id' => $item_id]); Line 247: $res = $this->logEdit('extra_pages', $item_id, $logdata); Line 263: $labels = Register::getExtraPages();
/sprout/Controllers/Admin/ManagedAdminController.php Highlighted file source
Line 162: * The default number of records to show per page Line 164: protected $records_per_page = 50; Line 949: if (empty($_GET['page'])) $_GET['page'] = 1; Line 950: $_GET['page'] = (int) $_GET['page']; Line 980: $offset = $this->records_per_page * ($_GET['page'] - 1); Line 982: $q .= " LIMIT {$this->records_per_page} OFFSET {$offset}"; Line 1028: if ($total_row_count > $this->records_per_page) { Line 1029: $paginate = $this->_paginationBar($_GET['page'], $total_row_count); Line 1108: * Builds the HTML for showing the navigation through pages in the admin. Line 1111: * @param $current_page The current page. 1-based index. Line 1115: final protected function _paginationBar($current_page, $total_row_count) { Line 1116: $total_page_count = ceil($total_row_count / $this->records_per_page); Line 1124: if ($current_page > 1) { Line 1125: $url = Url::withoutArgs('page') . 'page=' . ($current_page - 1); Line 1129: $paginate .= "<p class=\"paginate-bar-current-page\">Page {$current_page} of {$total_page_count}</p>"; Line 1131: if ($current_page < $total_page_count) { Line 1132: $url = Url::withoutArgs('page') . 'page=' . ($current_page + 1); Line 1186: * Returns a page title and HTML for a form to add a record Line 1360: * Returns a page title and HTML for a form to edit a record
/sprout/Controllers/Admin/ManagedAdminController.php Highlighted file source
Line 162: * The default number of records to show per page Line 164: protected $records_per_page = 50; Line 949: if (empty($_GET['page'])) $_GET['page'] = 1; Line 950: $_GET['page'] = (int) $_GET['page']; Line 980: $offset = $this->records_per_page * ($_GET['page'] - 1); Line 982: $q .= " LIMIT {$this->records_per_page} OFFSET {$offset}"; Line 1028: if ($total_row_count > $this->records_per_page) { Line 1029: $paginate = $this->_paginationBar($_GET['page'], $total_row_count); Line 1108: * Builds the HTML for showing the navigation through pages in the admin. Line 1111: * @param $current_page The current page. 1-based index. Line 1115: final protected function _paginationBar($current_page, $total_row_count) { Line 1116: $total_page_count = ceil($total_row_count / $this->records_per_page); Line 1124: if ($current_page > 1) { Line 1125: $url = Url::withoutArgs('page') . 'page=' . ($current_page - 1); Line 1129: $paginate .= "<p class=\"paginate-bar-current-page\">Page {$current_page} of {$total_page_count}</p>"; Line 1131: if ($current_page < $total_page_count) { Line 1132: $url = Url::withoutArgs('page') . 'page=' . ($current_page + 1); Line 1186: * Returns a page title and HTML for a form to add a record Line 1360: * Returns a page title and HTML for a form to edit a record
/sprout/Controllers/Admin/PageAdminController.php Highlighted file source
Line 21: use Sprout\Controllers\PageController; Line 52: use Sprout\Helpers\Page; Line 75: * Handles admin processing for pages Line 77: class PageAdminController extends TreeAdminController Line 79: protected $controller_name = 'page'; Line 80: protected $friendly_name = 'Pages'; Line 90: $this->refine_bar->setGroup('Pages'); Line 93: $this->refine_bar->setGroup('Page content'); Line 124: return "item.id IN (SELECT record_id FROM ~page_keywords AS pk Line 130: return "item.id IN (SELECT page_id FROM ~page_revisions AS rev Line 161: $q = "SELECT id FROM ~homepages WHERE subsite_id = ?"; Line 163: $view = new View('sprout/admin/page_navigation'); Line 164: $view->home_page_id = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'val'); Line 177: $view = new View('sprout/admin/page_add_save'); Line 193: 'url' => 'admin/add/page', Line 194: 'name' => 'Add a standard page', Line 198: 'url' => 'admin/add/page?type=tool', Line 199: 'name' => 'Add a tool page', Line 208: * Returns the add form for adding a page Line 262: $title = 'Add a page'; Line 265: $title = 'Add a tool page'; Line 269: $view = new View('sprout/admin/page_add'); Line 286: * Saves the provided POST data into a new page in the database Line 288: * @param int $page_id After saving, the new record id will be returned in this parameter Line 291: public function _addSave(&$page_id) Line 312: Slug::unique(Enc::urlname((string)@$_POST['name'], '-'), 'pages', $conds); Line 318: // Validate fields specific to tool pages Line 321: if (!self::checkControllerEntrance($_POST['controller_entrance'], $page_id)) { Line 326: $_POST['current_url'] = 'admin/add/page?type=tool'; Line 336: if (!in_array($_POST['type'], Pdb::extractEnumArr('page_revisions', 'type'))) { Line 346: // Add page Line 375: $page_id = Pdb::insert('pages', $update_fields); Line 377: $this->fixRecordOrder($page_id); Line 380: $res = $this->addHistoryItem($page_id, 'Created empty new page'); Line 385: $update_fields['page_id'] = $page_id; Line 387: $update_fields['changes_made'] = 'New page'; Line 390: // Normal pages have more data to add on the edit form, but tool pages go live straight away Line 403: Pdb::insert('page_revisions', $update_fields); Line 413: $update_fields['item_id'] = $page_id; Line 416: Pdb::insert('page_admin_permissions', $update_fields); Line 429: $update_fields['item_id'] = $page_id; Line 432: Pdb::insert('page_user_permissions', $update_fields); Line 442: Notification::confirm('Your page has been created. Add your content below.'); Line 444: return 'admin/edit/' . $this->controller_name . '/' . $page_id . '?suppress=true'; Line 463: $view = new View('sprout/admin/page_import_upload'); Line 562: Url::redirect("admin/import_upload/page"); Line 565: Url::redirect("admin/import_options/page?timestamp={$timestamp}&ext=xml"); Line 570: * Preview the pages which will be created Line 578: echo '<div class="info highlight-confirm">This is a preview of the pages which will be created</div>'; Line 583: echo '<li>', ($_GET['page_name'] ? Enc::html($_GET['page_name']) : '<i>Enter a page name into the field above</i>'), '</li>'; Line 590: if (trim($_GET['top_page_name'])) { Line 591: $tree['name'] = trim($_GET['top_page_name']); Line 635: $view = new View('sprout/admin/page_import_options'); Line 677: if ($_POST['import_type'] == 'none' and !$_POST['page_name']) { Line 728: // Split into pages based on options Line 737: $node['name'] = $_POST['page_name']; Line 753: if (trim($_POST['top_page_name'])) { Line 754: $tree['name'] = trim($_POST['top_page_name']); Line 766: // Walk page tree and create pages Line 770: $result = $this->createPageTreenode($child, (int)$_POST['parent_id'], $images, $headings, $operator); Line 776: Notification::confirm('Imported ' . $count . ' ' . Inflector::plural('page', $count)); Line 782: * Create a page Line 784: private function createPageTreenode($node, $parent_id, $images, $headings, $operator) Line 790: // Add page Line 801: $page_id = Pdb::insert('pages', $update_fields); Line 803: $this->fixRecordOrder($page_id); Line 807: $update_fields['page_id'] = $page_id; Line 809: $update_fields['changes_made'] = 'Imported page from uploaded file'; Line 814: $rev_id = Pdb::insert('page_revisions', $update_fields); Line 821: $update_fields['page_revision_id'] = $rev_id; Line 827: Pdb::insert('page_widgets', $update_fields); Line 829: // History page Line 830: $res = $this->addHistoryItem($page_id, "Imported page from uploaded file"); Line 833: // Do indexing on the page text Line 834: $res = $this->reindexItem($page_id, $node['name'], $html); Line 837: // Children pages Line 840: $count += $this->createPageTreenode($child, $page_id, $images, $headings, $operator); Line 861: $view = new View('sprout/admin/page_edit_save'); Line 863: $view->preview_url = Subsites::getAbsRootAdmin() . 'admin/call/page/preview/' . $item_id; Line 882: return Page::url($item_id); Line 887: * Returns the edit form for editing the specified page Line 904: // Load the page Line 905: $q = "SELECT * FROM ~pages WHERE id = ?"; Line 907: $page = Pdb::q($q, [$id], 'row'); Line 909: return new AdminError("Invalid id specified - page does not exist"); Line 915: if (empty($page['slug'])) $page['slug'] = Enc::urlname($page['name']); Line 917: // Check the permissions of the page - can the operator edit this page? Line 918: $res = AdminPerms::checkPermissionsTree('pages', $id); Line 919: if (! $res) return new AdminError("Access denied to modify this page"); Line 922: $q = "SELECT page_revisions.*, DATE_FORMAT(date_modified, '%d/%m/%Y %h:%i %p') AS date_modified Line 923: FROM ~page_revisions AS page_revisions Line 924: WHERE page_id = ? Line 925: ORDER BY page_revisions.date_modified DESC"; Line 928: return new AdminError("Invalid id specified - page does not have any revisions"); Line 975: $data = array_merge($page, $sel_rev); Line 978: if (in_array(@$_GET['type'], Pdb::extractEnumArr('page_revisions', 'type'))) { Line 998: // Load widgets and collate rich text as page text Line 1002: FROM ~page_widgets Line 1003: WHERE page_revision_id = ? Line 1026: AdminSeo::setTopic($page['name']); Line 1029: AdminSeo::addLinks(Page::determineRelatedLinks($id)); Line 1035: return new AdminError("Invalid page type"); Line 1038: // Load permissions for page Line 1039: $admin_permissions = AdminPerms::getAccessableGroups('pages', $id); Line 1048: $user_permissions = UserPerms::getAccessableGroups('pages', $id); Line 1067: FROM ~page_history_items AS page_history_items Line 1068: WHERE page_id = ? Line 1069: ORDER BY page_history_items.date_added DESC"; Line 1093: $attributes = MultiEdit::load('page_attributes', ['page_id' => $id]); Line 1107: // Special case for redirect pages Line 1112: $admin_notes = 'This page redirects to an ' . $typename . '. Content blocks on this page have been disabled.'; Line 1114: $admin_notes = 'This page redirects to a ' . $typename . '. Content blocks on this page have been disabled.'; Line 1117: $admin_notes = 'This page will redirect. Content blocks on this page have been disabled.'; Line 1128: $view = new View('sprout/admin/page_edit'); Line 1137: $view->page = $page; Line 1164: $view->show_tour = !Admin::isTourCompleted('page_edit'); Line 1167: $title = 'Editing revision ' . $rev_num . ' of page <strong>' . Enc::html($page['name']) . '</strong>'; Line 1169: $title = 'Editing page <strong>' . Enc::html($page['name']) . '</strong>'; Line 1187: $rev = Pdb::get('page_revisions', $id); Line 1224: * Return a list of menu groups for a selected parent page Line 1226: public function ajaxGetMenuGroups($parent_page_id) Line 1229: $parent_page_id = (int) $parent_page_id; Line 1232: if ($parent_page_id === 0) { Line 1237: // Find the page Line 1238: $root = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 1239: $node = $root->findNodeValue('id', $parent_page_id); Line 1240: if ($node === null) Json::error('Invalid parent page'); Line 1266: * Saves the provided POST data into this page in the database Line 1268: * @param int $page_id The record to update Line 1271: public function _editSave($page_id) Line 1273: $res = AdminPerms::checkPermissionsTree('pages', $page_id); Line 1276: $page_id = (int) $page_id; Line 1279: $q = "SELECT page.*, rev.type, rev.controller_entrance, rev.controller_argument, rev.redirect Line 1280: FROM ~pages AS page Line 1281: INNER JOIN ~page_revisions AS rev ON page.id = rev.page_id Line 1283: WHERE page.id = ?"; Line 1284: $orig_page = Pdb::q($q, [$rev_id, $page_id], 'row'); Line 1287: $page_type = (string) @$_POST['type']; Line 1288: if (!in_array($page_type, Pdb::extractEnumArr('page_revisions', 'type'))) { Line 1289: $page_type = $orig_page['type']; Line 1292: if ($page_type != $orig_page['type']) $revision_changed = true; Line 1351: FROM ~page_widgets Line 1352: WHERE page_revision_id = ? Line 1368: $q = "SELECT rev.*, page.parent_id Line 1369: FROM ~page_revisions AS rev Line 1370: INNER JOIN ~pages AS page ON page.id = rev.page_id Line 1374: // Pretend there's an existing revision when going a page preview Line 1386: if ($page_type == 'standard') { Line 1411: } else if ($page_type == 'tool') { Line 1412: if ($orig_page['controller_entrance'] != $_POST['controller_entrance']) $revision_changed = true; Line 1413: if ($orig_page['controller_argument'] != $_POST['controller_argument']) $revision_changed = true; Line 1414: } else if ($page_type == 'redirect') { Line 1415: if ($orig_page['redirect'] != $_POST['redirect']) $revision_changed = true; Line 1420: if ((int) $orig_page['parent_id'] != (int) $_POST['parent_id']) { Line 1431: 'parent_id' => 'Parent page', Line 1444: ['id', '!=', $page_id], Line 1446: $valid->check('slug', 'Slug::unique', 'pages', $slug_conditions); Line 1453: if ($page_type == 'standard') { Line 1475: } else if ($page_type == 'tool') { Line 1478: if (!self::checkControllerEntrance($_POST['controller_entrance'], $page_id)) { Line 1481: } else if ($page_type == 'redirect') { Line 1490: if ($orig_page['id'] == $_POST['parent_id']) { Line 1491: $valid->addFieldError('parent_id', 'A page can\'t be its own parent.'); Line 1495: $root_node = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 1500: if ($anc['id'] == $page_id) { Line 1501: $valid->addFieldError('parent_id', 'You can\'t set a descendent of this page as its parent'); Line 1522: // Update page Line 1532: if ($page_type == 'standard') { Line 1545: if (Kohana::config('page.enable_banners')) { Line 1580: Pdb::update('pages', $update_fields, ['id' => $page_id]); Line 1582: if ($parent_changed) $this->fixRecordOrder($page_id); Line 1605: Pdb::update('page_revisions', $update_fields, ['page_id' => $page_id, 'id' => $rev_id]); Line 1607: $res = $this->addHistoryItem($page_id, "Updated revision {$rev_id}"); Line 1612: $update_fields['page_id'] = $page_id; Line 1616: $rev_id = Pdb::insert('page_revisions', $update_fields); Line 1618: $res = $this->addHistoryItem($page_id, "Created new revision {$rev_id}"); Line 1624: Page::activateRevision($rev_id); Line 1628: Pdb::delete('page_widgets', ['page_revision_id' => $rev_id]); Line 1632: $update_fields['page_revision_id'] = $rev_id; Line 1633: Pdb::insert('page_widgets', $update_fields); Line 1642: Pdb::update('page_revisions', $update_fields, ['page_id' => $page_id, 'id' => $rev_id]); Line 1668: Pdb::delete('page_admin_permissions', ['item_id' => $page_id]); Line 1677: $update_fields['item_id'] = $page_id; Line 1680: Pdb::insert('page_admin_permissions', $update_fields); Line 1687: Pdb::delete('page_user_permissions', ['item_id' => $page_id]); Line 1696: $update_fields['item_id'] = $page_id; Line 1699: Pdb::insert('page_user_permissions', $update_fields); Line 1706: Pdb::delete('page_attributes', ['page_id' => $page_id]); Line 1713: $update_fields['page_id'] = (int) $page_id; Line 1717: Pdb::insert('page_attributes', $update_fields); Line 1722: // Do indexing on the page text, which is found in the embedded widgets Line 1723: $text = Page::getText($page_id, $rev_id, $_SESSION['admin']['active_subsite']); Line 1728: $view = new View('sprout/email/page_need_check'); Line 1729: $view->page = $_POST; Line 1732: $view->url = Sprout::absRoot() . "page/view_specific_rev/{$page_id}/{$rev_id}/{$approval_code}"; Line 1737: $mail->Subject = 'Page change approval required for ' . Kohana::config('sprout.site_title'); Line 1745: $view = new View('sprout/email/page_notify'); Line 1746: $view->page = $_POST; Line 1748: $view->url = Sprout::absRoot() . "page/view_specific_rev/{$page_id}/{$rev_id}"; Line 1757: $mail->Subject = 'Page updated on site ' . Kohana::config('sprout.site_title') . ': ' . $_POST['name']; Line 1765: $res = $this->reindexItem($page_id, $_POST['name'], $text); Line 1766: if (!$res) Notification::error('Failed to index page text'); Line 1769: if ($page_type != $orig_page['type']) { Line 1770: $this->addHistoryItem($page_id, "Changed the page type"); Line 1771: if (empty($this->in_preview)) Notification::confirm('Page type has been changed.'); Line 1783: return "admin/edit/page/{$page_id}?revision={$rev_id}"; Line 1791: * Page organisation tool Line 1801: 'title' => 'Organise pages', Line 1808: * Page organisation tool Line 1813: $view = new View('sprout/admin/page_menu_groups'); Line 1844: foreach ($all_groups as $page_id => $groups) { Line 1852: $conditions['page_id'] = (int)$page_id; Line 1861: $update_data['page_id'] = (int)$page_id; Line 1864: $update_data['text'] = $_POST['extras'][$page_id]['text']; Line 1867: if (empty($_POST['extras'][$page_id]['image'])) { Line 1868: $_POST['extras'][$page_id]['image'] = null; Line 1870: $update_data['image'] = $_POST['extras'][$page_id]['image']; Line 1877: unset($update_data['page_id']); Line 1878: Pdb::update('menu_extras', $update_data, array('page_id' => $page_id)); Line 1884: Url::redirect('admin/extra/page/menu_groups'); Line 1889: * Adds a history item for a page Line 1891: private function addHistoryItem($page_id, $changes_made, $editor = null) Line 1901: $update_fields['page_id'] = $page_id; Line 1906: $res = Pdb::insert('page_history_items', $update_fields); Line 1912: * Returns the edit form for editing the specified page Line 1921: $view = new View('sprout/admin/page_delete'); Line 1924: // Load page details Line 1925: $q = "SELECT * FROM ~pages WHERE id = ?"; Line 1927: $view->page = Pdb::q($q, [$id], 'row'); Line 1929: return new AdminError("Invalid id specified - page does not exist"); Line 1933: $res = AdminPerms::checkPermissionsTree('pages', $id); Line 1934: if (! $res) return new AdminError("Access denied to delete this page"); Line 1936: // Children pages Line 1939: $child_pages = ($node ? $node->children : []); Line 1940: foreach ($child_pages as $child) { Line 1943: $child_pages[] = $descendent; Line 1946: $view->child_pages = $child_pages; Line 1949: 'title' => 'Deleting page <strong>' . Enc::html($view->page['name']) . '</strong>', Line 1963: if (!AdminPerms::checkPermissionsTree('pages', $item_id)) { Line 1981: * Shows the links (incoming and outgoing) for a page Line 1987: $res = AdminPerms::checkPermissionsTree('pages', $id); Line 1988: if (! $res) return "Access denied to view this page"; Line 1990: $view = new View('sprout/admin/page_linklist'); Line 1993: // Load page details Line 1994: $q = "SELECT pages.name, revs.text Line 1995: FROM ~pages AS pages Line 1996: INNER JOIN ~page_revisions AS revs Line 1997: ON revs.page_id = pages.id AND revs.status = ? Line 1998: WHERE pages.id = ?"; Line 1999: $view->page = Pdb::q($q, ['live', $id], 'row'); Line 2006: $q = "SELECT pages.id, pages.name, revs.text Line 2007: FROM ~pages AS pages Line 2008: INNER JOIN ~page_revisions AS revs Line 2009: ON revs.page_id = pages.id Line 2028: 'Page' => 'name', Line 2037: $res = preg_match_all('/<a.*?href="(.+?)".*?>(.+?)<\/a>/i', $view->page->text, $matches, PREG_SET_ORDER); Line 2055: 'title' => 'Links for page <strong>' . Enc::html($view->page->name) . '</strong>', Line 2069: $intro = new View("sprout/admin/page_intro"); Line 2074: // Recently updated pages Line 2075: $q = "SELECT pages.id, pages.name, DATE_FORMAT(pages.date_modified, '%d/%m/%Y') AS date_modified, Line 2076: pages.modified_editor Line 2077: FROM ~pages AS pages Line 2079: ORDER BY pages.date_modified DESC Line 2094: $q = "SELECT pages.id, pages.name, DATE_FORMAT(page_revisions.date_modified, '%d/%m/%Y') AS date_modified, Line 2095: page_revisions.modified_editor Line 2096: FROM ~page_revisions AS page_revisions Line 2097: INNER JOIN ~pages AS pages ON page_revisions.page_id = pages.id Line 2098: WHERE page_revisions.status = ? Line 2100: ORDER BY page_revisions.date_modified DESC Line 2112: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs'); Line 2123: * Does a re-index for a page Line 2127: Search::selectIndex('page_keywords', $item_id); Line 2138: $res = Search::cleanup('pages'); Line 2145: * Does a complete re-index of all pages Line 2153: $q = "SELECT pages.id, pages.name, pages.active, widget.settings Line 2154: FROM ~pages AS pages Line 2155: INNER JOIN ~page_revisions AS rev Line 2156: ON rev.page_id = pages.id AND rev.status = ? Line 2157: LEFT JOIN ~page_widgets AS widget ON rev.id = widget.page_revision_id Line 2162: $pages = []; Line 2165: $pages[$row['id']] = ['name' => $row['name'], 'text' => '']; Line 2169: if (!isset($pages[$row['id']])) { Line 2170: $pages[$row['id']] = ['name' => $row['name'], 'text' => $settings['text']]; Line 2172: $pages[$row['id']]['text'] .= "\n" . $settings['text']; Line 2177: if (count($pages) == 0) { Line 2183: foreach ($pages as $id => $page) { Line 2184: $this->reindexItem($id, $page['name'], $page['text']); Line 2197: * @param int $page_id Page record ID Line 2200: private static function checkControllerEntrance($controller, $page_id) Line 2202: $page_id = (int) $page_id; Line 2215: * Returns the children pages for a specific page, in a format required by jqueryFileTree. Line 2225: Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 2247: $admin_perms = AdminPerms::checkPermissionsTree('pages', $top_node['id']); Line 2262: $admin_perms = AdminPerms::checkPermissionsTree('pages', $child['id']); Line 2284: echo "+ <a href=\"SITE/admin/add/page?parent_id={$top_node['id']}\">Add Child</a>"; Line 2286: echo "↕ <a href=\"SITE/page/reorder/{$top_node['id']}\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Re-order</a>"; Line 2297: * Saves in the session data the currently open pages in the pages tree (navigation pane) Line 2298: * Uses the POST param 'pages', and is usually run through an AJAX call. Line 2375: public function cronPageActivate() Line 2377: Cron::start('Activate pages'); Line 2383: $q = "SELECT id, page_id Line 2384: FROM ~page_revisions Line 2389: Cron::message("Launching revision {$row['id']} on page {$row['page_id']}"); Line 2392: Pdb::update('page_revisions', ['status' => 'live'], ['id' => $row['id']]); Line 2394: $this->addHistoryItem($row['page_id'], "AutoLaunched revision {$row['id']}", 'n/a'); Line 2397: 'page_id' => $row['page_id'], Line 2401: Pdb::update('page_revisions', ['status' => 'old'], $where); Line 2416: * Deactivates pages after set date Line 2418: public function cronPageDeactivate() Line 2420: Cron::start('De-activate pages'); Line 2427: FROM ~pages Line 2435: Cron::message("De-activating page {$row['id']}"); Line 2437: // Deactivate page Line 2438: Pdb::update('pages', ['active' => 0], ['id' => $row['id']]); Line 2440: $this->addHistoryItem($row['id'], "Deactivated page {$row['id']}", 'n/a'); Line 2462: $items[] = "<li class=\"import\"><a href=\"SITE/admin/import_upload/page\">Document import</a></li>"; Line 2465: $items[] = "<li class=\"action-log\"><a href=\"SITE/admin/search/{$this->controller_name}\">Search pages</a></li>"; Line 2468: $items[] = "<li class=\"action-log\"><a href=\"admin/extra/page/need_approval\">Pages needing approval</a></li>"; Line 2477: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/organise\">Sitemap manager</a></li>"; Line 2481: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/menu_groups\">Manage menu groups</a></li>"; Line 2484: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/link_checker\">Link checker</a></li>"; Line 2487: $items[] = "<li class=\"config\"><a href=\"page/clear_navigation_cache\">Clear navigation cache</a></li>"; Line 2529: Url::redirect('admin/extra/page/link_checker'); Line 2534: Url::redirect('admin/extra/page/link_checker'); Line 2545: Url::redirect('admin/extra/page/link_checker'); Line 2549: Url::redirect('admin/extra/page/link_checker_info/' . $info['job_id']); Line 2573: * List of pages which need approval Line 2581: $q = "SELECT pages.id, pages.name, revs.date_modified, revs.modified_editor Line 2582: FROM ~page_revisions AS revs Line 2583: INNER JOIN ~pages AS pages ON revs.page_id = pages.id Line 2585: AND pages.subsite_id = ? Line 2586: GROUP BY pages.id Line 2598: $itemlist->addAction('edit', 'admin/edit/page/%%'); Line 2601: 'title' => 'Pages needing approval', Line 2619: * Check for stale page content and send emails regarding stale pages; to be run via cron Line 2625: Cron::start('Stale page checker'); Line 2627: $email = Kohana::config('sprout.stale_page_email'); Line 2628: $default_max_age = Kohana::config('sprout.stale_page_age'); Line 2629: $resend_interval = (int) Kohana::config('sprout.stale_page_resend_after'); Line 2632: $q = "SELECT page.id, page.subsite_id, page.name, Line 2635: FROM ~pages AS page Line 2636: INNER JOIN ~page_revisions AS rev Line 2637: ON page.id = rev.page_id AND rev.status = 'live' AND rev.type = 'standard' Line 2640: WHERE page.active = 1 Line 2641: AND DATE_SUB(CURDATE(), INTERVAL ? DAY) >= page.stale_reminder_sent Line 2642: AND IFNULL(page.stale_age, ?) > 0 Line 2643: AND DATEDIFF(NOW(), rev.date_modified) >= IFNULL(page.stale_age, ?) Line 2644: ORDER BY age DESC, page.id"; Line 2648: Cron::message('No stale pages found'); Line 2656: $op_emails[0] = ['email' => $email, 'pages' => []]; Line 2660: $url = Page::url($id); Line 2665: $op_emails[0]['pages'][] = [ Line 2680: 'pages' => [], Line 2684: $op_emails[$op]['pages'][] = [ Line 2694: if (count($details['pages']) == 0) continue; Line 2697: $msg .= Inflector::numPlural(count($details['pages']), 'page'); Line 2700: $view = new View('sprout/email/pages_stale'); Line 2702: $view->pages = $details['pages']; Line 2716: Cron::message("Marking pages as sent"); Line 2722: $count = Pdb::q("UPDATE ~pages SET stale_reminder_sent = ? WHERE {$where}", $params, 'count'); Line 2723: Cron::message(Inflector::numPlural($count, 'page') . " marked as sent"); Line 2730: * Forces a clear of the pagecache Line 2738: Notification::confirm('Page cache has been cleared'); Line 2739: Url::redirect('admin/intro/page'); Line 2747: 'pages' => 1, Line 2748: 'page_revisions' => ['id' => $_POST['rev_id']], Line 2749: 'page_widgets' => 0, Line 2750: 'page_history_items' => 0, Line 2751: 'page_admin_permissions' => 1, Line 2752: 'page_user_permissions' => 1, Line 2753: 'page_attributes' => 0, Line 2754: 'page_keywords' => 0, Line 2765: $ctlr = new PageController();
/sprout/Controllers/Admin/PageAdminController.php Highlighted file source
Line 21: use Sprout\Controllers\PageController; Line 52: use Sprout\Helpers\Page; Line 75: * Handles admin processing for pages Line 77: class PageAdminController extends TreeAdminController Line 79: protected $controller_name = 'page'; Line 80: protected $friendly_name = 'Pages'; Line 90: $this->refine_bar->setGroup('Pages'); Line 93: $this->refine_bar->setGroup('Page content'); Line 124: return "item.id IN (SELECT record_id FROM ~page_keywords AS pk Line 130: return "item.id IN (SELECT page_id FROM ~page_revisions AS rev Line 161: $q = "SELECT id FROM ~homepages WHERE subsite_id = ?"; Line 163: $view = new View('sprout/admin/page_navigation'); Line 164: $view->home_page_id = Pdb::q($q, [$_SESSION['admin']['active_subsite']], 'val'); Line 177: $view = new View('sprout/admin/page_add_save'); Line 193: 'url' => 'admin/add/page', Line 194: 'name' => 'Add a standard page', Line 198: 'url' => 'admin/add/page?type=tool', Line 199: 'name' => 'Add a tool page', Line 208: * Returns the add form for adding a page Line 262: $title = 'Add a page'; Line 265: $title = 'Add a tool page'; Line 269: $view = new View('sprout/admin/page_add'); Line 286: * Saves the provided POST data into a new page in the database Line 288: * @param int $page_id After saving, the new record id will be returned in this parameter Line 291: public function _addSave(&$page_id) Line 312: Slug::unique(Enc::urlname((string)@$_POST['name'], '-'), 'pages', $conds); Line 318: // Validate fields specific to tool pages Line 321: if (!self::checkControllerEntrance($_POST['controller_entrance'], $page_id)) { Line 326: $_POST['current_url'] = 'admin/add/page?type=tool'; Line 336: if (!in_array($_POST['type'], Pdb::extractEnumArr('page_revisions', 'type'))) { Line 346: // Add page Line 375: $page_id = Pdb::insert('pages', $update_fields); Line 377: $this->fixRecordOrder($page_id); Line 380: $res = $this->addHistoryItem($page_id, 'Created empty new page'); Line 385: $update_fields['page_id'] = $page_id; Line 387: $update_fields['changes_made'] = 'New page'; Line 390: // Normal pages have more data to add on the edit form, but tool pages go live straight away Line 403: Pdb::insert('page_revisions', $update_fields); Line 413: $update_fields['item_id'] = $page_id; Line 416: Pdb::insert('page_admin_permissions', $update_fields); Line 429: $update_fields['item_id'] = $page_id; Line 432: Pdb::insert('page_user_permissions', $update_fields); Line 442: Notification::confirm('Your page has been created. Add your content below.'); Line 444: return 'admin/edit/' . $this->controller_name . '/' . $page_id . '?suppress=true'; Line 463: $view = new View('sprout/admin/page_import_upload'); Line 562: Url::redirect("admin/import_upload/page"); Line 565: Url::redirect("admin/import_options/page?timestamp={$timestamp}&ext=xml"); Line 570: * Preview the pages which will be created Line 578: echo '<div class="info highlight-confirm">This is a preview of the pages which will be created</div>'; Line 583: echo '<li>', ($_GET['page_name'] ? Enc::html($_GET['page_name']) : '<i>Enter a page name into the field above</i>'), '</li>'; Line 590: if (trim($_GET['top_page_name'])) { Line 591: $tree['name'] = trim($_GET['top_page_name']); Line 635: $view = new View('sprout/admin/page_import_options'); Line 677: if ($_POST['import_type'] == 'none' and !$_POST['page_name']) { Line 728: // Split into pages based on options Line 737: $node['name'] = $_POST['page_name']; Line 753: if (trim($_POST['top_page_name'])) { Line 754: $tree['name'] = trim($_POST['top_page_name']); Line 766: // Walk page tree and create pages Line 770: $result = $this->createPageTreenode($child, (int)$_POST['parent_id'], $images, $headings, $operator); Line 776: Notification::confirm('Imported ' . $count . ' ' . Inflector::plural('page', $count)); Line 782: * Create a page Line 784: private function createPageTreenode($node, $parent_id, $images, $headings, $operator) Line 790: // Add page Line 801: $page_id = Pdb::insert('pages', $update_fields); Line 803: $this->fixRecordOrder($page_id); Line 807: $update_fields['page_id'] = $page_id; Line 809: $update_fields['changes_made'] = 'Imported page from uploaded file'; Line 814: $rev_id = Pdb::insert('page_revisions', $update_fields); Line 821: $update_fields['page_revision_id'] = $rev_id; Line 827: Pdb::insert('page_widgets', $update_fields); Line 829: // History page Line 830: $res = $this->addHistoryItem($page_id, "Imported page from uploaded file"); Line 833: // Do indexing on the page text Line 834: $res = $this->reindexItem($page_id, $node['name'], $html); Line 837: // Children pages Line 840: $count += $this->createPageTreenode($child, $page_id, $images, $headings, $operator); Line 861: $view = new View('sprout/admin/page_edit_save'); Line 863: $view->preview_url = Subsites::getAbsRootAdmin() . 'admin/call/page/preview/' . $item_id; Line 882: return Page::url($item_id); Line 887: * Returns the edit form for editing the specified page Line 904: // Load the page Line 905: $q = "SELECT * FROM ~pages WHERE id = ?"; Line 907: $page = Pdb::q($q, [$id], 'row'); Line 909: return new AdminError("Invalid id specified - page does not exist"); Line 915: if (empty($page['slug'])) $page['slug'] = Enc::urlname($page['name']); Line 917: // Check the permissions of the page - can the operator edit this page? Line 918: $res = AdminPerms::checkPermissionsTree('pages', $id); Line 919: if (! $res) return new AdminError("Access denied to modify this page"); Line 922: $q = "SELECT page_revisions.*, DATE_FORMAT(date_modified, '%d/%m/%Y %h:%i %p') AS date_modified Line 923: FROM ~page_revisions AS page_revisions Line 924: WHERE page_id = ? Line 925: ORDER BY page_revisions.date_modified DESC"; Line 928: return new AdminError("Invalid id specified - page does not have any revisions"); Line 975: $data = array_merge($page, $sel_rev); Line 978: if (in_array(@$_GET['type'], Pdb::extractEnumArr('page_revisions', 'type'))) { Line 998: // Load widgets and collate rich text as page text Line 1002: FROM ~page_widgets Line 1003: WHERE page_revision_id = ? Line 1026: AdminSeo::setTopic($page['name']); Line 1029: AdminSeo::addLinks(Page::determineRelatedLinks($id)); Line 1035: return new AdminError("Invalid page type"); Line 1038: // Load permissions for page Line 1039: $admin_permissions = AdminPerms::getAccessableGroups('pages', $id); Line 1048: $user_permissions = UserPerms::getAccessableGroups('pages', $id); Line 1067: FROM ~page_history_items AS page_history_items Line 1068: WHERE page_id = ? Line 1069: ORDER BY page_history_items.date_added DESC"; Line 1093: $attributes = MultiEdit::load('page_attributes', ['page_id' => $id]); Line 1107: // Special case for redirect pages Line 1112: $admin_notes = 'This page redirects to an ' . $typename . '. Content blocks on this page have been disabled.'; Line 1114: $admin_notes = 'This page redirects to a ' . $typename . '. Content blocks on this page have been disabled.'; Line 1117: $admin_notes = 'This page will redirect. Content blocks on this page have been disabled.'; Line 1128: $view = new View('sprout/admin/page_edit'); Line 1137: $view->page = $page; Line 1164: $view->show_tour = !Admin::isTourCompleted('page_edit'); Line 1167: $title = 'Editing revision ' . $rev_num . ' of page <strong>' . Enc::html($page['name']) . '</strong>'; Line 1169: $title = 'Editing page <strong>' . Enc::html($page['name']) . '</strong>'; Line 1187: $rev = Pdb::get('page_revisions', $id); Line 1224: * Return a list of menu groups for a selected parent page Line 1226: public function ajaxGetMenuGroups($parent_page_id) Line 1229: $parent_page_id = (int) $parent_page_id; Line 1232: if ($parent_page_id === 0) { Line 1237: // Find the page Line 1238: $root = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 1239: $node = $root->findNodeValue('id', $parent_page_id); Line 1240: if ($node === null) Json::error('Invalid parent page'); Line 1266: * Saves the provided POST data into this page in the database Line 1268: * @param int $page_id The record to update Line 1271: public function _editSave($page_id) Line 1273: $res = AdminPerms::checkPermissionsTree('pages', $page_id); Line 1276: $page_id = (int) $page_id; Line 1279: $q = "SELECT page.*, rev.type, rev.controller_entrance, rev.controller_argument, rev.redirect Line 1280: FROM ~pages AS page Line 1281: INNER JOIN ~page_revisions AS rev ON page.id = rev.page_id Line 1283: WHERE page.id = ?"; Line 1284: $orig_page = Pdb::q($q, [$rev_id, $page_id], 'row'); Line 1287: $page_type = (string) @$_POST['type']; Line 1288: if (!in_array($page_type, Pdb::extractEnumArr('page_revisions', 'type'))) { Line 1289: $page_type = $orig_page['type']; Line 1292: if ($page_type != $orig_page['type']) $revision_changed = true; Line 1351: FROM ~page_widgets Line 1352: WHERE page_revision_id = ? Line 1368: $q = "SELECT rev.*, page.parent_id Line 1369: FROM ~page_revisions AS rev Line 1370: INNER JOIN ~pages AS page ON page.id = rev.page_id Line 1374: // Pretend there's an existing revision when going a page preview Line 1386: if ($page_type == 'standard') { Line 1411: } else if ($page_type == 'tool') { Line 1412: if ($orig_page['controller_entrance'] != $_POST['controller_entrance']) $revision_changed = true; Line 1413: if ($orig_page['controller_argument'] != $_POST['controller_argument']) $revision_changed = true; Line 1414: } else if ($page_type == 'redirect') { Line 1415: if ($orig_page['redirect'] != $_POST['redirect']) $revision_changed = true; Line 1420: if ((int) $orig_page['parent_id'] != (int) $_POST['parent_id']) { Line 1431: 'parent_id' => 'Parent page', Line 1444: ['id', '!=', $page_id], Line 1446: $valid->check('slug', 'Slug::unique', 'pages', $slug_conditions); Line 1453: if ($page_type == 'standard') { Line 1475: } else if ($page_type == 'tool') { Line 1478: if (!self::checkControllerEntrance($_POST['controller_entrance'], $page_id)) { Line 1481: } else if ($page_type == 'redirect') { Line 1490: if ($orig_page['id'] == $_POST['parent_id']) { Line 1491: $valid->addFieldError('parent_id', 'A page can\'t be its own parent.'); Line 1495: $root_node = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 1500: if ($anc['id'] == $page_id) { Line 1501: $valid->addFieldError('parent_id', 'You can\'t set a descendent of this page as its parent'); Line 1522: // Update page Line 1532: if ($page_type == 'standard') { Line 1545: if (Kohana::config('page.enable_banners')) { Line 1580: Pdb::update('pages', $update_fields, ['id' => $page_id]); Line 1582: if ($parent_changed) $this->fixRecordOrder($page_id); Line 1605: Pdb::update('page_revisions', $update_fields, ['page_id' => $page_id, 'id' => $rev_id]); Line 1607: $res = $this->addHistoryItem($page_id, "Updated revision {$rev_id}"); Line 1612: $update_fields['page_id'] = $page_id; Line 1616: $rev_id = Pdb::insert('page_revisions', $update_fields); Line 1618: $res = $this->addHistoryItem($page_id, "Created new revision {$rev_id}"); Line 1624: Page::activateRevision($rev_id); Line 1628: Pdb::delete('page_widgets', ['page_revision_id' => $rev_id]); Line 1632: $update_fields['page_revision_id'] = $rev_id; Line 1633: Pdb::insert('page_widgets', $update_fields); Line 1642: Pdb::update('page_revisions', $update_fields, ['page_id' => $page_id, 'id' => $rev_id]); Line 1668: Pdb::delete('page_admin_permissions', ['item_id' => $page_id]); Line 1677: $update_fields['item_id'] = $page_id; Line 1680: Pdb::insert('page_admin_permissions', $update_fields); Line 1687: Pdb::delete('page_user_permissions', ['item_id' => $page_id]); Line 1696: $update_fields['item_id'] = $page_id; Line 1699: Pdb::insert('page_user_permissions', $update_fields); Line 1706: Pdb::delete('page_attributes', ['page_id' => $page_id]); Line 1713: $update_fields['page_id'] = (int) $page_id; Line 1717: Pdb::insert('page_attributes', $update_fields); Line 1722: // Do indexing on the page text, which is found in the embedded widgets Line 1723: $text = Page::getText($page_id, $rev_id, $_SESSION['admin']['active_subsite']); Line 1728: $view = new View('sprout/email/page_need_check'); Line 1729: $view->page = $_POST; Line 1732: $view->url = Sprout::absRoot() . "page/view_specific_rev/{$page_id}/{$rev_id}/{$approval_code}"; Line 1737: $mail->Subject = 'Page change approval required for ' . Kohana::config('sprout.site_title'); Line 1745: $view = new View('sprout/email/page_notify'); Line 1746: $view->page = $_POST; Line 1748: $view->url = Sprout::absRoot() . "page/view_specific_rev/{$page_id}/{$rev_id}"; Line 1757: $mail->Subject = 'Page updated on site ' . Kohana::config('sprout.site_title') . ': ' . $_POST['name']; Line 1765: $res = $this->reindexItem($page_id, $_POST['name'], $text); Line 1766: if (!$res) Notification::error('Failed to index page text'); Line 1769: if ($page_type != $orig_page['type']) { Line 1770: $this->addHistoryItem($page_id, "Changed the page type"); Line 1771: if (empty($this->in_preview)) Notification::confirm('Page type has been changed.'); Line 1783: return "admin/edit/page/{$page_id}?revision={$rev_id}"; Line 1791: * Page organisation tool Line 1801: 'title' => 'Organise pages', Line 1808: * Page organisation tool Line 1813: $view = new View('sprout/admin/page_menu_groups'); Line 1844: foreach ($all_groups as $page_id => $groups) { Line 1852: $conditions['page_id'] = (int)$page_id; Line 1861: $update_data['page_id'] = (int)$page_id; Line 1864: $update_data['text'] = $_POST['extras'][$page_id]['text']; Line 1867: if (empty($_POST['extras'][$page_id]['image'])) { Line 1868: $_POST['extras'][$page_id]['image'] = null; Line 1870: $update_data['image'] = $_POST['extras'][$page_id]['image']; Line 1877: unset($update_data['page_id']); Line 1878: Pdb::update('menu_extras', $update_data, array('page_id' => $page_id)); Line 1884: Url::redirect('admin/extra/page/menu_groups'); Line 1889: * Adds a history item for a page Line 1891: private function addHistoryItem($page_id, $changes_made, $editor = null) Line 1901: $update_fields['page_id'] = $page_id; Line 1906: $res = Pdb::insert('page_history_items', $update_fields); Line 1912: * Returns the edit form for editing the specified page Line 1921: $view = new View('sprout/admin/page_delete'); Line 1924: // Load page details Line 1925: $q = "SELECT * FROM ~pages WHERE id = ?"; Line 1927: $view->page = Pdb::q($q, [$id], 'row'); Line 1929: return new AdminError("Invalid id specified - page does not exist"); Line 1933: $res = AdminPerms::checkPermissionsTree('pages', $id); Line 1934: if (! $res) return new AdminError("Access denied to delete this page"); Line 1936: // Children pages Line 1939: $child_pages = ($node ? $node->children : []); Line 1940: foreach ($child_pages as $child) { Line 1943: $child_pages[] = $descendent; Line 1946: $view->child_pages = $child_pages; Line 1949: 'title' => 'Deleting page <strong>' . Enc::html($view->page['name']) . '</strong>', Line 1963: if (!AdminPerms::checkPermissionsTree('pages', $item_id)) { Line 1981: * Shows the links (incoming and outgoing) for a page Line 1987: $res = AdminPerms::checkPermissionsTree('pages', $id); Line 1988: if (! $res) return "Access denied to view this page"; Line 1990: $view = new View('sprout/admin/page_linklist'); Line 1993: // Load page details Line 1994: $q = "SELECT pages.name, revs.text Line 1995: FROM ~pages AS pages Line 1996: INNER JOIN ~page_revisions AS revs Line 1997: ON revs.page_id = pages.id AND revs.status = ? Line 1998: WHERE pages.id = ?"; Line 1999: $view->page = Pdb::q($q, ['live', $id], 'row'); Line 2006: $q = "SELECT pages.id, pages.name, revs.text Line 2007: FROM ~pages AS pages Line 2008: INNER JOIN ~page_revisions AS revs Line 2009: ON revs.page_id = pages.id Line 2028: 'Page' => 'name', Line 2037: $res = preg_match_all('/<a.*?href="(.+?)".*?>(.+?)<\/a>/i', $view->page->text, $matches, PREG_SET_ORDER); Line 2055: 'title' => 'Links for page <strong>' . Enc::html($view->page->name) . '</strong>', Line 2069: $intro = new View("sprout/admin/page_intro"); Line 2074: // Recently updated pages Line 2075: $q = "SELECT pages.id, pages.name, DATE_FORMAT(pages.date_modified, '%d/%m/%Y') AS date_modified, Line 2076: pages.modified_editor Line 2077: FROM ~pages AS pages Line 2079: ORDER BY pages.date_modified DESC Line 2094: $q = "SELECT pages.id, pages.name, DATE_FORMAT(page_revisions.date_modified, '%d/%m/%Y') AS date_modified, Line 2095: page_revisions.modified_editor Line 2096: FROM ~page_revisions AS page_revisions Line 2097: INNER JOIN ~pages AS pages ON page_revisions.page_id = pages.id Line 2098: WHERE page_revisions.status = ? Line 2100: ORDER BY page_revisions.date_modified DESC Line 2112: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs'); Line 2123: * Does a re-index for a page Line 2127: Search::selectIndex('page_keywords', $item_id); Line 2138: $res = Search::cleanup('pages'); Line 2145: * Does a complete re-index of all pages Line 2153: $q = "SELECT pages.id, pages.name, pages.active, widget.settings Line 2154: FROM ~pages AS pages Line 2155: INNER JOIN ~page_revisions AS rev Line 2156: ON rev.page_id = pages.id AND rev.status = ? Line 2157: LEFT JOIN ~page_widgets AS widget ON rev.id = widget.page_revision_id Line 2162: $pages = []; Line 2165: $pages[$row['id']] = ['name' => $row['name'], 'text' => '']; Line 2169: if (!isset($pages[$row['id']])) { Line 2170: $pages[$row['id']] = ['name' => $row['name'], 'text' => $settings['text']]; Line 2172: $pages[$row['id']]['text'] .= "\n" . $settings['text']; Line 2177: if (count($pages) == 0) { Line 2183: foreach ($pages as $id => $page) { Line 2184: $this->reindexItem($id, $page['name'], $page['text']); Line 2197: * @param int $page_id Page record ID Line 2200: private static function checkControllerEntrance($controller, $page_id) Line 2202: $page_id = (int) $page_id; Line 2215: * Returns the children pages for a specific page, in a format required by jqueryFileTree. Line 2225: Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 2247: $admin_perms = AdminPerms::checkPermissionsTree('pages', $top_node['id']); Line 2262: $admin_perms = AdminPerms::checkPermissionsTree('pages', $child['id']); Line 2284: echo "+ <a href=\"SITE/admin/add/page?parent_id={$top_node['id']}\">Add Child</a>"; Line 2286: echo "↕ <a href=\"SITE/page/reorder/{$top_node['id']}\" onclick=\"$.facebox({'ajax':this.href}); return false;\">Re-order</a>"; Line 2297: * Saves in the session data the currently open pages in the pages tree (navigation pane) Line 2298: * Uses the POST param 'pages', and is usually run through an AJAX call. Line 2375: public function cronPageActivate() Line 2377: Cron::start('Activate pages'); Line 2383: $q = "SELECT id, page_id Line 2384: FROM ~page_revisions Line 2389: Cron::message("Launching revision {$row['id']} on page {$row['page_id']}"); Line 2392: Pdb::update('page_revisions', ['status' => 'live'], ['id' => $row['id']]); Line 2394: $this->addHistoryItem($row['page_id'], "AutoLaunched revision {$row['id']}", 'n/a'); Line 2397: 'page_id' => $row['page_id'], Line 2401: Pdb::update('page_revisions', ['status' => 'old'], $where); Line 2416: * Deactivates pages after set date Line 2418: public function cronPageDeactivate() Line 2420: Cron::start('De-activate pages'); Line 2427: FROM ~pages Line 2435: Cron::message("De-activating page {$row['id']}"); Line 2437: // Deactivate page Line 2438: Pdb::update('pages', ['active' => 0], ['id' => $row['id']]); Line 2440: $this->addHistoryItem($row['id'], "Deactivated page {$row['id']}", 'n/a'); Line 2462: $items[] = "<li class=\"import\"><a href=\"SITE/admin/import_upload/page\">Document import</a></li>"; Line 2465: $items[] = "<li class=\"action-log\"><a href=\"SITE/admin/search/{$this->controller_name}\">Search pages</a></li>"; Line 2468: $items[] = "<li class=\"action-log\"><a href=\"admin/extra/page/need_approval\">Pages needing approval</a></li>"; Line 2477: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/organise\">Sitemap manager</a></li>"; Line 2481: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/menu_groups\">Manage menu groups</a></li>"; Line 2484: $items[] = "<li class=\"config\"><a href=\"admin/extra/page/link_checker\">Link checker</a></li>"; Line 2487: $items[] = "<li class=\"config\"><a href=\"page/clear_navigation_cache\">Clear navigation cache</a></li>"; Line 2529: Url::redirect('admin/extra/page/link_checker'); Line 2534: Url::redirect('admin/extra/page/link_checker'); Line 2545: Url::redirect('admin/extra/page/link_checker'); Line 2549: Url::redirect('admin/extra/page/link_checker_info/' . $info['job_id']); Line 2573: * List of pages which need approval Line 2581: $q = "SELECT pages.id, pages.name, revs.date_modified, revs.modified_editor Line 2582: FROM ~page_revisions AS revs Line 2583: INNER JOIN ~pages AS pages ON revs.page_id = pages.id Line 2585: AND pages.subsite_id = ? Line 2586: GROUP BY pages.id Line 2598: $itemlist->addAction('edit', 'admin/edit/page/%%'); Line 2601: 'title' => 'Pages needing approval', Line 2619: * Check for stale page content and send emails regarding stale pages; to be run via cron Line 2625: Cron::start('Stale page checker'); Line 2627: $email = Kohana::config('sprout.stale_page_email'); Line 2628: $default_max_age = Kohana::config('sprout.stale_page_age'); Line 2629: $resend_interval = (int) Kohana::config('sprout.stale_page_resend_after'); Line 2632: $q = "SELECT page.id, page.subsite_id, page.name, Line 2635: FROM ~pages AS page Line 2636: INNER JOIN ~page_revisions AS rev Line 2637: ON page.id = rev.page_id AND rev.status = 'live' AND rev.type = 'standard' Line 2640: WHERE page.active = 1 Line 2641: AND DATE_SUB(CURDATE(), INTERVAL ? DAY) >= page.stale_reminder_sent Line 2642: AND IFNULL(page.stale_age, ?) > 0 Line 2643: AND DATEDIFF(NOW(), rev.date_modified) >= IFNULL(page.stale_age, ?) Line 2644: ORDER BY age DESC, page.id"; Line 2648: Cron::message('No stale pages found'); Line 2656: $op_emails[0] = ['email' => $email, 'pages' => []]; Line 2660: $url = Page::url($id); Line 2665: $op_emails[0]['pages'][] = [ Line 2680: 'pages' => [], Line 2684: $op_emails[$op]['pages'][] = [ Line 2694: if (count($details['pages']) == 0) continue; Line 2697: $msg .= Inflector::numPlural(count($details['pages']), 'page'); Line 2700: $view = new View('sprout/email/pages_stale'); Line 2702: $view->pages = $details['pages']; Line 2716: Cron::message("Marking pages as sent"); Line 2722: $count = Pdb::q("UPDATE ~pages SET stale_reminder_sent = ? WHERE {$where}", $params, 'count'); Line 2723: Cron::message(Inflector::numPlural($count, 'page') . " marked as sent"); Line 2730: * Forces a clear of the pagecache Line 2738: Notification::confirm('Page cache has been cleared'); Line 2739: Url::redirect('admin/intro/page'); Line 2747: 'pages' => 1, Line 2748: 'page_revisions' => ['id' => $_POST['rev_id']], Line 2749: 'page_widgets' => 0, Line 2750: 'page_history_items' => 0, Line 2751: 'page_admin_permissions' => 1, Line 2752: 'page_user_permissions' => 1, Line 2753: 'page_attributes' => 0, Line 2754: 'page_keywords' => 0, Line 2765: $ctlr = new PageController();
/sprout/Controllers/AdminController.php Highlighted file source
Line 26: use Sprout\Controllers\Admin\PageAdminController; Line 115: // Load page tree Line 116: Navigation::loadPageTree(@$_SESSION['admin']['active_subsite'], true); Line 134: * Home page of admin area Line 159: $msg = Sprout::extraPage(Constants::EXTRAPAGES_ADMIN_LOGIN); Line 375: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController'); Line 397: } else if ($first != 'page') { Line 401: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController'); Line 626: if ($type == 'page') { Line 1756: $this->setNavigation($view, new PageAdminController()); Line 1933: * @param string $class The shorthand class name, e.g. 'page' Line 2060: * @param string $type Admin controller slug, e.g. 'page' Line 2246: if ($tbl['Name'] === "{$tbl_prefix}page_revisions") {
/sprout/Controllers/AdminController.php Highlighted file source
Line 26: use Sprout\Controllers\Admin\PageAdminController; Line 115: // Load page tree Line 116: Navigation::loadPageTree(@$_SESSION['admin']['active_subsite'], true); Line 134: * Home page of admin area Line 159: $msg = Sprout::extraPage(Constants::EXTRAPAGES_ADMIN_LOGIN); Line 375: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController'); Line 397: } else if ($first != 'page') { Line 401: $ctlr = $this->getController('Sprout\Controllers\Admin\PageAdminController'); Line 626: if ($type == 'page') { Line 1756: $this->setNavigation($view, new PageAdminController()); Line 1933: * @param string $class The shorthand class name, e.g. 'page' Line 2060: * @param string $type Admin controller slug, e.g. 'page' Line 2246: if ($tbl['Name'] === "{$tbl_prefix}page_revisions") {
/sprout/Controllers/AdvancedSearchController.php Highlighted file source
Line 50: * Redirects to the target page Line 73: Navigation::setPageNodeMatcher(new TreenodeFrontendMatcher('advanced_search', 'form')); Line 77: // Page title Line 78: $page_title = 'Search'; Line 79: $page_node = Navigation::matchedNode(); Line 80: if ($page_node) { Line 81: $page_title = $page_node->getNavigationName(); Line 85: $page_view = new View('skin/inner'); Line 86: $page_view->page_title = $page_title; Line 87: $page_view->main_content = $view; Line 88: $page_view->controller_name = 'user'; Line 90: echo $page_view->render(); Line 112: if (! isset($_GET['page'])) $_GET['page'] = 1; Line 113: $_GET['page'] = (int) $_GET['page']; Line 182: $search_result = Search::query($_GET['q'], $search_handlers, $_GET['page'] - 1); Line 188: list ($res, $keywords, $num_results, $num_pages) = $search_result; Line 223: $out .= Search::paginate($_GET['page'], $num_pages, 'search-paginate');
/sprout/Controllers/AdvancedSearchController.php Highlighted file source
Line 50: * Redirects to the target page Line 73: Navigation::setPageNodeMatcher(new TreenodeFrontendMatcher('advanced_search', 'form')); Line 77: // Page title Line 78: $page_title = 'Search'; Line 79: $page_node = Navigation::matchedNode(); Line 80: if ($page_node) { Line 81: $page_title = $page_node->getNavigationName(); Line 85: $page_view = new View('skin/inner'); Line 86: $page_view->page_title = $page_title; Line 87: $page_view->main_content = $view; Line 88: $page_view->controller_name = 'user'; Line 90: echo $page_view->render(); Line 112: if (! isset($_GET['page'])) $_GET['page'] = 1; Line 113: $_GET['page'] = (int) $_GET['page']; Line 182: $search_result = Search::query($_GET['q'], $search_handlers, $_GET['page'] - 1); Line 188: list ($res, $keywords, $num_results, $num_pages) = $search_result; Line 223: $out .= Search::paginate($_GET['page'], $num_pages, 'search-paginate');
/sprout/Controllers/DbToolsController.php Highlighted file source
Line 345: $num += (int) Pdb::query("SELECT COUNT(*) FROM ~pages", [], 'val'); Line 2274: $page_size = 100; Line 2275: $page = max((int)@$_GET['page'], 1); Line 2276: $offset = ($page - 1) * $page_size; Line 2284: LIMIT {$offset}, {$page_size}"; Line 2304: $view->page = $page; Line 2306: $view->page_size = $page_size; Line 2461: $root = Navigation::loadPageTree($subsite_id, false, true); Line 2485: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $fake_node['id'])); Line 2492: // Page templates Line 2494: $view->page_title = 'Template test'; Line 2499: $view->html_title = $view->page_title; Line 2874: $this->template('Import Sprout 2 pages'); Line 2888: $_POST['page_id'] = (int) @$_POST['page_id']; Line 2915: $pages = ImportCMS::import($tempname); Line 2919: // Render table of pages that need widgets replaced Line 2926: $list->items = $pages; Line 2930: $this->template('Successfully imported Sprout 2 pages'); Line 2935: * Render page drop-down for given sub-site Line 2940: public function ajaxPageIds($subsite_id) Line 2945: Form::nextFieldDetails('Parent page', false, 'Import as child pages of selected parent page'); Line 2946: echo Form::pageDropdown('page_id', [], ['subsite' => $subsite_id]); Line 2971: // Fetch page title
/sprout/Controllers/DbToolsController.php Highlighted file source
Line 345: $num += (int) Pdb::query("SELECT COUNT(*) FROM ~pages", [], 'val'); Line 2274: $page_size = 100; Line 2275: $page = max((int)@$_GET['page'], 1); Line 2276: $offset = ($page - 1) * $page_size; Line 2284: LIMIT {$offset}, {$page_size}"; Line 2304: $view->page = $page; Line 2306: $view->page_size = $page_size; Line 2461: $root = Navigation::loadPageTree($subsite_id, false, true); Line 2485: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $fake_node['id'])); Line 2492: // Page templates Line 2494: $view->page_title = 'Template test'; Line 2499: $view->html_title = $view->page_title; Line 2874: $this->template('Import Sprout 2 pages'); Line 2888: $_POST['page_id'] = (int) @$_POST['page_id']; Line 2915: $pages = ImportCMS::import($tempname); Line 2919: // Render table of pages that need widgets replaced Line 2926: $list->items = $pages; Line 2930: $this->template('Successfully imported Sprout 2 pages'); Line 2935: * Render page drop-down for given sub-site Line 2940: public function ajaxPageIds($subsite_id) Line 2945: Form::nextFieldDetails('Parent page', false, 'Import as child pages of selected parent page'); Line 2946: echo Form::pageDropdown('page_id', [], ['subsite' => $subsite_id]); Line 2971: // Fetch page title
/sprout/Controllers/PageController.php Highlighted file source
Line 31: use Sprout\Helpers\Page; Line 52: * Handles front-end processing for pages Line 54: class PageController extends Controller implements FrontEndSearch Line 68: * Displays a page. Line 69: * The page is specified by the page friendly name Line 71: * @param string $name The URL of the page to display Line 90: * Displays a page. Line 91: * The page is specified by the page id Line 93: * @param int $id The id of the page to display Line 102: $where[] = 'pages.id = :page_id'; Line 103: $params['page_id'] = $id; Line 104: $where[] = 'pages.active = 1'; Line 107: $where[] = 'pages.subsite_id = :subsite_id'; Line 113: $q = "SELECT pages.id, pages.name, pages.meta_keywords, pages.meta_description, Line 114: pages.alt_browser_title, revs.id AS rev_id, pages.alt_template, pages.subsite_id, Line 115: pages.additional_css AS has_additional_css, Line 116: pages.gallery_thumb, pages.banner, Line 119: FROM ~pages AS pages Line 120: INNER JOIN ~page_revisions AS revs Line 121: ON revs.page_id = pages.id Line 126: $page = Pdb::q($q, $params, 'row'); Line 128: throw new Kohana_404_Exception("Page # {$id}"); Line 135: if (Kohana::config('sprout.page_stats')) { Line 139: if ($page['type'] == 'redirect') { Line 141: Url::redirect(Lnk::url($page['redirect'])); Line 143: } else if ($page['type'] == 'tool') { Line 146: $page['controller_entrance'], Line 150: $conds_env = $this->widgetCondsEnvironment($page); Line 151: $this->loadWidgets($conds_env, $page); Line 153: Router::$controller = $page['controller_entrance']; Line 155: $inst->entrance($page['controller_argument']); Line 158: // Standard page Line 159: echo $this->displayPage($page); Line 165: * Displays a specific revision of a page. Line 166: * @param int $page_id The ID of the page to display Line 173: public function viewSpecificRev($page_id, $rev_id, $approval_code = '') Line 175: $page_id = (int) $page_id; Line 179: $params = ['page_id' => $page_id, 'rev_id' => $rev_id]; Line 185: $q = "SELECT page.id, page.name, page.meta_keywords, page.meta_description, page.alt_browser_title, Line 186: page.alt_template, page.subsite_id, Line 188: FROM ~pages AS page Line 189: INNER JOIN ~page_revisions AS rev ON page.id = rev.page_id Line 191: WHERE page.id = :page_id"; Line 193: $page = Pdb::q($q, $params, 'row'); Line 195: throw new Kohana_404_Exception("Page # {$page_id}, rev # {$rev_id}"); Line 199: if ($approval_code == '' and $page['status'] != 'live') { Line 203: echo $this->displayPage($page, $approval_code); Line 210: private function trackVisit($page_id) Line 219: $q = "INSERT INTO ~page_visits Line 220: SET page_id = ?, section_page_id = ?, date_hits = CURDATE(), num = 1 Line 222: Pdb::q($q, [$page_id, $sect_id], 'count'); Line 231: * @param array $page Combined page/revision record from the DB; Line 232: * see e.g. {@see PageController::viewById} or {@see PageController::viewSpecificRev} Line 233: * @param string $approval_code Approval code, if the page needs to include 'approve' and 'deny' buttons Line 237: private function displayPage(array $page, $approval_code = '') Line 240: $page_view_name = 'skin/popup'; Line 241: } else if (!empty($page['alt_template'])) { Line 242: $page_view_name = $page['alt_template']; Line 244: $page_view_name = 'skin/inner'; Line 247: $page_view = View::create($page_view_name); Line 250: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $page['id'])); Line 252: $this->navigation_node = Navigation::getRootNode()->findNodeValue('id', $page['id']); Line 255: // Page titles Line 256: $page_view->page_title = $page['name']; Line 257: if ($page['alt_browser_title']) { Line 258: $page_view->browser_title = $page['alt_browser_title']; Line 260: $page_view->browser_title = Navigation::buildBrowserTitle($page['name']); Line 263: // Load the ancestors for the page node and get the name (and url name) of the top-level ancestor Line 266: $page_view->top_level_name = $anc[0]->getNavigationName(); Line 267: $page_view->top_level_urlname = $anc[0]->getUrlName(); Line 270: // If we don't have access to this page, show a login form Line 271: if (! UserPerms::checkPermissionsTree('pages', $page['id'])) { Line 272: $page_view->main_content = UserPerms::getAccessDenied(); Line 274: return $page_view->render(); Line 278: $conds_env = $this->widgetCondsEnvironment($page); Line 279: $this->loadWidgets($conds_env, $page); Line 280: $page_view->main_content = Widgets::renderArea('embedded'); Line 283: if (@$page['status'] == 'need_approval' and $approval_code) { Line 284: $form_view = new View('sprout/page_approval_form'); Line 285: $form_view->rev_id = (int) $page['rev_id']; Line 287: $page_view->main_content = $form_view->render() . $page_view->main_content; Line 289: } else if (isset($page['status']) and @$page['status'] != 'live') { Line 291: $info_view = new View('sprout/page_rev_info'); Line 292: $info_view->page = $page; Line 293: $page_view->main_content = $info_view->render() . $page_view->main_content; Line 296: SocialNetworking::details($page['name'], $page_view->main_content); Line 297: $this->setSocialMeta($page, $page_view->main_content); Line 299: if (Kohana::config('sprout.tweak_skin') and $page['has_additional_css']) { Line 300: Needs::addCssInclude('SITE/page/additional_css/' . $page['id'] . '/' . strtotime($page['date_modified']) . '.css'); Line 304: if ($page['meta_keywords']) Needs::addMeta('keywords', $page['meta_keywords']); Line 305: if ($page['meta_description']) Needs::addMeta('description', $page['meta_description']); Line 307: $page_view->page_attrs = Page::attrs($page['id']); Line 308: $page_view->tags = Tags::byRecord('pages', $page['id']); Line 309: $page_view->controller_name = $this->getCssClassName(); Line 310: $page_view->canonical_url = Page::url($page['id']); Line 312: return $page_view->render(); Line 317: * Set the social meta data for a page Line 319: * @param array $page Page details from the database Line 323: private function setSocialMeta(array $page, $content_html) Line 325: SocialMeta::setTitle($page['name']); Line 327: if (!empty($page['gallery_thumb'])) { Line 328: SocialMeta::setImage($page['gallery_thumb']); Line 329: } else if (!empty($page['banner'])) { Line 330: SocialMeta::setImage($page['banner']); Line 341: if ($page['meta_description']) { Line 342: SocialMeta::setDescription($page['meta_description']); Line 358: private function textTranslation($page_id, $text) Line 361: $text = ContentReplace::embedWidgets($text, 'page', $page_id); Line 370: * @param array $page Database record Line 373: private function widgetCondsEnvironment(array $page) Line 376: 'page_id' => $page['id'], Line 382: * Loads the widgets from the database for this page. Line 384: * @param array $page The page to load widgets from Line 386: private function loadWidgets(array $conds_env, array $page) Line 389: FROM ~page_widgets Line 390: WHERE page_revision_id = ? AND active = 1 Line 392: $wids = Pdb::q($q, [$page['rev_id']], 'arr'); Line 411: * Gets the additional CSS for a page, if it has any Line 413: public function additionalCss($page_id, $junk = null) Line 415: $page_id = (int) $page_id; Line 417: $q = "SELECT additional_css FROM ~pages WHERE id = ?"; Line 418: $row = Pdb::q($q, [$page_id], 'row'); Line 440: // Collate widgets to produce page text Line 441: $text = Page::getText($item_id); Line 476: $view = new View('sprout/search_results_page'); Line 487: * Action for reviewing a page - either approves or rejects the revision Line 511: $q = "SELECT rev.id, rev.status, rev.page_id, page.name AS page_name, page.subsite_id, Line 513: FROM ~page_revisions AS rev Line 514: INNER JOIN ~pages AS page ON rev.page_id = page.id Line 525: Url::redirect(Page::url($rev['page_id'])); Line 533: Page::activateRevision($rev_id); Line 537: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']); Line 541: $view = new View('sprout/email/page_approved'); Line 543: $view->page_name = $rev['page_name']; Line 549: $mail->Subject = 'Page change approved on ' . Kohana::config('sprout.site_title'); Line 558: Pdb::update('page_revisions', ['status' => 'rejected'], ['id' => $rev_id]); Line 560: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']); Line 564: $view = new View('sprout/email/page_rejected'); Line 566: $view->page_name = $rev['page_name']; Line 572: $mail->Subject = 'Page change rejected on ' . Kohana::config('sprout.site_title');
/sprout/Controllers/PageController.php Highlighted file source
Line 31: use Sprout\Helpers\Page; Line 52: * Handles front-end processing for pages Line 54: class PageController extends Controller implements FrontEndSearch Line 68: * Displays a page. Line 69: * The page is specified by the page friendly name Line 71: * @param string $name The URL of the page to display Line 90: * Displays a page. Line 91: * The page is specified by the page id Line 93: * @param int $id The id of the page to display Line 102: $where[] = 'pages.id = :page_id'; Line 103: $params['page_id'] = $id; Line 104: $where[] = 'pages.active = 1'; Line 107: $where[] = 'pages.subsite_id = :subsite_id'; Line 113: $q = "SELECT pages.id, pages.name, pages.meta_keywords, pages.meta_description, Line 114: pages.alt_browser_title, revs.id AS rev_id, pages.alt_template, pages.subsite_id, Line 115: pages.additional_css AS has_additional_css, Line 116: pages.gallery_thumb, pages.banner, Line 119: FROM ~pages AS pages Line 120: INNER JOIN ~page_revisions AS revs Line 121: ON revs.page_id = pages.id Line 126: $page = Pdb::q($q, $params, 'row'); Line 128: throw new Kohana_404_Exception("Page # {$id}"); Line 135: if (Kohana::config('sprout.page_stats')) { Line 139: if ($page['type'] == 'redirect') { Line 141: Url::redirect(Lnk::url($page['redirect'])); Line 143: } else if ($page['type'] == 'tool') { Line 146: $page['controller_entrance'], Line 150: $conds_env = $this->widgetCondsEnvironment($page); Line 151: $this->loadWidgets($conds_env, $page); Line 153: Router::$controller = $page['controller_entrance']; Line 155: $inst->entrance($page['controller_argument']); Line 158: // Standard page Line 159: echo $this->displayPage($page); Line 165: * Displays a specific revision of a page. Line 166: * @param int $page_id The ID of the page to display Line 173: public function viewSpecificRev($page_id, $rev_id, $approval_code = '') Line 175: $page_id = (int) $page_id; Line 179: $params = ['page_id' => $page_id, 'rev_id' => $rev_id]; Line 185: $q = "SELECT page.id, page.name, page.meta_keywords, page.meta_description, page.alt_browser_title, Line 186: page.alt_template, page.subsite_id, Line 188: FROM ~pages AS page Line 189: INNER JOIN ~page_revisions AS rev ON page.id = rev.page_id Line 191: WHERE page.id = :page_id"; Line 193: $page = Pdb::q($q, $params, 'row'); Line 195: throw new Kohana_404_Exception("Page # {$page_id}, rev # {$rev_id}"); Line 199: if ($approval_code == '' and $page['status'] != 'live') { Line 203: echo $this->displayPage($page, $approval_code); Line 210: private function trackVisit($page_id) Line 219: $q = "INSERT INTO ~page_visits Line 220: SET page_id = ?, section_page_id = ?, date_hits = CURDATE(), num = 1 Line 222: Pdb::q($q, [$page_id, $sect_id], 'count'); Line 231: * @param array $page Combined page/revision record from the DB; Line 232: * see e.g. {@see PageController::viewById} or {@see PageController::viewSpecificRev} Line 233: * @param string $approval_code Approval code, if the page needs to include 'approve' and 'deny' buttons Line 237: private function displayPage(array $page, $approval_code = '') Line 240: $page_view_name = 'skin/popup'; Line 241: } else if (!empty($page['alt_template'])) { Line 242: $page_view_name = $page['alt_template']; Line 244: $page_view_name = 'skin/inner'; Line 247: $page_view = View::create($page_view_name); Line 250: Navigation::setPageNodeMatcher(new TreenodeValueMatcher('id', $page['id'])); Line 252: $this->navigation_node = Navigation::getRootNode()->findNodeValue('id', $page['id']); Line 255: // Page titles Line 256: $page_view->page_title = $page['name']; Line 257: if ($page['alt_browser_title']) { Line 258: $page_view->browser_title = $page['alt_browser_title']; Line 260: $page_view->browser_title = Navigation::buildBrowserTitle($page['name']); Line 263: // Load the ancestors for the page node and get the name (and url name) of the top-level ancestor Line 266: $page_view->top_level_name = $anc[0]->getNavigationName(); Line 267: $page_view->top_level_urlname = $anc[0]->getUrlName(); Line 270: // If we don't have access to this page, show a login form Line 271: if (! UserPerms::checkPermissionsTree('pages', $page['id'])) { Line 272: $page_view->main_content = UserPerms::getAccessDenied(); Line 274: return $page_view->render(); Line 278: $conds_env = $this->widgetCondsEnvironment($page); Line 279: $this->loadWidgets($conds_env, $page); Line 280: $page_view->main_content = Widgets::renderArea('embedded'); Line 283: if (@$page['status'] == 'need_approval' and $approval_code) { Line 284: $form_view = new View('sprout/page_approval_form'); Line 285: $form_view->rev_id = (int) $page['rev_id']; Line 287: $page_view->main_content = $form_view->render() . $page_view->main_content; Line 289: } else if (isset($page['status']) and @$page['status'] != 'live') { Line 291: $info_view = new View('sprout/page_rev_info'); Line 292: $info_view->page = $page; Line 293: $page_view->main_content = $info_view->render() . $page_view->main_content; Line 296: SocialNetworking::details($page['name'], $page_view->main_content); Line 297: $this->setSocialMeta($page, $page_view->main_content); Line 299: if (Kohana::config('sprout.tweak_skin') and $page['has_additional_css']) { Line 300: Needs::addCssInclude('SITE/page/additional_css/' . $page['id'] . '/' . strtotime($page['date_modified']) . '.css'); Line 304: if ($page['meta_keywords']) Needs::addMeta('keywords', $page['meta_keywords']); Line 305: if ($page['meta_description']) Needs::addMeta('description', $page['meta_description']); Line 307: $page_view->page_attrs = Page::attrs($page['id']); Line 308: $page_view->tags = Tags::byRecord('pages', $page['id']); Line 309: $page_view->controller_name = $this->getCssClassName(); Line 310: $page_view->canonical_url = Page::url($page['id']); Line 312: return $page_view->render(); Line 317: * Set the social meta data for a page Line 319: * @param array $page Page details from the database Line 323: private function setSocialMeta(array $page, $content_html) Line 325: SocialMeta::setTitle($page['name']); Line 327: if (!empty($page['gallery_thumb'])) { Line 328: SocialMeta::setImage($page['gallery_thumb']); Line 329: } else if (!empty($page['banner'])) { Line 330: SocialMeta::setImage($page['banner']); Line 341: if ($page['meta_description']) { Line 342: SocialMeta::setDescription($page['meta_description']); Line 358: private function textTranslation($page_id, $text) Line 361: $text = ContentReplace::embedWidgets($text, 'page', $page_id); Line 370: * @param array $page Database record Line 373: private function widgetCondsEnvironment(array $page) Line 376: 'page_id' => $page['id'], Line 382: * Loads the widgets from the database for this page. Line 384: * @param array $page The page to load widgets from Line 386: private function loadWidgets(array $conds_env, array $page) Line 389: FROM ~page_widgets Line 390: WHERE page_revision_id = ? AND active = 1 Line 392: $wids = Pdb::q($q, [$page['rev_id']], 'arr'); Line 411: * Gets the additional CSS for a page, if it has any Line 413: public function additionalCss($page_id, $junk = null) Line 415: $page_id = (int) $page_id; Line 417: $q = "SELECT additional_css FROM ~pages WHERE id = ?"; Line 418: $row = Pdb::q($q, [$page_id], 'row'); Line 440: // Collate widgets to produce page text Line 441: $text = Page::getText($item_id); Line 476: $view = new View('sprout/search_results_page'); Line 487: * Action for reviewing a page - either approves or rejects the revision Line 511: $q = "SELECT rev.id, rev.status, rev.page_id, page.name AS page_name, page.subsite_id, Line 513: FROM ~page_revisions AS rev Line 514: INNER JOIN ~pages AS page ON rev.page_id = page.id Line 525: Url::redirect(Page::url($rev['page_id'])); Line 533: Page::activateRevision($rev_id); Line 537: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']); Line 541: $view = new View('sprout/email/page_approved'); Line 543: $view->page_name = $rev['page_name']; Line 549: $mail->Subject = 'Page change approved on ' . Kohana::config('sprout.site_title'); Line 558: Pdb::update('page_revisions', ['status' => 'rejected'], ['id' => $rev_id]); Line 560: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']); Line 564: $view = new View('sprout/email/page_rejected'); Line 566: $view->page_name = $rev['page_name']; Line 572: $mail->Subject = 'Page change rejected on ' . Kohana::config('sprout.site_title');
/sprout/Controllers/SearchController.php Highlighted file source
Line 43: * @get int page Page number, for results pagination Line 50: if (! isset($_GET['page'])) $_GET['page'] = 1; Line 51: $_GET['page'] = (int) $_GET['page']; Line 53: // Nonsensical page numbers -> force to 1 Line 54: if ($_GET['page'] < 1) $_GET['page'] = 1; Line 70: $search_result = Search::query($_GET['q'], $search_handlers, $_GET['page'] - 1); Line 77: $page_view = new View('skin/inner'); Line 78: $page_view->page_title = 'Search'; Line 79: $page_view->main_content = '<div class="site-search-form">' . new View('sprout/search_form') . '</div>'; Line 81: echo $page_view->render(); Line 85: list ($res, $keywords, $num_results, $num_pages) = $search_result; Line 115: $out .= Search::paginate($_GET['page'], $num_pages, 'search-paginate'); Line 117: $page_view = new View('skin/inner'); Line 118: $page_view->page_title = 'Search'; Line 119: $page_view->browser_title = Navigation::buildBrowserTitle('Search'); Line 120: $page_view->main_content = '<div class="site-search-form">' . new View('sprout/search_form') . '</div>' . $out; Line 121: $page_view->controller_name = $this->getCssClassName(); Line 123: echo $page_view->render();
/sprout/Controllers/SearchController.php Highlighted file source
Line 43: * @get int page Page number, for results pagination Line 50: if (! isset($_GET['page'])) $_GET['page'] = 1; Line 51: $_GET['page'] = (int) $_GET['page']; Line 53: // Nonsensical page numbers -> force to 1 Line 54: if ($_GET['page'] < 1) $_GET['page'] = 1; Line 70: $search_result = Search::query($_GET['q'], $search_handlers, $_GET['page'] - 1); Line 77: $page_view = new View('skin/inner'); Line 78: $page_view->page_title = 'Search'; Line 79: $page_view->main_content = '<div class="site-search-form">' . new View('sprout/search_form') . '</div>'; Line 81: echo $page_view->render(); Line 85: list ($res, $keywords, $num_results, $num_pages) = $search_result; Line 115: $out .= Search::paginate($_GET['page'], $num_pages, 'search-paginate'); Line 117: $page_view = new View('skin/inner'); Line 118: $page_view->page_title = 'Search'; Line 119: $page_view->browser_title = Navigation::buildBrowserTitle('Search'); Line 120: $page_view->main_content = '<div class="site-search-form">' . new View('sprout/search_form') . '</div>' . $out; Line 121: $page_view->controller_name = $this->getCssClassName(); Line 123: echo $page_view->render();
/sprout/core/Kohana.php Highlighted file source
Line 93: define('E_PAGE_NOT_FOUND', 43); Line 163: // Enable Kohana 404 pages Line 170: Event::add('system.display', array('Sprout\\Helpers\\SessionStats', 'trackPageView')); Line 639: * Displays a 404 page. Line 642: * @param string URI of page Line 646: public static function show404($page = FALSE) Line 648: throw new Kohana_404_Exception($page); Line 748: // This is useful for hooks to determine if a page has an error Line 821: $message = 'One of the database records for the page you requested could not be found.'; Line 824: $page = new View('sprout/404_error'); Line 825: $page->message = $message; Line 826: $page = $page->render(); Line 829: $view->page_title = '404 File Not Found'; Line 830: $view->main_content = $page; Line 1608: * Creates a Page Not Found exception. Line 1613: protected $code = E_PAGE_NOT_FOUND; Line 1618: * @param string URL of page Line 1621: public function __construct($page = FALSE) Line 1623: if ($page === FALSE) Line 1625: // Construct the page URI using Router properties Line 1626: $page = Router::$current_uri.Router::$url_suffix.Router::$query_string; Line 1629: Exception::__construct(Kohana::lang('core.page_not_found', $page));
/sprout/core/Kohana.php Highlighted file source
Line 93: define('E_PAGE_NOT_FOUND', 43); Line 163: // Enable Kohana 404 pages Line 170: Event::add('system.display', array('Sprout\\Helpers\\SessionStats', 'trackPageView')); Line 639: * Displays a 404 page. Line 642: * @param string URI of page Line 646: public static function show404($page = FALSE) Line 648: throw new Kohana_404_Exception($page); Line 748: // This is useful for hooks to determine if a page has an error Line 821: $message = 'One of the database records for the page you requested could not be found.'; Line 824: $page = new View('sprout/404_error'); Line 825: $page->message = $message; Line 826: $page = $page->render(); Line 829: $view->page_title = '404 File Not Found'; Line 830: $view->main_content = $page; Line 1608: * Creates a Page Not Found exception. Line 1613: protected $code = E_PAGE_NOT_FOUND; Line 1618: * @param string URL of page Line 1621: public function __construct($page = FALSE) Line 1623: if ($page === FALSE) Line 1625: // Construct the page URI using Router properties Line 1626: $page = Router::$current_uri.Router::$url_suffix.Router::$query_string; Line 1629: Exception::__construct(Kohana::lang('core.page_not_found', $page));
/sprout/Helpers/Admin.php Highlighted file source
Line 51: 'check_controller_entrance\[.*\]' => 'Only one page may reference any given module', Line 177: $add_tooltip = 'Add a block of content to the page.'; Line 263: * Deprecated wrapper around {@see Fb::pageDropdown} Line 266: * @param int $selected The id of the page to select Line 267: * @param int $exclude The id of the page to exclude from the list Line 268: * @param int $subsite_id The subsite of pages to show. Defaults to the current admin subsite Line 271: public static function pageDropdown($field_name, $selected = null, $exclude = null, $subsite_id = null, $top_text = 'None (top level page)') Line 273: echo Fb::pageDropdown($field_name, [], [ Line 281: * Used by the pages module Line 290: $admin_perms = AdminPerms::checkPermissionsTree('pages', $node['id']); Line 301: if (self::getControllerSlug() === 'page') { Line 598: $attrs = Register::getPageattrs(); Line 676: if (AdminPerms::controllerAccess('page', 'contents')) { Line 684: if ($selected_controller == 'page') { Line 685: echo '<li class="depth-1 on"><a href="admin/intro/page">Pages</a></li>'; Line 687: echo '<li class="depth-1"><a href="admin/intro/page">Pages</a></li>'; Line 773: * When in the admin, return the slug of the controller being used, e.g. 'page' or 'blog_post' Line 804: * @param string $tour_name Internal name for the tour, e.g. "page_edit" Line 823: * @param string $tour_name Internal name for the tour, e.g. "page_edit"
/sprout/Helpers/AdminDashboard.php Highlighted file source
Line 69: * A list of new content (pages, files, etc) Line 77: $tables['Page'] = 'pages'; Line 120: * A list of "need approval" pages currently in the system Line 126: $q = "SELECT pages.id, pages.name, DATE_FORMAT(page_revisions.date_modified, '%d/%m/%Y') AS date_modified, page_revisions.modified_editor Line 127: FROM ~page_revisions AS page_revisions Line 128: INNER JOIN ~pages AS pages ON page_revisions.page_id = pages.id Line 129: WHERE page_revisions.status = ? AND subsite_id = ? Line 130: GROUP BY pages.id Line 131: ORDER BY page_revisions.date_modified DESC Line 149: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs'); Line 151: return '<h3>Pages needing approval</h3>' . $itemlist->render();
/sprout/Helpers/Fb.php Highlighted file source
Line 811: * label for display upon page by calling the URL with the 'id' GET param set Line 865: * $_GET['ids'] (string) CSV of record IDs to poplate on page-load Line 1037: * Generates a page dropdown selection menu Line 1048: public static function pageDropdown($name, array $attrs = [], array $options = []) Line 1053: $options['root'] = Navigation::loadPageTree($options['subsite'], true, false); Line 1110: * @param Pagenode $node The node to display Line 1112: * @param int $selected The id of the page to select Line 1704: * You cannot have more than one of these on the page at a time
/sprout/Helpers/Fb.php Highlighted file source
Line 811: * label for display upon page by calling the URL with the 'id' GET param set Line 865: * $_GET['ids'] (string) CSV of record IDs to poplate on page-load Line 1037: * Generates a page dropdown selection menu Line 1048: public static function pageDropdown($name, array $attrs = [], array $options = []) Line 1053: $options['root'] = Navigation::loadPageTree($options['subsite'], true, false); Line 1110: * @param Pagenode $node The node to display Line 1112: * @param int $selected The id of the page to select Line 1704: * You cannot have more than one of these on the page at a time
/sprout/Helpers/FileConvert.php Highlighted file source
Line 89: * @param int $page_index Page number of document, 0-based (applies to PDFs and other page-based documents) Line 96: public static function imagemagick($in_file, $out_ext, $page_index = 0, $density = 400) { Line 97: $page_index = (int) $page_index; Line 104: $in_arg = escapeshellarg($in_file . '[' . $page_index . ']'); Line 129: * Use 'exiftool' to determine the number of pages in a file Line 133: * @return int Number of pages Line 135: * @throws FileConversionException exiftool was unable to determine the page count Line 137: public static function getPageCount($filename) { Line 152: if (isset($data[0]->PageCount)) { Line 153: return $data[0]->PageCount; Line 155: if (isset($data[0]->Pages)) { Line 156: return $data[0]->Pages; Line 160: throw new FileConversionException('Unable to determine page count'); Line 165: $count = self::getPageCount($dest_file_pdf);
/sprout/Helpers/FileConvert.php Highlighted file source
Line 89: * @param int $page_index Page number of document, 0-based (applies to PDFs and other page-based documents) Line 96: public static function imagemagick($in_file, $out_ext, $page_index = 0, $density = 400) { Line 97: $page_index = (int) $page_index; Line 104: $in_arg = escapeshellarg($in_file . '[' . $page_index . ']'); Line 129: * Use 'exiftool' to determine the number of pages in a file Line 133: * @return int Number of pages Line 135: * @throws FileConversionException exiftool was unable to determine the page count Line 137: public static function getPageCount($filename) { Line 152: if (isset($data[0]->PageCount)) { Line 153: return $data[0]->PageCount; Line 155: if (isset($data[0]->Pages)) { Line 156: return $data[0]->Pages; Line 160: throw new FileConversionException('Unable to determine page count'); Line 165: $count = self::getPageCount($dest_file_pdf);
/sprout/Helpers/ImportCMS.php Highlighted file source
Line 17: private static $page_ids = []; Line 23: * Process given XML file into Sprout CMS 3 pages Line 39: 'parent_id' => $_POST['page_id'] Line 44: MAX(page.record_order) AS o Line 46: ~pages AS page Line 48: page.parent_id = ?"; Line 50: $record_order = Pdb::query($q, [$_POST['page_id']], 'val'); Line 53: // Create pages and content widgets Line 54: foreach ($xml->page as $page) { Line 55: self::processXmlPage($page, $record_order ++, $_POST['page_id'], $_POST['subsite_id']); Line 63: foreach (self::$page_ids as $old_id => $new_id) { Line 76: * Process DOMElement into page record with content Line 78: * @param DomElement $page Line 85: private static function processXmlPage($page, $record_order, $parent_id, $subsite_id) Line 87: // Create page record Line 92: $fields['name'] = trim((string) $page['name']); Line 93: $fields['active'] = ((string)$page['active'] ? 1 : 0); Line 94: $fields['show_in_nav'] = ((string)$page['menu'] ? 1 : 0); Line 95: $fields['menu_group'] = (int) !empty($page['menu-group-position'])? (string) $page['menu-group-position'] : 0; Line 101: $fields['slug'] = Slug::unique(Enc::urlname($fields['name'], '-'), 'pages', $conds); Line 103: $fields['slug'] = Slug::create('pages', $fields['name']); Line 106: $page_id = Pdb::insert('pages', $fields); Line 108: // Map old page ID to new page ID Line 109: self::$page_ids[(int) $page['id']] = $page_id; Line 113: $fields['page_id'] = $page_id; Line 121: $revision_id = Pdb::insert('page_revisions', $fields); Line 123: // Map old page ID to new page ID Line 124: self::$revision_ids[(int) $page['id']] = $revision_id; Line 127: $html = (string) $page->content[0]; Line 134: $fields['page_revision_id'] = $revision_id; Line 141: Pdb::insert('page_widgets', $fields); Line 143: if (empty($page->children->page)) return; Line 146: foreach ($page->children->page as $child_page) { Line 147: self::processXmlPage($child_page, $record_order++, $page_id, $subsite_id); Line 162: $conditions[] = ['widget.page_revision_id', 'IN', self::$revision_ids]; Line 167: widget.page_revision_id, Line 170: ~page_widgets AS widget Line 179: $settings->text = self::replacePageIds($settings->text); Line 182: self::findOldWidgets($widget['page_revision_id'], $settings->text); Line 184: Pdb::update('page_widgets', ['settings' => json_encode(['text' => $settings->text])], [['id', '=', $widget['id']]]); Line 190: * Replace page IDs within page URLS Line 195: private static function replacePageIds($html) Line 197: return preg_replace_callback('!href="page/view_by_id/([0-9]+)"!', function ($matches) Line 199: if (isset(self::$page_ids[$matches[1]])) return 'href="page/view_by_id/' . self::$page_ids[$matches[1]] . '"'; Line 200: return 'href="unknown_page_' . $matches[1] . '"'; Line 206: * Report pages that contain old widgets
/sprout/Helpers/Navigation.php Highlighted file source
Line 26: /** @var PageNode|null */ Line 30: static private $page_node_matcher = null; Line 37: * Sets a matcher that should be used to find the current page in the tree Line 39: * @param TreeNodeMatcher $page_node_matcher The matcher to use Line 41: static public function setPageNodeMatcher($page_node_matcher) Line 43: self::$page_node_matcher = $page_node_matcher; Line 47: * Gets the matcher that is used to get the current page Line 51: static public function getPageNodeMatcher() Line 53: return self::$page_node_matcher; Line 58: * Loads the page tree from the database Line 60: * @param int $subsite_id The subsite to load pages from. If not provided, the current subsite is assumed. Line 64: * @return PageNode The root node of the tree Line 66: static public function loadPageTree($subsite_id = null, $is_admin = false, $set_root = true) Line 81: $where = "pages.subsite_id = ?"; Line 83: $where .= " AND pages.active = 1 AND revs.status = 'live'"; Line 86: $q = "SELECT pages.id, pages.parent_id, pages.slug, pages.name, pages.menu_group, pages.show_in_nav, Line 87: pages.alt_nav_title, pages.admin_perm_type, banners.filename AS banner, Line 89: pages.date_modified, revs.redirect Line 90: FROM ~pages AS pages Line 91: LEFT JOIN ~files AS banners ON pages.banner = banners.id Line 92: LEFT JOIN ~files AS gallery_thumbs ON pages.gallery_thumb = gallery_thumbs.id Line 93: INNER JOIN ~page_revisions AS revs ON revs.page_id = pages.id Line 95: GROUP BY pages.id Line 96: ORDER BY pages.parent_id, pages.record_order"; Line 104: $root_node = new Pagenode(array( Line 117: $needprocess[(int)$row['id']] = new Pagenode($row); Line 160: if (! self::$root_node) self::loadPageTree(); Line 188: * Draws a pmm2 menu, with the current page highlighted in the menu Line 195: if (! self::$root_node) self::loadPageTree(); Line 208: // Home page Line 212: if (Url::current() == 'home_page') { Line 219: // All the other pages Line 220: foreach (self::$root_node->children as $page) { Line 221: self::pmm2Drawnode ($page, 1, $pmm_max_depth, $pmm_nav_limit); Line 233: * @param PageNode $node The node to draw Line 239: if (self::$page_node_matcher != null) { Line 240: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 241: if ($page_node) { Line 242: $anc = $page_node->findAncestors(); Line 280: * Draws a superfish menu, with the current page highlighted in the menu Line 284: if (! self::$root_node) self::loadPageTree(); Line 298: // Home page Line 302: if (Url::current() == 'home_page') { Line 309: // All the other pages Line 310: foreach (self::$root_node->children as $page) { Line 312: self::superfishDrawnode ($page, 1, $pmm_max_depth); Line 328: if (self::$page_node_matcher != null) { Line 329: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 330: if ($page_node) { Line 331: $anc = $page_node->findAncestors(); Line 370: if (! self::$root_node) self::loadPageTree(); Line 380: // Home page Line 384: if (Url::current() == 'home_page') { Line 391: // All the other pages Line 392: foreach (self::$root_node->children as $page) { Line 393: self::currentRevealDrawnode($page, 1); Line 404: * @param PageNode $node The node to draw Line 410: if (self::$page_node_matcher != null) { Line 411: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 412: if ($page_node) { Line 413: $anc = $page_node->findAncestors(); Line 456: static public function zippmenuChildren($page_url) Line 458: if (! self::$root_node) self::loadPageTree(); Line 462: $page = self::$root_node->findNode(new TreenodePathMatcher($page_url)); Line 464: if ($page == null) return; Line 465: if (count($page->children) == 0) return; Line 468: // If there is a current page, note down the ancestors Line 470: if (self::$page_node_matcher != null) { Line 471: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 472: if ($page_node) { Line 473: $anc = $page_node->findAncestors(); Line 479: foreach ($page->children as $child) { Line 493: * Renders breadcrumbs for the current page Line 513: if (! self::$root_node) self::loadPageTree(); Line 515: // Load a page node from the page tree. Line 516: if (self::$page_node_matcher == null) { Line 520: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 521: if ($page_node == null) { Line 527: $node = $page_node; Line 604: if (! self::$root_node) self::loadPageTree(); Line 612: // Selected page detection Line 614: if (self::$page_node_matcher != null) { Line 615: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 616: if ($page_node) { Line 617: $anc = $page_node->findAncestors(); Line 624: // Show home page Line 628: if (Url::current() == 'home_page') { Line 636: foreach (self::$root_node->children as $page) { Line 639: if ($page === @$anc[0]) { Line 640: echo "<li class=\"nav{$i} on\"><a href=\"{$page->getFriendlyUrl()}\">", Enc::html($page->getNavigationName()), "</a></li>"; Line 642: echo "<li class=\"nav{$i}\"><a href=\"{$page->getFriendlyUrl()}\">", Enc::html($page->getNavigationName()), "</a></li>"; Line 652: * Builds the title that gets put into TITLE tags in the head of the page Line 653: * Just glues the site title onto the end of the page title Line 655: * @param string $page_title The title of the page Line 657: static public function buildBrowserTitle($page_title) Line 662: return sprintf($format, $page_title, Kohana::config('sprout.site_title')); Line 667: * Returns an array of all pages. Line 669: static public function getAllPages($parent = null, $indent = 0) Line 671: if (! self::$root_node) self::loadPageTree(); Line 677: $pages = array(); Line 678: foreach ($parent->children as $page) { Line 680: $pages[] = array( Line 681: $page['id'], Line 682: str_repeat(' ', $indent) . $page->getNavigationName(), Line 683: $page->getFriendlyUrl(), Line 686: $children = self::getAllPages($page, $indent + 1); Line 687: $pages = array_merge($pages, $children); Line 690: return $pages; Line 699: if (! self::$root_node) self::loadPageTree(); Line 701: if (! self::$page_node_matcher) return null; Line 703: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 704: if (! $page_node) return null; Line 706: return $page_node->getBanner(); Line 715: if (! self::$root_node) self::loadPageTree(); Line 716: if (! self::$page_node_matcher) return Kohana::config('sprout.site_title'); Line 718: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 719: if (! $page_node) return Kohana::config('sprout.site_title'); Line 721: $ancestors = $page_node->findAncestors(); Line 729: * Finds the node in the page tree which matched the specified {@see TreenodeMatcher}. Line 735: if (! self::$root_node) self::loadPageTree(); Line 736: if (! self::$page_node_matcher) return null; Line 738: return self::$root_node->findNode(self::$page_node_matcher); Line 756: if (! self::$root_node) self::loadPageTree(); Line 770: // Home page Line 774: if (Url::current() == 'home_page' || Url::current() == null) { Line 775: echo "<li class=\"menu-item menu-item-depth1 menu-home-page menu-current-item\"><a href=\"{$home_url}\">Home</a></li>"; Line 777: echo "<li class=\"menu-item menu-item-depth1 menu-home-page\"><a href=\"{$home_url}\">Home</a></li>"; Line 781: // All the other pages Line 782: foreach (self::$root_node->children as $page) { Line 784: self::simpleMenuDrawnode ($page, 1, $pmm_max_depth); Line 799: $page_node = null; Line 801: if (self::$page_node_matcher != null) { Line 802: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 803: if ($page_node) { Line 804: $anc = $page_node->findAncestors(); Line 815: // If the page is the current item
/sprout/Helpers/Navigation.php Highlighted file source
Line 26: /** @var PageNode|null */ Line 30: static private $page_node_matcher = null; Line 37: * Sets a matcher that should be used to find the current page in the tree Line 39: * @param TreeNodeMatcher $page_node_matcher The matcher to use Line 41: static public function setPageNodeMatcher($page_node_matcher) Line 43: self::$page_node_matcher = $page_node_matcher; Line 47: * Gets the matcher that is used to get the current page Line 51: static public function getPageNodeMatcher() Line 53: return self::$page_node_matcher; Line 58: * Loads the page tree from the database Line 60: * @param int $subsite_id The subsite to load pages from. If not provided, the current subsite is assumed. Line 64: * @return PageNode The root node of the tree Line 66: static public function loadPageTree($subsite_id = null, $is_admin = false, $set_root = true) Line 81: $where = "pages.subsite_id = ?"; Line 83: $where .= " AND pages.active = 1 AND revs.status = 'live'"; Line 86: $q = "SELECT pages.id, pages.parent_id, pages.slug, pages.name, pages.menu_group, pages.show_in_nav, Line 87: pages.alt_nav_title, pages.admin_perm_type, banners.filename AS banner, Line 89: pages.date_modified, revs.redirect Line 90: FROM ~pages AS pages Line 91: LEFT JOIN ~files AS banners ON pages.banner = banners.id Line 92: LEFT JOIN ~files AS gallery_thumbs ON pages.gallery_thumb = gallery_thumbs.id Line 93: INNER JOIN ~page_revisions AS revs ON revs.page_id = pages.id Line 95: GROUP BY pages.id Line 96: ORDER BY pages.parent_id, pages.record_order"; Line 104: $root_node = new Pagenode(array( Line 117: $needprocess[(int)$row['id']] = new Pagenode($row); Line 160: if (! self::$root_node) self::loadPageTree(); Line 188: * Draws a pmm2 menu, with the current page highlighted in the menu Line 195: if (! self::$root_node) self::loadPageTree(); Line 208: // Home page Line 212: if (Url::current() == 'home_page') { Line 219: // All the other pages Line 220: foreach (self::$root_node->children as $page) { Line 221: self::pmm2Drawnode ($page, 1, $pmm_max_depth, $pmm_nav_limit); Line 233: * @param PageNode $node The node to draw Line 239: if (self::$page_node_matcher != null) { Line 240: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 241: if ($page_node) { Line 242: $anc = $page_node->findAncestors(); Line 280: * Draws a superfish menu, with the current page highlighted in the menu Line 284: if (! self::$root_node) self::loadPageTree(); Line 298: // Home page Line 302: if (Url::current() == 'home_page') { Line 309: // All the other pages Line 310: foreach (self::$root_node->children as $page) { Line 312: self::superfishDrawnode ($page, 1, $pmm_max_depth); Line 328: if (self::$page_node_matcher != null) { Line 329: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 330: if ($page_node) { Line 331: $anc = $page_node->findAncestors(); Line 370: if (! self::$root_node) self::loadPageTree(); Line 380: // Home page Line 384: if (Url::current() == 'home_page') { Line 391: // All the other pages Line 392: foreach (self::$root_node->children as $page) { Line 393: self::currentRevealDrawnode($page, 1); Line 404: * @param PageNode $node The node to draw Line 410: if (self::$page_node_matcher != null) { Line 411: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 412: if ($page_node) { Line 413: $anc = $page_node->findAncestors(); Line 456: static public function zippmenuChildren($page_url) Line 458: if (! self::$root_node) self::loadPageTree(); Line 462: $page = self::$root_node->findNode(new TreenodePathMatcher($page_url)); Line 464: if ($page == null) return; Line 465: if (count($page->children) == 0) return; Line 468: // If there is a current page, note down the ancestors Line 470: if (self::$page_node_matcher != null) { Line 471: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 472: if ($page_node) { Line 473: $anc = $page_node->findAncestors(); Line 479: foreach ($page->children as $child) { Line 493: * Renders breadcrumbs for the current page Line 513: if (! self::$root_node) self::loadPageTree(); Line 515: // Load a page node from the page tree. Line 516: if (self::$page_node_matcher == null) { Line 520: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 521: if ($page_node == null) { Line 527: $node = $page_node; Line 604: if (! self::$root_node) self::loadPageTree(); Line 612: // Selected page detection Line 614: if (self::$page_node_matcher != null) { Line 615: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 616: if ($page_node) { Line 617: $anc = $page_node->findAncestors(); Line 624: // Show home page Line 628: if (Url::current() == 'home_page') { Line 636: foreach (self::$root_node->children as $page) { Line 639: if ($page === @$anc[0]) { Line 640: echo "<li class=\"nav{$i} on\"><a href=\"{$page->getFriendlyUrl()}\">", Enc::html($page->getNavigationName()), "</a></li>"; Line 642: echo "<li class=\"nav{$i}\"><a href=\"{$page->getFriendlyUrl()}\">", Enc::html($page->getNavigationName()), "</a></li>"; Line 652: * Builds the title that gets put into TITLE tags in the head of the page Line 653: * Just glues the site title onto the end of the page title Line 655: * @param string $page_title The title of the page Line 657: static public function buildBrowserTitle($page_title) Line 662: return sprintf($format, $page_title, Kohana::config('sprout.site_title')); Line 667: * Returns an array of all pages. Line 669: static public function getAllPages($parent = null, $indent = 0) Line 671: if (! self::$root_node) self::loadPageTree(); Line 677: $pages = array(); Line 678: foreach ($parent->children as $page) { Line 680: $pages[] = array( Line 681: $page['id'], Line 682: str_repeat(' ', $indent) . $page->getNavigationName(), Line 683: $page->getFriendlyUrl(), Line 686: $children = self::getAllPages($page, $indent + 1); Line 687: $pages = array_merge($pages, $children); Line 690: return $pages; Line 699: if (! self::$root_node) self::loadPageTree(); Line 701: if (! self::$page_node_matcher) return null; Line 703: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 704: if (! $page_node) return null; Line 706: return $page_node->getBanner(); Line 715: if (! self::$root_node) self::loadPageTree(); Line 716: if (! self::$page_node_matcher) return Kohana::config('sprout.site_title'); Line 718: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 719: if (! $page_node) return Kohana::config('sprout.site_title'); Line 721: $ancestors = $page_node->findAncestors(); Line 729: * Finds the node in the page tree which matched the specified {@see TreenodeMatcher}. Line 735: if (! self::$root_node) self::loadPageTree(); Line 736: if (! self::$page_node_matcher) return null; Line 738: return self::$root_node->findNode(self::$page_node_matcher); Line 756: if (! self::$root_node) self::loadPageTree(); Line 770: // Home page Line 774: if (Url::current() == 'home_page' || Url::current() == null) { Line 775: echo "<li class=\"menu-item menu-item-depth1 menu-home-page menu-current-item\"><a href=\"{$home_url}\">Home</a></li>"; Line 777: echo "<li class=\"menu-item menu-item-depth1 menu-home-page\"><a href=\"{$home_url}\">Home</a></li>"; Line 781: // All the other pages Line 782: foreach (self::$root_node->children as $page) { Line 784: self::simpleMenuDrawnode ($page, 1, $pmm_max_depth); Line 799: $page_node = null; Line 801: if (self::$page_node_matcher != null) { Line 802: $page_node = self::$root_node->findNode(self::$page_node_matcher); Line 803: if ($page_node) { Line 804: $anc = $page_node->findAncestors(); Line 815: // If the page is the current item
/sprout/Helpers/Page.php Highlighted file source
Line 24: * Methods for working with CMS pages Line 26: class Page Line 30: * Get the page id for a given URL Line 46: * Return the URL for a page, when given the page id Line 49: * @param int $id The page id to return the URL for Line 50: * @return string The friendly URL for the page Line 61: return 'page/view_by_id/' . $id; Line 69: * Fetches the URL for a tool page for a specific controller entrance method Line 72: * @return string The URL to access the tool page Line 73: * @throws Exception if there's no matching tool page in the {@see Navigation} tree Line 80: if (!$node) throw new Exception('Page for controller entrance not found'); Line 86: * Set up metadata and social metadata for a tool page Line 88: * @return array $page Page record from database Line 91: public static function setupToolPage() Line 96: $page = Pdb::get('pages', $node['id']); Line 98: static::loadPageMeta($page); Line 99: static::loadPageSocial($page, $node); Line 101: return $page; Line 106: * Load page metadata - description and keywords Line 108: * @param array $page Page record from database Line 110: public static function loadPageMeta(array $page) Line 112: if (!empty($page['meta_description'])) { Line 113: Needs::addMeta('description', $page['meta_description']); Line 115: if (!empty($page['meta_keywords'])) { Line 116: Needs::addMeta('keywords', $page['meta_keywords']); Line 122: * Load page social - title, image, description, url Line 124: * @param array $page Page record from database Line 125: * @param Pagenode $node Node, for generating the URL; optional Line 127: public static function loadPageSocial(array $page, Pagenode $node = null) Line 129: SocialMeta::setTitle($page['name']); Line 131: if (!empty($page['gallery_thumb'])) { Line 132: SocialMeta::setImage($page['gallery_thumb']); Line 133: } else if (!empty($page['banner'])) { Line 134: SocialMeta::setImage($page['banner']); Line 137: if (!empty($page['meta_description'])) { Line 138: SocialMeta::setDescription($page['meta_description']); Line 148: * Inject page details -- title and browser title -- into a skin view Line 151: * @param array $page Page to pull details from Line 153: public static function injectPageSkin(View $skin, array $page) Line 155: if (!empty($page['name'])) { Line 156: $skin->page_title = $page['name']; Line 158: if (!empty($page['alt_browser_title'])) { Line 159: $skin->browser_title = $page['alt_browser_title']; Line 165: * Gets the embedded widgets (i.e. content blocks) for a page Line 166: * @param int $rev_id Page revision ID from database (page_revisions.id) Line 181: FROM ~page_widgets Line 182: WHERE page_revision_id = ? AND area_id = 1 {$active} Line 189: * Get the page text for a page id, in HTML format, with widgets and everything, ready to go Line 191: * @param int $page_id Page ID from database Line 194: * N.B. if specified, it must be a valid revision for the specified page Line 200: public static function getText($page_id, $rev_id = 0, $subsite_id = null) Line 202: $page_id = (int) $page_id; Line 209: 'id' => $page_id, Line 220: FROM ~pages AS page Line 221: INNER JOIN ~page_revisions AS rev ON page.id = rev.page_id AND {$clause} Line 222: WHERE page.id = :id AND page.subsite_id = :subsite_id Line 227: // No live revision means this is a new, blank page Line 252: * Returns an array of key-value pairs of all attributes for a page Line 261: $q = "SELECT name, value FROM ~page_attributes WHERE page_id = ?"; Line 270: * Returns an array pages which contain a given attribute. Line 274: * @return array Page IDs Line 277: public static function pagesWithAttr($attr_name, $attr_value = null) Line 286: $q = "SELECT page_id FROM ~page_attributes WHERE {$where} ORDER BY page_id"; Line 292: * Find pages with a given widget, and optionally the specified settings. Line 293: * Only widgets on live revisions of active pages are checked. Line 296: * @return array Page IDs Line 299: public static function pagesWithWidget($widget_name, array $settings = []) Line 301: $q = "SELECT page.id, widget.settings Line 302: FROM ~page_widgets AS widget Line 303: INNER JOIN ~page_revisions AS rev ON widget.page_revision_id = rev.id AND rev.status = 'live' Line 304: INNER JOIN ~pages AS page ON rev.page_id = page.id AND page.active = 1 Line 311: $pages = []; Line 316: $pages[] = $row['id']; Line 321: return $pages; Line 326: * Return the last-modified date of the specified page. Line 329: * If you don't provide a page-id, uses the id of the Line 335: * @param int $page_id The page to get the last-modified date of Line 338: * @return null If page could not be found Line 340: public static function lastModified($page_id = null, $date_format = 'd/m/Y') Line 342: if ($page_id === null) { Line 345: $page_id = $node['id']; Line 350: FROM ~pages Line 354: $date = Pdb::query($q, [$page_id], 'val'); Line 372: $q = "SELECT page_id FROM ~page_revisions WHERE id = ?"; Line 373: $page_id = Pdb::q($q, [$rev_id], 'val'); Line 375: $old_clause = ['page_id' => $page_id, 'status' => 'live']; Line 376: Pdb::update('page_revisions', ['status' => 'old'], $old_clause); Line 378: Pdb::update('page_revisions', ['status' => 'live'], ['id' => $rev_id]); Line 383: * Return list of related links for given page Line 385: * @param int $page_id Line 388: public static function determineRelatedLinks($page_id) Line 395: $matcher = new TreenodeIdsMatcher([$page_id]); Line 398: $page_node = $root_node->findNode($matcher); Line 399: if ($page_node == null) return $list; Line 401: $ancestors = $page_node->findAncestors(); Line 411: foreach ($top_anc->children as $page) { Line 412: $list = array_merge($list, self::determineNodeLinks($page, 0)); Line 422: * Traverse page node to extract page links
/sprout/Helpers/Pagenode.php Highlighted file source
Line 22: * Represents a page in a page tree Line 24: class Pagenode extends Treenode Line 32: throw new Exception("Method not supported for page trees, use Navigation::loadPageTree instead."); Line 85: * Returns the name of this page only, when constructing a URL Line 96: if (in_array($name, Constants::$conflict_page_urls)) { Line 105: * Returns NULL if no banner has been defined for this page and a generic banner should be used instead.
/sprout/Helpers/PageRouting.php Highlighted file source
Line 20: * Logic for selecting the page if no controller matches Line 22: class PageRouting Line 75: Router::$controller = 'SproutModules\Karmabunny\HomePage\Controllers\HomePageController'; Line 86: Router::$controller = 'Sprout\\Controllers\\PageController'; Line 88: // Look for a valid page
/sprout/Helpers/Register.php Highlighted file source
Line 30: private static $extra_pages = array(); Line 31: private static $pageattrs = array(); Line 69: * Register a type for an extra page Line 71: public static function extraPage($name, $label) Line 73: self::$extra_pages[$name] = $label; Line 77: * Get all extra pages Line 79: public static function getExtraPages() Line 81: return self::$extra_pages; Line 86: * Register a type for an extra page Line 92: public static function pageattr($name, $label, $editor = 'Sprout\\Helpers\\AttrEditorTextbox') Line 96: self::$pageattrs[$name] = array($label, $editor); Line 100: * Get all extra pages Line 102: public static function getPageattrs() Line 104: return self::$pageattrs; Line 109: * Register a front-end controller (also called a tool page) Line 238: * @param array $names The names of the modules, e.g. ['HomePage', 'Users'] Line 250: * @param string $name The name of the module, e.g. 'home_page' Line 293: self::$admin_controllers['extra_page'] = '\\Sprout\\Controllers\\Admin\\ExtraPageAdminController'; Line 295: self::$admin_controllers['page'] = '\\Sprout\\Controllers\\Admin\\PageAdminController'; Line 303: * name but not 'Controllers' segment, e.g. Karmabunny\HomePage\Admin Line 305: * names within the specified namespace, e.g. ['home' => 'Admin\HomePageAdminController'] Line 394: * Register a widget "tile", which is shown when adding widgets (content blocks) to a page Line 542: * Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate'); Line 629: * @param string $table The name of the keywords table, e.g. page_keywords
/sprout/Helpers/Register.php Highlighted file source
Line 30: private static $extra_pages = array(); Line 31: private static $pageattrs = array(); Line 69: * Register a type for an extra page Line 71: public static function extraPage($name, $label) Line 73: self::$extra_pages[$name] = $label; Line 77: * Get all extra pages Line 79: public static function getExtraPages() Line 81: return self::$extra_pages; Line 86: * Register a type for an extra page Line 92: public static function pageattr($name, $label, $editor = 'Sprout\\Helpers\\AttrEditorTextbox') Line 96: self::$pageattrs[$name] = array($label, $editor); Line 100: * Get all extra pages Line 102: public static function getPageattrs() Line 104: return self::$pageattrs; Line 109: * Register a front-end controller (also called a tool page) Line 238: * @param array $names The names of the modules, e.g. ['HomePage', 'Users'] Line 250: * @param string $name The name of the module, e.g. 'home_page' Line 293: self::$admin_controllers['extra_page'] = '\\Sprout\\Controllers\\Admin\\ExtraPageAdminController'; Line 295: self::$admin_controllers['page'] = '\\Sprout\\Controllers\\Admin\\PageAdminController'; Line 303: * name but not 'Controllers' segment, e.g. Karmabunny\HomePage\Admin Line 305: * names within the specified namespace, e.g. ['home' => 'Admin\HomePageAdminController'] Line 394: * Register a widget "tile", which is shown when adding widgets (content blocks) to a page Line 542: * Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate'); Line 629: * @param string $table The name of the keywords table, e.g. page_keywords
/sprout/Helpers/RteLibraryPages.php Highlighted file source
Line 17: * Richtext library for pages Line 19: class RteLibraryPages extends RteLibrary Line 21: protected $name = 'Pages'; Line 45: $root = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 50: // This page Line 56: 'href' => 'page/view_by_id/' . $node['id'], Line 65: // Children pages Line 78: 'href' => 'page/view_by_id/' . $row['id'], Line 100: $conditions[] = ['pages.name', 'CONTAINS', $term]; Line 105: $q = "SELECT pages.id, pages.name, pages.date_modified Line 106: FROM ~pages AS pages Line 107: WHERE pages.active = 1 Line 109: ORDER BY pages.name"; Line 118: 'href' => Page::url($row['id']),
/sprout/Helpers/RteLibraryPages.php Highlighted file source
Line 17: * Richtext library for pages Line 19: class RteLibraryPages extends RteLibrary Line 21: protected $name = 'Pages'; Line 45: $root = Navigation::loadPageTree($_SESSION['admin']['active_subsite'], true); Line 50: // This page Line 56: 'href' => 'page/view_by_id/' . $node['id'], Line 65: // Children pages Line 78: 'href' => 'page/view_by_id/' . $row['id'], Line 100: $conditions[] = ['pages.name', 'CONTAINS', $term]; Line 105: $q = "SELECT pages.id, pages.name, pages.date_modified Line 106: FROM ~pages AS pages Line 107: WHERE pages.active = 1 Line 109: ORDER BY pages.name"; Line 118: 'href' => Page::url($row['id']),
/sprout/Helpers/SearchHandler.php Highlighted file source
Line 32: * @param string $table The name of the keywords table, e.g. page_keywords Line 50: * Gets the table name for the keywords table, e.g. page_keywords Line 58: * Gets the table name for the main table, e.g. pages Line 66: * Sets the table name for the keywords table, e.g. page_keywords Line 77: * Gets the controller name, e.g. PageController Line 85: * Sets the controller name, e.g. PageController. The specified controller must implement the FrontEndSearch interface.
/sprout/Helpers/SessionStats.php Highlighted file source
Line 38: 'page', Line 78: 'pageviews' => [], Line 113: * Track a page view in the session Line 115: public static function trackPageView() Line 120: if (empty($_SESSION['stats']['pageviews'][$url])) { Line 121: $_SESSION['stats']['pageviews'][$url] = 1; Line 123: $_SESSION['stats']['pageviews'][$url] += 1; Line 154: * Return the total number of page views Line 156: * @return int Num page views Line 158: public static function totalPageviews() Line 161: return array_sum($_SESSION['stats']['pageviews']); Line 169: * Return the total number of unique page views Line 171: * @return int Num page views Line 173: public static function uniquePageviews() Line 176: return count($_SESSION['stats']['pageviews']); Line 184: * Return the number of page views for a given url Line 187: * @return int Num page views Line 189: public static function numPageviews($url) Line 194: if (!empty($_SESSION['stats']['pageviews'][$url])) { Line 195: return $_SESSION['stats']['pageviews'][$url];
/sprout/Helpers/SitemapGenPages.php Highlighted file source
Line 17: use Sprout\Helpers\Pagenode; Line 21: class SitemapGenPages extends SitemapGen Line 25: * Loads content page URLs and calls {@see SitemapGenPages::childrenPages} to output their XML URLs in the sitemap Line 32: $this->childrenPages($root, 0.9); Line 37: * Outputs XML URLs for the children of a page in the sitemap, recursively until all descendents have been output Line 38: * @param Pagenode $node The page which should have its children/descendents output Line 39: * @param float $prio Priority for matching pages; the deeper the pages are, the lower priority they are given Line 42: private function childrenPages(Pagenode $node, $prio) Line 46: $this->childrenPages($child, $prio - 0.1);
/sprout/Helpers/SitemapGenPages.php Highlighted file source
Line 17: use Sprout\Helpers\Pagenode; Line 21: class SitemapGenPages extends SitemapGen Line 25: * Loads content page URLs and calls {@see SitemapGenPages::childrenPages} to output their XML URLs in the sitemap Line 32: $this->childrenPages($root, 0.9); Line 37: * Outputs XML URLs for the children of a page in the sitemap, recursively until all descendents have been output Line 38: * @param Pagenode $node The page which should have its children/descendents output Line 39: * @param float $prio Priority for matching pages; the deeper the pages are, the lower priority they are given Line 42: private function childrenPages(Pagenode $node, $prio) Line 46: $this->childrenPages($child, $prio - 0.1);
/sprout/Helpers/SocialMeta.php Highlighted file source
Line 38: * Set a title for this page. Don't include the site name Line 49: * Has a page title been set? Line 60: * Set the image for this page - should be unique to this page; not shared across the site Line 77: * Set a short (up to two sentence) description for this page Line 88: * Set the canonical url for this page Line 102: * The page type, i.e. "og:type" property Line 110: public static function setPageType($val)
/sprout/Helpers/SocialMeta.php Highlighted file source
Line 38: * Set a title for this page. Don't include the site name Line 49: * Has a page title been set? Line 60: * Set the image for this page - should be unique to this page; not shared across the site Line 77: * Set a short (up to two sentence) description for this page Line 88: * Set the canonical url for this page Line 102: * The page type, i.e. "og:type" property Line 110: public static function setPageType($val)
/sprout/Helpers/Sprout.php Highlighted file source
Line 56: // e.g. SproutModules\Karmabunny\Pages => Pages Line 459: * Load the text for an extra page. Line 462: * @param int $type The page type, should be one of the type constants Line 464: public static function extraPage($type) Line 469: FROM ~extra_pages Line 615: * Translate an array which may contain a page_id, filename or url into the final URL to use Line 619: if ($row['page_id']) { Line 621: $page = $root->findNodeValue('id', $row['page_id']); Line 622: if ($page) { Line 623: return $page->getFriendlyUrl(); Line 640: * Return the last-modified date of all pages on the (sub-)site Line 654: FROM ~pages
/sprout/Helpers/TreenodePageAttrMatcher.php Highlighted file source
Line 23: class TreenodePageAttrMatcher implements TreenodeMatcher Line 25: private $page_ids; Line 33: * Can be null to match all pages which contain the attribute, irrespective of the value. Line 37: $this->page_ids = Page::pagesWithAttr($attr_name, $attr_value); Line 49: if (in_array($node['id'], $this->page_ids)) return true;
/sprout/Helpers/TreenodePageAttrMatcher.php Highlighted file source
Line 23: class TreenodePageAttrMatcher implements TreenodeMatcher Line 25: private $page_ids; Line 33: * Can be null to match all pages which contain the attribute, irrespective of the value. Line 37: $this->page_ids = Page::pagesWithAttr($attr_name, $attr_value); Line 49: if (in_array($node['id'], $this->page_ids)) return true;
/sprout/Helpers/WorkerLinkChecker.php Highlighted file source
Line 27: 1 => 'Total pages', Line 28: 2 => 'Pages processed', Line 38: $q = "SELECT page.id, page.subsite_id, page.name, MAX(rev.id) AS rev_id Line 39: FROM ~pages AS page Line 40: INNER JOIN ~page_revisions AS rev ON rev.page_id = page.id Line 42: WHERE page.active = 1 Line 43: GROUP BY page.id Line 44: ORDER BY page.id"; Line 47: // Fetch and collate rich text widgets to produce page text Line 58: FROM ~page_revisions AS rev Line 59: INNER JOIN ~page_widgets AS widget ON rev.id = widget.page_revision_id Line 78: Worker::message('Found ' . count($res) . ' page(s) total'); Line 87: Worker::message("Checking page # {$row['id']}; '{$row['name']}'"); Line 89: $found += $this->checkPage($row, $errs); Line 95: Worker::message(count($errs) . ' pages have bad link(s)'); Line 152: * Checks a single page Line 154: private function checkPage(&$row, &$errs) Line 171: $errs[$resultname][] = array('page_id' => $row['id'], 'page_name' => $row['name'], 'link_href' => $href, 'link_text' => $elem->textContent, 'err' => $found);
/sprout/i18n/en_US/errors.php Highlighted file source
Line 18: E_PAGE_NOT_FOUND => array( 1, 'Page Not Found', 'The requested page was not found. It may have moved, been deleted, or archived.'), Line 20: E_RECOVERABLE_ERROR => array( 1, 'Recoverable Error', 'An error was detected which prevented the loading of this page. If this problem persists, please contact the website administrator.'),
/sprout/i18n/en_US/errors.php Highlighted file source
Line 18: E_PAGE_NOT_FOUND => array( 1, 'Page Not Found', 'The requested page was not found. It may have moved, been deleted, or archived.'), Line 20: E_RECOVERABLE_ERROR => array( 1, 'Recoverable Error', 'An error was detected which prevented the loading of this page. If this problem persists, please contact the website administrator.'),
/sprout/sprout_load.php Highlighted file source
Line 23: Register::extraPage(1, '404 error'); Line 24: Register::extraPage(2, 'Admin login message'); Line 26: Register::pageattr('sprout.notes', 'Notes', 'AttrEditorMultiline'); Line 27: Register::pageattr('sprout.admin_notes', 'Admin notes', 'AttrEditorMultiline'); Line 28: Register::pageattr('sprout.department', 'Department'); Line 29: Register::pageattr('sprout.document_no', 'Document No.'); Line 30: Register::pageattr('sprout.maintainer', 'Maintainer'); Line 31: Register::pageattr('sprout.orig_author', 'Orig. Author'); Line 32: Register::pageattr('sprout.lang', 'Language'); Line 36: Register::linkspec('\\Sprout\\Helpers\\LinkSpecPage', 'Internal Page'); Line 39: Register::rteLibrary('\\Sprout\\Helpers\\RteLibraryPages'); Line 44: Register::sitemapGen('\\Sprout\\Helpers\\SitemapGenPages'); Line 46: Register::searchHandler('Sprout\\Controllers\\PageController', 'page_keywords', ['main.active = 1', 'main.show_in_nav = 1']); Line 55: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate'); Line 56: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageDeactivate'); Line 57: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronCheckStale'); Line 67: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Session\\ThisPageviews', 'Session', 'Pageviews'); Line 68: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Session\\TotalPageviews', 'Session', 'Pageviews (total)'); Line 69: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Session\\UniquePageviews', 'Session', 'Pageviews (unique)'); Line 79: 'Formatted page content', Line 90: 'Formatted page content', Line 92: 'ChildrenPages' => 'Page lists', Line 93: 'ChildrenGallery' => 'Page gallery', Line 136: 'Page content', Line 147: 'Formatted page content', Line 149: 'ChildrenPages' => 'Children pages',
/sprout/sprout_load.php Highlighted file source
Line 23: Register::extraPage(1, '404 error'); Line 24: Register::extraPage(2, 'Admin login message'); Line 26: Register::pageattr('sprout.notes', 'Notes', 'AttrEditorMultiline'); Line 27: Register::pageattr('sprout.admin_notes', 'Admin notes', 'AttrEditorMultiline'); Line 28: Register::pageattr('sprout.department', 'Department'); Line 29: Register::pageattr('sprout.document_no', 'Document No.'); Line 30: Register::pageattr('sprout.maintainer', 'Maintainer'); Line 31: Register::pageattr('sprout.orig_author', 'Orig. Author'); Line 32: Register::pageattr('sprout.lang', 'Language'); Line 36: Register::linkspec('\\Sprout\\Helpers\\LinkSpecPage', 'Internal Page'); Line 39: Register::rteLibrary('\\Sprout\\Helpers\\RteLibraryPages'); Line 44: Register::sitemapGen('\\Sprout\\Helpers\\SitemapGenPages'); Line 46: Register::searchHandler('Sprout\\Controllers\\PageController', 'page_keywords', ['main.active = 1', 'main.show_in_nav = 1']); Line 55: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageActivate'); Line 56: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronPageDeactivate'); Line 57: Register::cronJob('daily', 'Sprout\\Controllers\\Admin\\PageAdminController', 'cronCheckStale'); Line 67: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Session\\ThisPageviews', 'Session', 'Pageviews'); Line 68: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Session\\TotalPageviews', 'Session', 'Pageviews (total)'); Line 69: Register::displayCondition('Sprout\\Helpers\\DisplayConditions\\Session\\UniquePageviews', 'Session', 'Pageviews (unique)'); Line 79: 'Formatted page content', Line 90: 'Formatted page content', Line 92: 'ChildrenPages' => 'Page lists', Line 93: 'ChildrenGallery' => 'Page gallery', Line 136: 'Page content', Line 147: 'Formatted page content', Line 149: 'ChildrenPages' => 'Children pages',
/sprout/tests/navigationTest.php Highlighted file source
Line 21: // pages.id, pages.parent_id, pages.active, pages.name, page_revisions.type, page_revisions.status Line 22: private static $fake_pages = [ Line 30: * Duplicate pages tables and then inject some fake data Line 36: $q = "CREATE TEMPORARY TABLE unit_test_{$rand}_pages SELECT * FROM ~pages WHERE 0"; Line 39: $q = "CREATE TEMPORARY TABLE unit_test_{$rand}_page_revisions SELECT * FROM ~page_revisions WHERE 0"; Line 42: foreach (self::$fake_pages as $pg) { Line 47: $q = "INSERT INTO unit_test_{$rand}_pages SET id = ?, subsite_id = 1, parent_id = ?, active = ?, name = ?, slug = ?"; Line 51: $q = "INSERT INTO unit_test_{$rand}_page_revisions SET page_id = ?, type = ?, status = ?"; Line 56: Pdb::setTablePrefixOverride('pages', "unit_test_{$rand}_"); Line 57: Pdb::setTablePrefixOverride('page_revisions', "unit_test_{$rand}_"); Line 65: $q = "SELECT * FROM ~pages WHERE parent_id = 0"; Line 66: $top_pages = Pdb::query($q, [], 'arr'); Line 67: $this->assertCount(4, $top_pages); Line 68: $this->assertEquals('Top level one - std live', $top_pages[0]['name']); Line 69: $this->assertEquals('Top level two - std live', $top_pages[1]['name']); Line 70: $this->assertEquals('Top level three - inactive', $top_pages[2]['name']); Line 71: $this->assertEquals('Top level four - unpublished', $top_pages[3]['name']); Line 79: Pdb::setTablePrefixOverride('pages', Pdb::prefix()); Line 80: Pdb::setTablePrefixOverride('page_revisions', Pdb::prefix()); Line 85: * Admin loading should bring in all pages, including inactive and unpublished Line 87: public function testLoadPageTree__Admin() Line 89: $root = Navigation::loadPageTree(1, true, false); Line 98: * Front-end loading should not bring in inactive pages Line 100: public function testLoadPageTree__FrontEnd() Line 102: $root = Navigation::loadPageTree(1, false, false);
/sprout/tests/navigationTest.php Highlighted file source
Line 21: // pages.id, pages.parent_id, pages.active, pages.name, page_revisions.type, page_revisions.status Line 22: private static $fake_pages = [ Line 30: * Duplicate pages tables and then inject some fake data Line 36: $q = "CREATE TEMPORARY TABLE unit_test_{$rand}_pages SELECT * FROM ~pages WHERE 0"; Line 39: $q = "CREATE TEMPORARY TABLE unit_test_{$rand}_page_revisions SELECT * FROM ~page_revisions WHERE 0"; Line 42: foreach (self::$fake_pages as $pg) { Line 47: $q = "INSERT INTO unit_test_{$rand}_pages SET id = ?, subsite_id = 1, parent_id = ?, active = ?, name = ?, slug = ?"; Line 51: $q = "INSERT INTO unit_test_{$rand}_page_revisions SET page_id = ?, type = ?, status = ?"; Line 56: Pdb::setTablePrefixOverride('pages', "unit_test_{$rand}_"); Line 57: Pdb::setTablePrefixOverride('page_revisions', "unit_test_{$rand}_"); Line 65: $q = "SELECT * FROM ~pages WHERE parent_id = 0"; Line 66: $top_pages = Pdb::query($q, [], 'arr'); Line 67: $this->assertCount(4, $top_pages); Line 68: $this->assertEquals('Top level one - std live', $top_pages[0]['name']); Line 69: $this->assertEquals('Top level two - std live', $top_pages[1]['name']); Line 70: $this->assertEquals('Top level three - inactive', $top_pages[2]['name']); Line 71: $this->assertEquals('Top level four - unpublished', $top_pages[3]['name']); Line 79: Pdb::setTablePrefixOverride('pages', Pdb::prefix()); Line 80: Pdb::setTablePrefixOverride('page_revisions', Pdb::prefix()); Line 85: * Admin loading should bring in all pages, including inactive and unpublished Line 87: public function testLoadPageTree__Admin() Line 89: $root = Navigation::loadPageTree(1, true, false); Line 98: * Front-end loading should not bring in inactive pages Line 100: public function testLoadPageTree__FrontEnd() Line 102: $root = Navigation::loadPageTree(1, false, false);
/sprout/tests/pageTest.php Highlighted file source
Line 14: use Sprout\Helpers\Page; Line 18: class pageTest extends PHPUnit_Framework_TestCase Line 23: $pages = Pdb::lookup('pages'); Line 25: if (count($pages) === 0) { Line 26: $this->markTestSkipped('Cannot test page URLs without any pages in the database'); Line 29: $integer = Page::url((int) key($pages)); Line 32: $string = Page::url((string) key($pages)); Line 37: $url = Page::url(2362728); Line 38: $this->assertTrue($url == 'page/view_by_id/2362728'); Line 40: $url = Page::url('2362728'); Line 41: $this->assertTrue($url == 'page/view_by_id/2362728'); Line 43: $url = Page::url('abcde'); Line 46: $url = Page::url(array());
/sprout/tests/pageTest.php Highlighted file source
Line 14: use Sprout\Helpers\Page; Line 18: class pageTest extends PHPUnit_Framework_TestCase Line 23: $pages = Pdb::lookup('pages'); Line 25: if (count($pages) === 0) { Line 26: $this->markTestSkipped('Cannot test page URLs without any pages in the database'); Line 29: $integer = Page::url((int) key($pages)); Line 32: $string = Page::url((string) key($pages)); Line 37: $url = Page::url(2362728); Line 38: $this->assertTrue($url == 'page/view_by_id/2362728'); Line 40: $url = Page::url('2362728'); Line 41: $this->assertTrue($url == 'page/view_by_id/2362728'); Line 43: $url = Page::url('abcde'); Line 46: $url = Page::url(array());
/sprout/tests/registerTest.php Highlighted file source
Line 29: public function testExtrapage() Line 31: Register::extraPage('abc', 'Abc'); Line 32: $extra = Register::getExtraPages(); Line 39: public function testPageattr() Line 41: Register::pageattr('abc', 'Abc'); Line 42: Register::pageattr('def', 'Def', 'Sprout\\Helpers\\AttrEditorImage'); Line 44: $attrs = Register::getPageattrs();
/sprout/tests/registerTest.php Highlighted file source
Line 29: public function testExtrapage() Line 31: Register::extraPage('abc', 'Abc'); Line 32: $extra = Register::getExtraPages(); Line 39: public function testPageattr() Line 41: Register::pageattr('abc', 'Abc'); Line 42: Register::pageattr('def', 'Def', 'Sprout\\Helpers\\AttrEditorImage'); Line 44: $attrs = Register::getPageattrs();
/sprout/views/admin/main_layout.php Highlighted file source
Line 56: // Provide lock details to JavaScript to allow for unlocking on page unload Line 153: <?php if (AdminPerms::controllerAccess('extra_page', 'contents')): ?> Line 155: <a href="admin/intro/extra_page">Snippet pages</a> Line 245: <?php if ($controller_name == 'page' and strpos(Router::$current_uri, '/edit/') !== false): ?> Line 246: <button type="button" class="button button-grey button-small icon-after icon-settings page-settings-button page-edit-tab-button" data-target="page-settings-wrapper">Page settings</button> Line 247: <button type="button" class="button button-grey button-small icon-after icon-history revisions-button page-edit-tab-button" data-target="page-revisions-wrapper">Revisions</button> Line 250: <button type="button" class="button button-grey button-small icon-after icon-search seo-button page-edit-tab-button" data-target="seo-wrapper">SEO</button> Line 253: <button type="button" class="button button-grey button-small icon-after icon-local_offer tags-button page-edit-tab-button" data-target="tags-wrapper">Tags</button>
/sprout/views/admin/main_layout.php Highlighted file source
Line 56: // Provide lock details to JavaScript to allow for unlocking on page unload Line 153: <?php if (AdminPerms::controllerAccess('extra_page', 'contents')): ?> Line 155: <a href="admin/intro/extra_page">Snippet pages</a> Line 245: <?php if ($controller_name == 'page' and strpos(Router::$current_uri, '/edit/') !== false): ?> Line 246: <button type="button" class="button button-grey button-small icon-after icon-settings page-settings-button page-edit-tab-button" data-target="page-settings-wrapper">Page settings</button> Line 247: <button type="button" class="button button-grey button-small icon-after icon-history revisions-button page-edit-tab-button" data-target="page-revisions-wrapper">Revisions</button> Line 250: <button type="button" class="button button-grey button-small icon-after icon-search seo-button page-edit-tab-button" data-target="seo-wrapper">SEO</button> Line 253: <button type="button" class="button button-grey button-small icon-after icon-local_offer tags-button page-edit-tab-button" data-target="tags-wrapper">Tags</button>
/sprout/views/admin/page_add.php Highlighted file source
Line 25: Needs::fileGroup('sprout/page_edit'); Line 32: <h3>Page details</h3> Line 37: Form::nextFieldDetails('Name', true, 'This name will appear as the primary heading of this page, and will also be used in your navigation and sitemap'); Line 42: Form::nextFieldDetails('Parent page', false, 'The location in your navigation where this page will be displayed'); Line 43: echo Form::pageDropdown('parent_id', ['-wrapper-class' => 'white']); Line 56: Form::nextFieldDetails('Menu group', false, 'The group to place this page into in the main navigation menu'); Line 57: echo Form::dropdown('menu_group', ['-dropdown-top' => 'None -- Top level page', '-wrapper-class' => 'white'], NavigationGroups::getAllNamesAdmin()); Line 62: Form::nextFieldDetails('Search engine description', false, 'The description to show in search results from search engines like Google. Treat it as an advertisement for this page'); Line 68: <h3>Who can view this page?</h3> Line 69: <div class="info">You can restrict which user groups can access this page.</div> Line 72: 0 => 'Anyone who can view the parent page', Line 84: <h3>Who can manage this page?</h3> Line 85: <div class="info">You can restrict which operator groups can edit this page.</div> Line 88: 0 => 'Anyone who can manage the parent page', Line 101: <div class="info highlight-confirm">You will be able to enter your page content in the next step.</div>
/sprout/views/admin/page_add.php Highlighted file source
Line 25: Needs::fileGroup('sprout/page_edit'); Line 32: <h3>Page details</h3> Line 37: Form::nextFieldDetails('Name', true, 'This name will appear as the primary heading of this page, and will also be used in your navigation and sitemap'); Line 42: Form::nextFieldDetails('Parent page', false, 'The location in your navigation where this page will be displayed'); Line 43: echo Form::pageDropdown('parent_id', ['-wrapper-class' => 'white']); Line 56: Form::nextFieldDetails('Menu group', false, 'The group to place this page into in the main navigation menu'); Line 57: echo Form::dropdown('menu_group', ['-dropdown-top' => 'None -- Top level page', '-wrapper-class' => 'white'], NavigationGroups::getAllNamesAdmin()); Line 62: Form::nextFieldDetails('Search engine description', false, 'The description to show in search results from search engines like Google. Treat it as an advertisement for this page'); Line 68: <h3>Who can view this page?</h3> Line 69: <div class="info">You can restrict which user groups can access this page.</div> Line 72: 0 => 'Anyone who can view the parent page', Line 84: <h3>Who can manage this page?</h3> Line 85: <div class="info">You can restrict which operator groups can edit this page.</div> Line 88: 0 => 'Anyone who can manage the parent page', Line 101: <div class="info highlight-confirm">You will be able to enter your page content in the next step.</div>
/sprout/views/admin/page_edit.php Highlighted file source
Line 34: echo '<p><i>No tool page types have been defined. Unable to edit tool pages.</i></p>'; Line 38: Needs::fileGroup('sprout/page_edit'); Line 45: Needs::fileGroup('sprout/tourist-page-edit'); Line 62: $share_url = $base . 'page/view_by_id/' . $id; Line 76: <div id="page-settings-wrapper" class="page-edit-tab"> Line 78: <button class="button button-small button-grey icon-close icon-after page-edit-tab-close" type="button" data-target="page-settings-wrapper">Close</button> Line 83: Form::nextFieldDetails('Template', true, 'Overrides the default page container template; e.g. utilise a wide page rather than a column view.'); Line 94: <?php if (Kohana::config('page.enable_banners')): ?> Line 96: Form::nextFieldDetails('Banner', false, 'Overrides the default banner image when the page is viewed.'); Line 102: Form::nextFieldDetails('Gallery Thumbnail', false, 'A thumbnail for the page when seen in the page gallery.'); Line 110: Form::nextFieldDetails('Auto deactivate', false, 'Automatically hide the page from users after this date.'); Line 116: $help_text = "A warning about stale content is sent if this page hasn't been updated for this many days"; Line 122: 'placeholder' => Kohana::config('sprout.stale_page_age'), Line 132: Form::nextFieldDetails('URL slug', true, 'The text used to generate a link for the page; e.g. "this-is-a-slug" would result in: ' . Sprout::absRoot() . 'this-is-a-slug'); Line 137: Form::nextFieldDetails('Keywords', false, 'Terms that relate to the content on the page; these are important for search relevancy.'); Line 142: Form::nextFieldDetails('Description', false, 'A short (under 100 words) summary of the page content.'); Line 147: if (empty($page['alt_browser_title'])) { Line 148: Form::nextFieldDetails('Web-browser title (defaults to: ' . Navigation::buildBrowserTitle($page['name']) . ')', Line 150: 'Specify a custom browser title for the page; this will appear in the browser title bar/tab.' Line 153: Form::nextFieldDetails('Web-browser title', false, 'A custom browser title for the page; this will appear in the browser title bar/tab.'); Line 159: Form::nextFieldDetails('Alternate navigation title', false, 'Override the default title that appears in links and navigation breadcrumbs for this page.'); Line 171: <h3>Who can view this page?</h3> Line 172: <div class="info">You can restrict which user groups can access this page.</div> Line 175: 0 => 'Anyone who can view the parent page', Line 187: <h3>Who can manage this page?</h3> Line 188: <div class="info">You can restrict which operator groups can edit this page.</div> Line 191: 0 => 'Anyone who can manage the parent page', Line 205: <div id="page-revisions-wrapper" class="page-edit-tab"> Line 207: <button class="button button-small button-grey icon-close icon-after page-edit-tab-close" type="button" data-target="page-revisions-wrapper">Close</button> Line 208: <h3 class="h2 icon-before icon-history">Page Revisions</h3> Line 211: <div class="info">This is a list of all revisions which have been made to this page.</div> Line 226: $rev_edit_url = "admin/edit/page/{$id}?revision={$rev['id']}"; Line 227: $rev_view_url = "page/view_specific_rev/{$id}/{$rev['id']}"; Line 265: <?php echo Fb::heading('Page history'); ?> Line 266: <div class="info">This is a history of changes to this page.</div> Line 299: <ul class="messages all-type-neutral"><li class="neutral">NOTE: modify the 'Publish options' to put this page live.</li></ul> Line 300: <?php elseif ($page['active'] != 1): ?> Line 301: <ul class="messages all-type-neutral"><li class="neutral">This page is not currently active on the website.</li></ul> Line 306: <div id="tour-page-title"> Line 313: <div id="tour-page-parent"> Line 315: Form::nextFieldDetails('Parent page', false); Line 316: echo Form::pageDropdown('parent_id', ['-wrapper-class' => 'white']); Line 323: <?php Form::nextFieldDetails('Module', true, 'The type of tool page to show'); ?> Line 330: <div class="info">If this is set, users will be redirected to another page on the website or an external location.</div> Line 335: <?php if (empty($page['redirect'])): ?> Line 341: <p>Content Blocks build the structure of your page. Add, remove, disable, or reorder them how you wish.</p> Line 348: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect'])); Line 372: if (empty($page['redirect'])) { Line 379: echo '<p>These content blocks will be displayed in the sidebar of the page.</p>'; Line 382: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect']));
/sprout/views/admin/page_edit.php Highlighted file source
Line 34: echo '<p><i>No tool page types have been defined. Unable to edit tool pages.</i></p>'; Line 38: Needs::fileGroup('sprout/page_edit'); Line 45: Needs::fileGroup('sprout/tourist-page-edit'); Line 62: $share_url = $base . 'page/view_by_id/' . $id; Line 76: <div id="page-settings-wrapper" class="page-edit-tab"> Line 78: <button class="button button-small button-grey icon-close icon-after page-edit-tab-close" type="button" data-target="page-settings-wrapper">Close</button> Line 83: Form::nextFieldDetails('Template', true, 'Overrides the default page container template; e.g. utilise a wide page rather than a column view.'); Line 94: <?php if (Kohana::config('page.enable_banners')): ?> Line 96: Form::nextFieldDetails('Banner', false, 'Overrides the default banner image when the page is viewed.'); Line 102: Form::nextFieldDetails('Gallery Thumbnail', false, 'A thumbnail for the page when seen in the page gallery.'); Line 110: Form::nextFieldDetails('Auto deactivate', false, 'Automatically hide the page from users after this date.'); Line 116: $help_text = "A warning about stale content is sent if this page hasn't been updated for this many days"; Line 122: 'placeholder' => Kohana::config('sprout.stale_page_age'), Line 132: Form::nextFieldDetails('URL slug', true, 'The text used to generate a link for the page; e.g. "this-is-a-slug" would result in: ' . Sprout::absRoot() . 'this-is-a-slug'); Line 137: Form::nextFieldDetails('Keywords', false, 'Terms that relate to the content on the page; these are important for search relevancy.'); Line 142: Form::nextFieldDetails('Description', false, 'A short (under 100 words) summary of the page content.'); Line 147: if (empty($page['alt_browser_title'])) { Line 148: Form::nextFieldDetails('Web-browser title (defaults to: ' . Navigation::buildBrowserTitle($page['name']) . ')', Line 150: 'Specify a custom browser title for the page; this will appear in the browser title bar/tab.' Line 153: Form::nextFieldDetails('Web-browser title', false, 'A custom browser title for the page; this will appear in the browser title bar/tab.'); Line 159: Form::nextFieldDetails('Alternate navigation title', false, 'Override the default title that appears in links and navigation breadcrumbs for this page.'); Line 171: <h3>Who can view this page?</h3> Line 172: <div class="info">You can restrict which user groups can access this page.</div> Line 175: 0 => 'Anyone who can view the parent page', Line 187: <h3>Who can manage this page?</h3> Line 188: <div class="info">You can restrict which operator groups can edit this page.</div> Line 191: 0 => 'Anyone who can manage the parent page', Line 205: <div id="page-revisions-wrapper" class="page-edit-tab"> Line 207: <button class="button button-small button-grey icon-close icon-after page-edit-tab-close" type="button" data-target="page-revisions-wrapper">Close</button> Line 208: <h3 class="h2 icon-before icon-history">Page Revisions</h3> Line 211: <div class="info">This is a list of all revisions which have been made to this page.</div> Line 226: $rev_edit_url = "admin/edit/page/{$id}?revision={$rev['id']}"; Line 227: $rev_view_url = "page/view_specific_rev/{$id}/{$rev['id']}"; Line 265: <?php echo Fb::heading('Page history'); ?> Line 266: <div class="info">This is a history of changes to this page.</div> Line 299: <ul class="messages all-type-neutral"><li class="neutral">NOTE: modify the 'Publish options' to put this page live.</li></ul> Line 300: <?php elseif ($page['active'] != 1): ?> Line 301: <ul class="messages all-type-neutral"><li class="neutral">This page is not currently active on the website.</li></ul> Line 306: <div id="tour-page-title"> Line 313: <div id="tour-page-parent"> Line 315: Form::nextFieldDetails('Parent page', false); Line 316: echo Form::pageDropdown('parent_id', ['-wrapper-class' => 'white']); Line 323: <?php Form::nextFieldDetails('Module', true, 'The type of tool page to show'); ?> Line 330: <div class="info">If this is set, users will be redirected to another page on the website or an external location.</div> Line 335: <?php if (empty($page['redirect'])): ?> Line 341: <p>Content Blocks build the structure of your page. Add, remove, disable, or reorder them how you wish.</p> Line 348: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect'])); Line 372: if (empty($page['redirect'])) { Line 379: echo '<p>These content blocks will be displayed in the sidebar of the page.</p>'; Line 382: Admin::widgetList($area->getName(), $area, @$widgets[$area_id], empty($page['redirect']));
/sprout/views/admin/page_import_options.php Highlighted file source
Line 25: Needs::fileGroup('sprout/cms_page_import_options'); Line 30: <form action="SITE/admin/import_action/page" method="post" id="main-form"> Line 39: 'none' => 'No splitting; import the whole document as a single page', Line 45: Form::nextFieldDetails('Parent page', true); Line 46: echo Form::pageDropdown('parent_id'); Line 50: <!-- Single page --> Line 53: Form::nextFieldDetails('Page name', true); Line 54: echo Form::text('page_name'); Line 61: Form::nextFieldDetails('Top-level page name', true); Line 62: echo Form::text('top_page_name'); Line 66: Form::nextFieldDetails('Create pages for', true); Line 67: echo Form::pageDropdown('heading_level', [], [
/sprout/views/admin/page_import_options.php Highlighted file source
Line 25: Needs::fileGroup('sprout/cms_page_import_options'); Line 30: <form action="SITE/admin/import_action/page" method="post" id="main-form"> Line 39: 'none' => 'No splitting; import the whole document as a single page', Line 45: Form::nextFieldDetails('Parent page', true); Line 46: echo Form::pageDropdown('parent_id'); Line 50: <!-- Single page --> Line 53: Form::nextFieldDetails('Page name', true); Line 54: echo Form::text('page_name'); Line 61: Form::nextFieldDetails('Top-level page name', true); Line 62: echo Form::text('top_page_name'); Line 66: Form::nextFieldDetails('Create pages for', true); Line 67: echo Form::pageDropdown('heading_level', [], [
/sprout/views/admin/page_menu_groups.php Highlighted file source
Line 30: <li>The sections below represent the top-level pages on your website which have a multi-column menu</li> Line 37: <form action="admin/call/page/menuGroupsAction" method="post"> Line 41: foreach ($all_groups as $page_id => $groups) { Line 43: $page = Pdb::get('pages', $page_id); Line 45: echo '<h3 style="color: red;">Page ' . (int)$page_id . ' does not exist</h3>'; Line 48: echo '<h3>', Enc::html($page['name']), '</h3>'; Line 56: echo Form::multiline("extras[{$page_id}][text]", ['rows' => 3, 'cols' => 30], []); Line 61: echo Form::fileselector("extras[{$page_id}][image]", [], ['type' => FileConstants::TYPE_IMAGE]);
/sprout/views/admin/page_menu_groups.php Highlighted file source
Line 30: <li>The sections below represent the top-level pages on your website which have a multi-column menu</li> Line 37: <form action="admin/call/page/menuGroupsAction" method="post"> Line 41: foreach ($all_groups as $page_id => $groups) { Line 43: $page = Pdb::get('pages', $page_id); Line 45: echo '<h3 style="color: red;">Page ' . (int)$page_id . ' does not exist</h3>'; Line 48: echo '<h3>', Enc::html($page['name']), '</h3>'; Line 56: echo Form::multiline("extras[{$page_id}][text]", ['rows' => 3, 'cols' => 30], []); Line 61: echo Form::fileselector("extras[{$page_id}][image]", [], ['type' => FileConstants::TYPE_IMAGE]);
/sprout/views/admin/page_navigation.php Highlighted file source
Line 24: Needs::fileGroup('sprout/admin_page_navigation'); Line 36: $class = (Admin::getControllerSlug() === 'home_page' ? 'active-node' : ''); Line 41: <a class="node-link" href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Home</a> Line 46: <a href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Edit home page</a> Line 60: 'name' => 'Edit page', Line 61: 'url' => 'admin/edit/page/%%', Line 65: 'url' => 'admin/add/page?parent_id=%%', Line 69: 'url' => 'admin/call/page/reorder/%%', Line 73: 'name' => 'Delete page', Line 74: 'url' => 'admin/delete/page/%%', Line 80: 'name' => 'Edit page', Line 81: 'url' => 'admin/edit/page/%%', Line 85: 'url' => 'admin/add/page?parent_id=%%', Line 88: 'name' => 'Delete page', Line 89: 'url' => 'admin/delete/page/%%', Line 96: echo '<p class="page-tree-list-over-nav-limit">Pages not in navigation</p>';
/sprout/views/admin/page_navigation.php Highlighted file source
Line 24: Needs::fileGroup('sprout/admin_page_navigation'); Line 36: $class = (Admin::getControllerSlug() === 'home_page' ? 'active-node' : ''); Line 41: <a class="node-link" href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Home</a> Line 46: <a href="SITE/admin/edit/home_page/<?= (int) $home_page_id; ?>">Edit home page</a> Line 60: 'name' => 'Edit page', Line 61: 'url' => 'admin/edit/page/%%', Line 65: 'url' => 'admin/add/page?parent_id=%%', Line 69: 'url' => 'admin/call/page/reorder/%%', Line 73: 'name' => 'Delete page', Line 74: 'url' => 'admin/delete/page/%%', Line 80: 'name' => 'Edit page', Line 81: 'url' => 'admin/edit/page/%%', Line 85: 'url' => 'admin/add/page?parent_id=%%', Line 88: 'name' => 'Delete page', Line 89: 'url' => 'admin/delete/page/%%', Line 96: echo '<p class="page-tree-list-over-nav-limit">Pages not in navigation</p>';
/sprout/views/dbtools/import_xml.php Highlighted file source
Line 17: <div class="js-page-dropdown"> Line 18: <input type="hidden" name="page_id" value="0"> Line 32: <h2 class="icon-before icon-file_upload">Import Sprout 2 pages</h2> Line 50: url: 'dbtools/ajaxPageIds/' + id, Line 53: $('.js-page-dropdown').html(html); Line 56: $('.js-page-dropdown').html('<input type="hidden" value="0" name="page_id">');
/sprout/views/dbtools/import_xml.php Highlighted file source
Line 17: <div class="js-page-dropdown"> Line 18: <input type="hidden" name="page_id" value="0"> Line 32: <h2 class="icon-before icon-file_upload">Import Sprout 2 pages</h2> Line 50: url: 'dbtools/ajaxPageIds/' + id, Line 53: $('.js-page-dropdown').html(html); Line 56: $('.js-page-dropdown').html('<input type="hidden" value="0" name="page_id">');
/sprout/Widgets/ChildrenGalleryWidget.php Highlighted file source
Line 25: * Shows a list of pages that are related to this one Line 29: protected $friendly_name = "Children page gallery"; Line 30: protected $friendly_desc = 'A list of the children pages of this page, in a friendly gallery format'; Line 53: $matcher = Navigation::getPageNodeMatcher(); Line 61: $page_node = $root_node->findNode($matcher); Line 62: if ($page_node == null) return; Line 64: $page_node->filterChildren(new TreenodeInMenuMatcher()); Line 66: if (count($page_node->children) == 0) { Line 67: $page_node->removeFilter(); Line 89: $view = new View('sprout/children_page_gallery'); Line 90: $view->page_node = $page_node; Line 98: $page_node->removeFilter(); Line 116: $pages = []; Line 119: $root = Navigation::loadPageTree($row['id'], true, false); Line 122: $pages[$row['name']] = $children; Line 125: Form::nextFieldDetails('Parent Page', false); Line 127: if (count($pages) > 1) { Line 128: $out .= "<p><strong>Note:</strong> Pages are ordered by subsite, all pages for all subsites are available by scrolling down the option list.</p><br>"; Line 129: $out .= Form::dropdown('parent', [], $pages); Line 131: $out .= Form::dropdown('parent', [], reset($pages)); Line 138: $out .= Form::checkboxList(['hide_blanks' => 'Hide pages with no gallery image']);
/sprout/Widgets/ChildrenGalleryWidget.php Highlighted file source
Line 25: * Shows a list of pages that are related to this one Line 29: protected $friendly_name = "Children page gallery"; Line 30: protected $friendly_desc = 'A list of the children pages of this page, in a friendly gallery format'; Line 53: $matcher = Navigation::getPageNodeMatcher(); Line 61: $page_node = $root_node->findNode($matcher); Line 62: if ($page_node == null) return; Line 64: $page_node->filterChildren(new TreenodeInMenuMatcher()); Line 66: if (count($page_node->children) == 0) { Line 67: $page_node->removeFilter(); Line 89: $view = new View('sprout/children_page_gallery'); Line 90: $view->page_node = $page_node; Line 98: $page_node->removeFilter(); Line 116: $pages = []; Line 119: $root = Navigation::loadPageTree($row['id'], true, false); Line 122: $pages[$row['name']] = $children; Line 125: Form::nextFieldDetails('Parent Page', false); Line 127: if (count($pages) > 1) { Line 128: $out .= "<p><strong>Note:</strong> Pages are ordered by subsite, all pages for all subsites are available by scrolling down the option list.</p><br>"; Line 129: $out .= Form::dropdown('parent', [], $pages); Line 131: $out .= Form::dropdown('parent', [], reset($pages)); Line 138: $out .= Form::checkboxList(['hide_blanks' => 'Hide pages with no gallery image']);
/sprout/Widgets/ChildrenPagesWidget.php Highlighted file source
Line 21: * Shows a list of pages that are related to this one Line 23: class ChildrenPagesWidget extends Widget Line 25: protected $friendly_name = "Children pages"; Line 26: protected $friendly_desc = 'An list of the children pages as a textual list'; Line 42: $matcher = Navigation::getPageNodeMatcher(); Line 45: $page_node = $root_node->findNode($matcher); Line 46: if ($page_node == null) return; Line 48: $page_node->filterChildren(new TreenodeInMenuMatcher()); Line 50: if (count($page_node->children) == 0) { Line 51: $page_node->removeFilter(); Line 56: foreach ($page_node->children as $page) { Line 57: $page_url = Enc::html($page->getFriendlyUrl()); Line 58: $page_title = Enc::html($page->getNavigationName()); Line 59: $out .= "<li><a href=\"{$page_url}\">{$page_title}</a></li>"; Line 63: $page_node->removeFilter();
/sprout/Widgets/ChildrenPagesWidget.php Highlighted file source
Line 21: * Shows a list of pages that are related to this one Line 23: class ChildrenPagesWidget extends Widget Line 25: protected $friendly_name = "Children pages"; Line 26: protected $friendly_desc = 'An list of the children pages as a textual list'; Line 42: $matcher = Navigation::getPageNodeMatcher(); Line 45: $page_node = $root_node->findNode($matcher); Line 46: if ($page_node == null) return; Line 48: $page_node->filterChildren(new TreenodeInMenuMatcher()); Line 50: if (count($page_node->children) == 0) { Line 51: $page_node->removeFilter(); Line 56: foreach ($page_node->children as $page) { Line 57: $page_url = Enc::html($page->getFriendlyUrl()); Line 58: $page_title = Enc::html($page->getNavigationName()); Line 59: $out .= "<li><a href=\"{$page_url}\">{$page_title}</a></li>"; Line 63: $page_node->removeFilter();
/sprout/Widgets/RelatedLinksWidget.php Highlighted file source
Line 26: * Shows a list of pages that are related to this one Line 43: $matcher = Navigation::getPageNodeMatcher(); Line 46: $page_node = $root_node->findNode($matcher); Line 47: if ($page_node == null) return; Line 49: $ancestors = $page_node->findAncestors(); Line 64: // Top-parent, either page name (TRUE) or custom text (any string) Line 68: if ($page_node === $top_anc) $classes .= ' on'; Line 70: $page_title = Enc::html($top_anc->getNavigationName()); Line 71: $page_url = Enc::html($top_anc->getFriendlyUrl()); Line 74: $out .= "<li class=\"{$classes}\"><a href=\"{$page_url}\">{$page_title}</a></li>"; Line 76: $out .= "<li class=\"{$classes}\"><a href=\"{$page_url}\">" . Enc::html($top) . "</a></li>"; Line 80: foreach ($top_anc->children as $page) { Line 81: if (! UserPerms::checkPermissionsTree('pages', $page['id'])) continue; Line 83: $out .= self::drawnode ($page, 1, $ancestors); Line 98: * @param array $ancestors The ancestors of the current page node, for highlighting. Line 110: // If the page is the current item Line 119: // Items that are part of the ancestory of the current page Line 125: if (! UserPerms::checkPermissionsTree('pages', $node['id'])) continue;
/sprout/Widgets/RelatedLinksWidget.php Highlighted file source
Line 26: * Shows a list of pages that are related to this one Line 43: $matcher = Navigation::getPageNodeMatcher(); Line 46: $page_node = $root_node->findNode($matcher); Line 47: if ($page_node == null) return; Line 49: $ancestors = $page_node->findAncestors(); Line 64: // Top-parent, either page name (TRUE) or custom text (any string) Line 68: if ($page_node === $top_anc) $classes .= ' on'; Line 70: $page_title = Enc::html($top_anc->getNavigationName()); Line 71: $page_url = Enc::html($top_anc->getFriendlyUrl()); Line 74: $out .= "<li class=\"{$classes}\"><a href=\"{$page_url}\">{$page_title}</a></li>"; Line 76: $out .= "<li class=\"{$classes}\"><a href=\"{$page_url}\">" . Enc::html($top) . "</a></li>"; Line 80: foreach ($top_anc->children as $page) { Line 81: if (! UserPerms::checkPermissionsTree('pages', $page['id'])) continue; Line 83: $out .= self::drawnode ($page, 1, $ancestors); Line 98: * @param array $ancestors The ancestors of the current page node, for highlighting. Line 110: // If the page is the current item Line 119: // Items that are part of the ancestory of the current page Line 125: if (! UserPerms::checkPermissionsTree('pages', $node['id'])) continue;
A total of 2686 lines in 128 files were found
|