SproutCMS

This is the code documentation for the SproutCMS project

class Subsites

Provides functions for getting information about subsites

Source code (36 results)

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 62: use Sprout\Helpers\Subsites;
Line 243: $templates = Subsites::getConfigAdmin('skin_views');
Line 863: $view->preview_url = Subsites::getAbsRootAdmin() . 'admin/call/page/preview/' . $item_id;
Line 897: $q = "SELECT * FROM ~subsites WHERE id = ?";
Line 1088: $templates = Subsites::getConfigAdmin('skin_views');
Line 1817: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 1838: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 2230: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 2232: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;
Line 2471: if (AdminAuth::isSuper() or Subsites::getConfigAdmin('nav_reorder')) {
Line 2480: if (Subsites::getConfigAdmin('nav_groups') !== null) {
Line 2663: $url = Subsites::getAbsRoot($row['subsite_id']) . $url;

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 62: use Sprout\Helpers\Subsites;
Line 243: $templates = Subsites::getConfigAdmin('skin_views');
Line 863: $view->preview_url = Subsites::getAbsRootAdmin() . 'admin/call/page/preview/' . $item_id;
Line 897: $q = "SELECT * FROM ~subsites WHERE id = ?";
Line 1088: $templates = Subsites::getConfigAdmin('skin_views');
Line 1817: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 1838: $enabled_extras = Subsites::getConfigAdmin('nav_extras');
Line 2230: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 2232: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;
Line 2471: if (AdminAuth::isSuper() or Subsites::getConfigAdmin('nav_reorder')) {
Line 2480: if (Subsites::getConfigAdmin('nav_groups') !== null) {
Line 2663: $url = Subsites::getAbsRoot($row['subsite_id']) . $url;

/sprout/Controllers/Admin/SubsiteAdminController.php   Highlighted file source

Line 20: use Sprout\Helpers\Subsites;
Line 26: * Handles most processing for Subsites
Line 31: protected $friendly_name = 'Subsites';
Line 79: $view->codes = Subsites::getCodes();
Line 80: $view->subsites = Pdb::lookup('subsites', ['content_id' => 0]);
Line 122: $item_id = Pdb::insert('subsites', $update_fields);
Line 124: $res = $this->logAdd('subsites', $item_id);
Line 143: $view->codes = Subsites::getCodes();
Line 144: $view->subsites = Pdb::lookup('subsites', ['content_id' => 0, ['id', '!=', $item_id]]);
Line 189: $logdata = $this->loadRecord('subsites', $item_id);
Line 191: Pdb::update('subsites', $update_fields, ['id' => $item_id]);
Line 193: $this->logEdit('subsites', $item_id, $logdata);
Line 210: $q = "SELECT COUNT(id) FROM ~subsites";
Line 229: $q = "SELECT COUNT(id) FROM ~subsites";

/sprout/Controllers/Admin/SubsiteAdminController.php   Highlighted file source

Line 20: use Sprout\Helpers\Subsites;
Line 26: * Handles most processing for Subsites
Line 31: protected $friendly_name = 'Subsites';
Line 79: $view->codes = Subsites::getCodes();
Line 80: $view->subsites = Pdb::lookup('subsites', ['content_id' => 0]);
Line 122: $item_id = Pdb::insert('subsites', $update_fields);
Line 124: $res = $this->logAdd('subsites', $item_id);
Line 143: $view->codes = Subsites::getCodes();
Line 144: $view->subsites = Pdb::lookup('subsites', ['content_id' => 0, ['id', '!=', $item_id]]);
Line 189: $logdata = $this->loadRecord('subsites', $item_id);
Line 191: Pdb::update('subsites', $update_fields, ['id' => $item_id]);
Line 193: $this->logEdit('subsites', $item_id, $logdata);
Line 210: $q = "SELECT COUNT(id) FROM ~subsites";
Line 229: $q = "SELECT COUNT(id) FROM ~subsites";

/sprout/Controllers/AdminController.php   Highlighted file source

Line 54: use Sprout\Helpers\Subsites;
Line 312: $subsite = Subsites::getFirstAccessable();
Line 314: Notification::error('No subsites are accessible by your user account');
Line 1136: $subsites = Pdb::lookup('subsites');
Line 1139: $content .= Form::dropdown('subsite_id', ['-dropdown-top' => 'Show on all sites'], $subsites);
Line 1315: $subsites = Pdb::lookup('subsites');
Line 1317: $content .= Form::dropdown('subsite_id', ['-dropdown-top' => 'Show on all sites'], $subsites);
Line 2036: $view->live_url = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);

/sprout/Controllers/AdminController.php   Highlighted file source

Line 54: use Sprout\Helpers\Subsites;
Line 312: $subsite = Subsites::getFirstAccessable();
Line 314: Notification::error('No subsites are accessible by your user account');
Line 1136: $subsites = Pdb::lookup('subsites');
Line 1139: $content .= Form::dropdown('subsite_id', ['-dropdown-top' => 'Show on all sites'], $subsites);
Line 1315: $subsites = Pdb::lookup('subsites');
Line 1317: $content .= Form::dropdown('subsite_id', ['-dropdown-top' => 'Show on all sites'], $subsites);
Line 2036: $view->live_url = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);

/sprout/Controllers/ContentSubscribeController.php   Highlighted file source

Line 27: use Sprout\Helpers\SubsiteSelector;
Line 28: use Sprout\Helpers\Subsites;
Line 158: $q = 'SELECT id, content_id, name, code, mobile FROM ~subsites';
Line 159: $subsites = Pdb::query($q, [], 'arr');
Line 161: foreach ($subsites as $subsite) {
Line 167: SubsiteSelector::$subsite_id = $subsite['id'];
Line 168: SubsiteSelector::$content_id = $subsite['content_id'] ?: $subsite['id'];
Line 169: SubsiteSelector::$subsite_code = $subsite['code'];
Line 170: SubsiteSelector::$mobile = $subsite['mobile'];
Line 269: $row['url'] = Subsites::getAbsRoot($subsite['id']) . ltrim($row['url'], '/');
Line 273: $subsite_title = Subsites::getConfig('site_title', $subsite['id']);
Line 276: $view->unsubscribe_url = Subsites::getAbsRoot($subsite['id']) . "content_subscribe/unsub/{$deets['id']}/{$deets['code']}";

/sprout/Controllers/ContentSubscribeController.php   Highlighted file source

Line 27: use Sprout\Helpers\SubsiteSelector;
Line 28: use Sprout\Helpers\Subsites;
Line 158: $q = 'SELECT id, content_id, name, code, mobile FROM ~subsites';
Line 159: $subsites = Pdb::query($q, [], 'arr');
Line 161: foreach ($subsites as $subsite) {
Line 167: SubsiteSelector::$subsite_id = $subsite['id'];
Line 168: SubsiteSelector::$content_id = $subsite['content_id'] ?: $subsite['id'];
Line 169: SubsiteSelector::$subsite_code = $subsite['code'];
Line 170: SubsiteSelector::$mobile = $subsite['mobile'];
Line 269: $row['url'] = Subsites::getAbsRoot($subsite['id']) . ltrim($row['url'], '/');
Line 273: $subsite_title = Subsites::getConfig('site_title', $subsite['id']);
Line 276: $view->unsubscribe_url = Subsites::getAbsRoot($subsite['id']) . "content_subscribe/unsub/{$deets['id']}/{$deets['code']}";

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 64: use Sprout\Helpers\SubsiteSelector;
Line 65: use Sprout\Helpers\Subsites;
Line 259: $vals['Subsite ID'] = SubsiteSelector::$subsite_id;
Line 261: $q = "SELECT id, name, code, active FROM ~subsites ORDER BY id";
Line 262: $subsites = Pdb::query($q, [], 'arr');
Line 266: $view->subsites = $subsites;
Line 346: $num += (int) Pdb::query("SELECT COUNT(*) FROM ~subsites", [], 'val');
Line 2406: $skins = Subsites::getCodes();
Line 2449: $q = "SELECT id FROM ~subsites WHERE code = ?";
Line 2452: $subsite_id = SubsiteSelector::$subsite_id;
Line 2456: SubsiteSelector::$subsite_id = $subsite_id;
Line 2457: SubsiteSelector::$subsite_code = $skin;
Line 2458: SubsiteSelector::$content_id = $subsite_id;
Line 2871: $view->subsites = Pdb::lookup('subsites');

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 64: use Sprout\Helpers\SubsiteSelector;
Line 65: use Sprout\Helpers\Subsites;
Line 259: $vals['Subsite ID'] = SubsiteSelector::$subsite_id;
Line 261: $q = "SELECT id, name, code, active FROM ~subsites ORDER BY id";
Line 262: $subsites = Pdb::query($q, [], 'arr');
Line 266: $view->subsites = $subsites;
Line 346: $num += (int) Pdb::query("SELECT COUNT(*) FROM ~subsites", [], 'val');
Line 2406: $skins = Subsites::getCodes();
Line 2449: $q = "SELECT id FROM ~subsites WHERE code = ?";
Line 2452: $subsite_id = SubsiteSelector::$subsite_id;
Line 2456: SubsiteSelector::$subsite_id = $subsite_id;
Line 2457: SubsiteSelector::$subsite_code = $skin;
Line 2458: SubsiteSelector::$content_id = $subsite_id;
Line 2871: $view->subsites = Pdb::lookup('subsites');

/sprout/Controllers/PageController.php   Highlighted file source

Line 38: use Sprout\Helpers\SubsiteSelector;
Line 39: use Sprout\Helpers\Subsites;
Line 106: if (! SubsiteSelector::$mobile) {
Line 108: $params['subsite_id'] = SubsiteSelector::$content_id;
Line 537: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']);
Line 560: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']);

/sprout/Controllers/PageController.php   Highlighted file source

Line 38: use Sprout\Helpers\SubsiteSelector;
Line 39: use Sprout\Helpers\Subsites;
Line 106: if (! SubsiteSelector::$mobile) {
Line 108: $params['subsite_id'] = SubsiteSelector::$content_id;
Line 537: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']);
Line 560: $url = Subsites::getAbsRoot($rev['subsite_id']) . Page::url($rev['page_id']);

/sprout/Helpers/Admin.php   Highlighted file source

Line 1035: return Subsites::getAbsRoot($_SESSION['admin']['active_subsite']) . ltrim($url, '/');

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 28: public static $subsites_permitted;
Line 187: public static function loadSubsitesPermitted()
Line 192: $subsites = Pdb::lookup('subsites');
Line 195: $subsites = [];
Line 198: self::$subsites_permitted = array();
Line 201: if (empty($_SESSION['admin']['login_id'])) return self::$subsites_permitted;
Line 206: if (count($subsites) == 0) $subsites = [1 => 'Site with no DB'];
Line 208: foreach ($subsites as $key => $val) {
Line 209: self::$subsites_permitted[$key] = true;
Line 211: return self::$subsites_permitted;
Line 218: // If set to default (ie all) on any category then grant all subsites
Line 222: $q = "SELECT access_all_subsites
Line 227: foreach ($res as $access_all_subsites) {
Line 228: if ($access_all_subsites) {
Line 229: foreach ($subsites as $key => $val) {
Line 230: self::$subsites_permitted[$key] = true;
Line 232: return self::$subsites_permitted;
Line 240: FROM ~operatorcategory_subsites
Line 246: self::$subsites_permitted[$subsite_id] = true;
Line 249: return self::$subsites_permitted;
Line 258: self::loadSubsitesPermitted();
Line 259: return @self::$subsites_permitted[$subsite_id];
Line 308: if ($controller == 'tools' or $controller == 'action_log' or $controller == 'subsites') {
Line 418: $out[] = 'subsites';

/sprout/Helpers/AdminPerms.php   Highlighted file source

Line 28: public static $subsites_permitted;
Line 187: public static function loadSubsitesPermitted()
Line 192: $subsites = Pdb::lookup('subsites');
Line 195: $subsites = [];
Line 198: self::$subsites_permitted = array();
Line 201: if (empty($_SESSION['admin']['login_id'])) return self::$subsites_permitted;
Line 206: if (count($subsites) == 0) $subsites = [1 => 'Site with no DB'];
Line 208: foreach ($subsites as $key => $val) {
Line 209: self::$subsites_permitted[$key] = true;
Line 211: return self::$subsites_permitted;
Line 218: // If set to default (ie all) on any category then grant all subsites
Line 222: $q = "SELECT access_all_subsites
Line 227: foreach ($res as $access_all_subsites) {
Line 228: if ($access_all_subsites) {
Line 229: foreach ($subsites as $key => $val) {
Line 230: self::$subsites_permitted[$key] = true;
Line 232: return self::$subsites_permitted;
Line 240: FROM ~operatorcategory_subsites
Line 246: self::$subsites_permitted[$subsite_id] = true;
Line 249: return self::$subsites_permitted;
Line 258: self::loadSubsitesPermitted();
Line 259: return @self::$subsites_permitted[$subsite_id];
Line 308: if ($controller == 'tools' or $controller == 'action_log' or $controller == 'subsites') {
Line 418: $out[] = 'subsites';

/sprout/Helpers/LaunchChecks.php   Highlighted file source

Line 32: $q = "SELECT code FROM ~subsites WHERE active = 1 GROUP BY code";
Line 112: $subsite_config = Subsites::loadConfig($skin_code);
Line 133: $subsite_config = Subsites::loadConfig($skin_code);

/sprout/Helpers/LaunchChecks.php   Highlighted file source

Line 32: $q = "SELECT code FROM ~subsites WHERE active = 1 GROUP BY code";
Line 112: $subsite_config = Subsites::loadConfig($skin_code);
Line 133: $subsite_config = Subsites::loadConfig($skin_code);

/sprout/Helpers/NavigationGroups.php   Highlighted file source

Line 31: $subsite_id = SubsiteSelector::$subsite_id;
Line 75: $groups = Subsites::getConfigAdmin('nav_groups');
Line 120: $groups = Subsites::getConfigAdmin('nav_groups');
Line 137: $groups = Subsites::getConfigAdmin('nav_groups');
Line 238: return self::$extras[SubsiteSelector::$subsite_id][$page_id];

/sprout/Helpers/Sprout.php   Highlighted file source

Line 466: $subsite_id = SubsiteSelector::$content_id;
Line 658: $date = Pdb::query($q, [SubsiteSelector::$content_id], 'val');
Line 695: $url_base = Subsites::getAbsRoot(SubsiteSelector::$subsite_id);

/sprout/Helpers/Subsites.php   Highlighted file source

Line 25: * Provides functions for getting information about subsites
Line 27: class Subsites
Line 29: private static $subsites = null;
Line 34: * Loads all the subsites into memory, ready for further processing
Line 36: static private function loadSubsites()
Line 38: if (self::$subsites != null) return;
Line 41: FROM ~subsites
Line 47: self::$subsites = [];
Line 48: self::$subsites[1] = [
Line 59: $subsites = array();
Line 62: $subsites[$sub['id']] = $sub;
Line 66: self::$subsites = $subsites;
Line 71: * Determines if multiple subsites can be accessed by the currently logged in administrator
Line 73: * @return bool True if multiple subsites are available, false if they are not
Line 77: self::loadSubsites();
Line 81: foreach (self::$subsites as $sub) {
Line 96: self::loadSubsites();
Line 108: foreach (self::$subsites as $site) {
Line 115: foreach (self::$subsites as $ss) {
Line 141: * Returns null if there are no subsites the user can access.
Line 145: self::loadSubsites();
Line 147: foreach (self::$subsites as $sub) {
Line 160: self::loadSubsites();
Line 162: if (!isset(self::$subsites[$id])) {
Line 166: return self::$subsites[$id]['name'];
Line 174: self::loadSubsites();
Line 176: if (!isset(self::$subsites[$id])) {
Line 180: return self::$subsites[$id]['code'];
Line 210: * @param int $id The subsite ID, e.g. SubsiteSelector::$subsite_id
Line 217: self::loadSubsites();
Line 219: if (!isset(self::$subsites[$id])) {
Line 223: if (count(self::$subsites[$id]['cond_domains'])) {
Line 224: $domain = self::determineBestDomain(self::$subsites[$id]['cond_domains']);
Line 237: if (!empty(self::$subsites[$id]['cond_directory'])) {
Line 238: $path = rtrim(self::$subsites[$id]['cond_directory'], '/') . '/';

/sprout/Helpers/TinyMCE4RichText.php   Highlighted file source

Line 54: $subsite = SubsiteSelector::$subsite_id;
Line 74: $options['document_base_url'] = rtrim(Subsites::getAbsRootAdmin(), '/') . '/';
Line 76: $options['document_base_url'] = rtrim(Subsites::getAbsRoot($subsite), '/') . '/';
Line 149: if (file_exists(DOCROOT . 'skin/' . Subsites::getCode($subsite) . '/css/richtext.css')) {
Line 150: $options['content_css'][] = Sprout::absRoot() . 'skin/' . Subsites::getCode($subsite) . '/css/richtext.css?ts=' . time();
Line 152: $options['content_css'][] = Sprout::absRoot() . 'skin/' . Subsites::getCode($subsite) . '/css/content.css?ts=' . time();

/sprout/Helpers/WorkerLinkChecker.php   Highlighted file source

Line 194: $href = Subsites::getAbsRoot($subsite_id) . trim($href, '/');

/sprout/tests/subsitesTest.php   Highlighted file source

Line 14: use Sprout\Helpers\Subsites;
Line 16: class subsitesTest extends PHPUnit_Framework_TestCase
Line 24: Subsites::getAbsRoot(0);
Line 29: $result = Subsites::getAbsRoot(1);

/sprout/tests/subsitesTest.php   Highlighted file source

Line 14: use Sprout\Helpers\Subsites;
Line 16: class subsitesTest extends PHPUnit_Framework_TestCase
Line 24: Subsites::getAbsRoot(0);
Line 29: $result = Subsites::getAbsRoot(1);

/sprout/views/admin/main_layout.php   Highlighted file source

Line 25: use Sprout\Helpers\Subsites;
Line 170: <a href="admin/intro/subsite">Subsites</a>
Line 220: <h1 class="site-title"><?php echo Enc::html(Subsites::getConfigAdmin('site_title')); ?></h1>
Line 224: <?php if (Subsites::hasMultiple()): ?>
Line 227: <?php // echo Enc::html(Subsites::getName($_SESSION['admin']['active_subsite'])); ?>
Line 228: <?php echo Subsites::listSelector($_SESSION['admin']['active_subsite']); ?>

/sprout/views/admin/main_layout.php   Highlighted file source

Line 25: use Sprout\Helpers\Subsites;
Line 170: <a href="admin/intro/subsite">Subsites</a>
Line 220: <h1 class="site-title"><?php echo Enc::html(Subsites::getConfigAdmin('site_title')); ?></h1>
Line 224: <?php if (Subsites::hasMultiple()): ?>
Line 227: <?php // echo Enc::html(Subsites::getName($_SESSION['admin']['active_subsite'])); ?>
Line 228: <?php echo Subsites::listSelector($_SESSION['admin']['active_subsite']); ?>

/sprout/views/admin/page_add.php   Highlighted file source

Line 22: use Sprout\Helpers\Subsites;
Line 54: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>

/sprout/views/admin/page_add.php   Highlighted file source

Line 22: use Sprout\Helpers\Subsites;
Line 54: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>

/sprout/views/admin/page_edit.php   Highlighted file source

Line 28: use Sprout\Helpers\Subsites;
Line 51: $subsite_absroot = Subsites::getAbsRoot($_SESSION['admin']['active_subsite'], Request::protocol());
Line 53: $base = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);
Line 87: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>

/sprout/views/admin/page_edit.php   Highlighted file source

Line 28: use Sprout\Helpers\Subsites;
Line 51: $subsite_absroot = Subsites::getAbsRoot($_SESSION['admin']['active_subsite'], Request::protocol());
Line 53: $base = Subsites::getAbsRoot($_SESSION['admin']['active_subsite']);
Line 87: <?php if (Subsites::getConfigAdmin('nav_groups') !== null): ?>

/sprout/views/admin/page_navigation.php   Highlighted file source

Line 20: use Sprout\Helpers\Subsites;
Line 54: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 56: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;

/sprout/views/admin/page_navigation.php   Highlighted file source

Line 20: use Sprout\Helpers\Subsites;
Line 54: $nav_limit = Subsites::getConfigAdmin('nav_limit');
Line 56: if (Subsites::getConfigAdmin('nav_home')) $nav_limit--;

/sprout/views/dbtools/php_info.php   Highlighted file source

Line 3: use Sprout\Helpers\Subsites;
Line 56: <?php if (!empty($subsites) and count($subsites)): ?>
Line 69: <?php foreach ($subsites as $subsite): ?>
Line 74: <td><?= Enc::html(Subsites::getAbsRoot($subsite['id'])); ?></td>

/sprout/views/dbtools/php_info.php   Highlighted file source

Line 3: use Sprout\Helpers\Subsites;
Line 56: <?php if (!empty($subsites) and count($subsites)): ?>
Line 69: <?php foreach ($subsites as $subsite): ?>
Line 74: <td><?= Enc::html(Subsites::getAbsRoot($subsite['id'])); ?></td>

/sprout/views/email/link_checker.php   Highlighted file source

Line 18: use Sprout\Helpers\Subsites;
Line 31: <a href="<?php echo Subsites::getAbsRoot($subsite_id) . 'page/view_by_id/' . $id; ?>">View Page</a>
Line 33: <a href="<?php echo Subsites::getAbsRoot($subsite_id) . 'admin/edit/page/' . $id; ?>">Edit page</a>

/sprout/views/email/link_checker.php   Highlighted file source

Line 18: use Sprout\Helpers\Subsites;
Line 31: <a href="<?php echo Subsites::getAbsRoot($subsite_id) . 'page/view_by_id/' . $id; ?>">View Page</a>
Line 33: <a href="<?php echo Subsites::getAbsRoot($subsite_id) . 'admin/edit/page/' . $id; ?>">Edit page</a>

A total of 289 lines in 36 files were found