Skin stuff - autoversioning mainly.
/skin/default/inner.php Highlighted file source
Line 8: use Sprout\Helpers\Skin;
Line 36: <?php Skin::common(); ?>
Line 37: <?php Skin::modules(); ?>
Line 38: <?php Skin::css('normalize', 'flexboxgrid', 'global', 'frankenmenu'); ?>
Line 39: <?php Skin::js('frankenmenu', 'skin'); ?>
/skin/default/inner.php Highlighted file source
Line 8: use Sprout\Helpers\Skin;
Line 36: <?php Skin::common(); ?>
Line 37: <?php Skin::modules(); ?>
Line 38: <?php Skin::css('normalize', 'flexboxgrid', 'global', 'frankenmenu'); ?>
Line 39: <?php Skin::js('frankenmenu', 'skin'); ?>
/skin/default/wide.php Highlighted file source
Line 8: use Sprout\Helpers\Skin;
Line 35: <?php Skin::common(); ?>
Line 36: <?php Skin::modules(); ?>
Line 37: <?php Skin::css('normalize', 'flexboxgrid', 'global', 'frankenmenu'); ?>
Line 38: <?php Skin::js('frankenmenu', 'skin'); ?>
/skin/default/wide.php Highlighted file source
Line 8: use Sprout\Helpers\Skin;
Line 35: <?php Skin::common(); ?>
Line 36: <?php Skin::modules(); ?>
Line 37: <?php Skin::css('normalize', 'flexboxgrid', 'global', 'frankenmenu'); ?>
Line 38: <?php Skin::js('frankenmenu', 'skin'); ?>
/sprout/Controllers/Admin/PageAdminController.php Highlighted file source
Line 243: $templates = Subsites::getConfigAdmin('skin_views');
Line 244: if (! $templates) $templates = array('skin/inner' => 'Inner');
Line 1088: $templates = Subsites::getConfigAdmin('skin_views');
Line 1089: if (! $templates) $templates = array('skin/inner' => 'Inner');
Line 1555: if (Kohana::config('sprout.tweak_skin')) {
Line 1738: $mail->SkinnedHTML($view->render());
Line 1758: $mail->SkinnedHTML($view->render());
Line 2712: $mail->skinnedHTML($view);
Line 2771: * Return JSON list of custom widget templates as defined by skin config
/sprout/Controllers/Admin/PageAdminController.php Highlighted file source
Line 243: $templates = Subsites::getConfigAdmin('skin_views');
Line 244: if (! $templates) $templates = array('skin/inner' => 'Inner');
Line 1088: $templates = Subsites::getConfigAdmin('skin_views');
Line 1089: if (! $templates) $templates = array('skin/inner' => 'Inner');
Line 1555: if (Kohana::config('sprout.tweak_skin')) {
Line 1738: $mail->SkinnedHTML($view->render());
Line 1758: $mail->SkinnedHTML($view->render());
Line 2712: $mail->skinnedHTML($view);
Line 2771: * Return JSON list of custom widget templates as defined by skin config
/sprout/Controllers/DbToolsController.php Highlighted file source
Line 92: [ 'url' => 'dbtools/testSkinTemplates', 'name' => 'Test skin templates', 'desc' => 'Simple tool for testing skin templates' ],
Line 341: // If there is no tables, act straight away without asking the user
Line 977: 'Skin' => 'skin',
Line 2400: * Simple tool for testing skin templates
Line 2404: public function testSkinTemplates()
Line 2406: $skins = Subsites::getCodes();
Line 2407: $skins[] = 'unavailable';
Line 2413: foreach ($skins as $s) {
Line 2416: $templates = glob(DOCROOT . 'skin/' . $s . '/*.php');
Line 2422: $url = '/dbtools/testSkinTemplatesAction/' . Enc::url($s) . '/' . Enc::url($f);
Line 2435: * @param string $skin Skin name, e.g. 'default'
Line 2439: public function testSkinTemplatesAction($skin, $tmpl)
Line 2441: $skin = preg_replace('![^-_a-zA-Z0-9]!', '', $skin);
Line 2444: if (empty($skin) or empty($tmpl)) {
Line 2450: $subsite_id = Pdb::query($q, [$skin], 'val');
Line 2457: SubsiteSelector::$subsite_code = $skin;
Line 2489: $content = new View('sprout/dbtools/skin_test_content');
Line 2493: $view = new View('skin/' . $tmpl);
Line 2829: $mail->SkinnedHTML($body);
/sprout/Controllers/DbToolsController.php Highlighted file source
Line 92: [ 'url' => 'dbtools/testSkinTemplates', 'name' => 'Test skin templates', 'desc' => 'Simple tool for testing skin templates' ],
Line 341: // If there is no tables, act straight away without asking the user
Line 977: 'Skin' => 'skin',
Line 2400: * Simple tool for testing skin templates
Line 2404: public function testSkinTemplates()
Line 2406: $skins = Subsites::getCodes();
Line 2407: $skins[] = 'unavailable';
Line 2413: foreach ($skins as $s) {
Line 2416: $templates = glob(DOCROOT . 'skin/' . $s . '/*.php');
Line 2422: $url = '/dbtools/testSkinTemplatesAction/' . Enc::url($s) . '/' . Enc::url($f);
Line 2435: * @param string $skin Skin name, e.g. 'default'
Line 2439: public function testSkinTemplatesAction($skin, $tmpl)
Line 2441: $skin = preg_replace('![^-_a-zA-Z0-9]!', '', $skin);
Line 2444: if (empty($skin) or empty($tmpl)) {
Line 2450: $subsite_id = Pdb::query($q, [$skin], 'val');
Line 2457: SubsiteSelector::$subsite_code = $skin;
Line 2489: $content = new View('sprout/dbtools/skin_test_content');
Line 2493: $view = new View('skin/' . $tmpl);
Line 2829: $mail->SkinnedHTML($body);
/sprout/Helpers/Email.php Highlighted file source
Line 29: * $mail->SkinnedHTML($view);
Line 73: * Sets the message content to be the specified content, with the email skin around it
Line 79: * @param $template string The template to use for the outer view. The default is "skin/email".
Line 81: public function SkinnedHTML($content, $extraparams = null, $template = 'skin/email')
/sprout/Helpers/Email.php Highlighted file source
Line 29: * $mail->SkinnedHTML($view);
Line 73: * Sets the message content to be the specified content, with the email skin around it
Line 79: * @param $template string The template to use for the outer view. The default is "skin/email".
Line 81: public function SkinnedHTML($content, $extraparams = null, $template = 'skin/email')
/sprout/Helpers/LaunchChecks.php Highlighted file source
Line 24: protected static $skin;
Line 37: self::$skin = '';
Line 39: if (strpos($m, 'testSkin') === 0) {
Line 40: foreach ($codes as self::$skin) {
Line 41: call_user_func([__CLASS__, $m], self::$skin);
Line 57: 'skin' => self::$skin,
Line 108: * Check that each skin has a site title set
Line 110: public static function testSkinSiteTitle($skin_code)
Line 112: $subsite_config = Subsites::loadConfig($skin_code);
Line 129: * Check that each skin has Google Analytics configured
Line 131: public static function testSkinAnalytics($skin_code)
Line 133: $subsite_config = Subsites::loadConfig($skin_code);
Line 143: * Check that each skin has Google Analytics configured
Line 145: public static function testSkinTemplatesExist($skin_code)
Line 149: $exists = file_exists(DOCROOT . "skin/{$skin_code}/{$tmpl}.php");
/sprout/Helpers/LaunchChecks.php Highlighted file source
Line 24: protected static $skin;
Line 37: self::$skin = '';
Line 39: if (strpos($m, 'testSkin') === 0) {
Line 40: foreach ($codes as self::$skin) {
Line 41: call_user_func([__CLASS__, $m], self::$skin);
Line 57: 'skin' => self::$skin,
Line 108: * Check that each skin has a site title set
Line 110: public static function testSkinSiteTitle($skin_code)
Line 112: $subsite_config = Subsites::loadConfig($skin_code);
Line 129: * Check that each skin has Google Analytics configured
Line 131: public static function testSkinAnalytics($skin_code)
Line 133: $subsite_config = Subsites::loadConfig($skin_code);
Line 143: * Check that each skin has Google Analytics configured
Line 145: public static function testSkinTemplatesExist($skin_code)
Line 149: $exists = file_exists(DOCROOT . "skin/{$skin_code}/{$tmpl}.php");
/sprout/Helpers/Page.php Highlighted file source
Line 148: * Inject page details -- title and browser title -- into a skin view
Line 150: * @param View $skin Skin view to inject details into
Line 153: public static function injectPageSkin(View $skin, array $page)
Line 156: $skin->page_title = $page['name'];
Line 159: $skin->browser_title = $page['alt_browser_title'];
/sprout/Helpers/Skin.php Highlighted file source
Line 21: * Skin stuff - autoversioning mainly.
Line 23: class Skin
Line 38: * Uses either modules.css in the the skin css directory or the module.css in the modules media directories
Line 42: if (file_exists(DOCROOT . 'skin/' . SubsiteSelector::$subsite_code . '/css/modules.css')) {
Line 43: $ts = @filemtime(DOCROOT . 'skin/' . SubsiteSelector::$subsite_code . '/css/modules.css');
Line 45: echo '<link href="ROOT/skin/', SubsiteSelector::$subsite_code, '/css/modules.css" rel="stylesheet">', PHP_EOL;
Line 60: * Return the URL for a CSS file in the skin for the current subsite.
Line 64: * <link href="<?php echo Skin::cssUrl('layout'); ?>" rel="stylesheet">
Line 70: $ts = @filemtime(DOCROOT . 'skin/' . SubsiteSelector::$subsite_code . '/css/' . $file . '.css');
Line 73: return 'ROOT/skin-' . $ts . '/' . SubsiteSelector::$subsite_code . '/css/' . $file . '.css';
Line 83: * <?php Skin::css('reset', 'layout', 'content'); ?>
Line 86: * <?php Skin::css('site', 'home', ['crossorigin' => 'anonymous', 'media' => 'print']); ?>
Line 88: * <link href="skin-ts/skin/css/site.css" rel='stylesheet' media='print'>
Line 89: * <link href="skin-ts/skin/css/home.css" rel='stylesheet' media='print'>
Line 108: $ts = max($ts, @filemtime(DOCROOT . 'skin/' . SubsiteSelector::$subsite_code . '/css/' . $arg . '.css'));
Line 120: echo '<link href="ROOT/skin-' . $ts . '/' . SubsiteSelector::$subsite_code . '/css/' . $arg . '.css"' . $attr . '>' . PHP_EOL;
Line 126: * Return the URL for a JS file in the skin for the current subsite.
Line 130: * <script src="<?php echo Skin::cssUrl('site'); ?>"></script>
Line 136: $ts = @filemtime(DOCROOT . 'skin/' . SubsiteSelector::$subsite_code . '/js/' . $file . '.js');
Line 139: return 'ROOT/skin-' . $ts . '/' . SubsiteSelector::$subsite_code . '/js/' . $file . '.js';
Line 149: * <?php Skin::js('site', 'home'); ?>
Line 152: * <?php Skin::js('site', 'home', ['crossorigin' => 'anonymous', 'defer' => '']); ?>
Line 154: * <script src="skin-ts/skin/js/site.js" crossorigin="anonymous" defer=""></script>
Line 155: * <script src="skin-ts/skin/js/home.js" crossorigin="anonymous" defer=""></script>
Line 174: $ts = max($ts, @filemtime(DOCROOT . 'skin/' . SubsiteSelector::$subsite_code . '/js/' . $arg . '.js'));
Line 186: echo '<script src="ROOT/skin-' . $ts . '/' . SubsiteSelector::$subsite_code . '/js/' . $arg . '.js"' . $attr . '></script>' . PHP_EOL;
Line 192: * Find a template within the current skin.
Line 200: if (preg_match('/^skin\/(.+)$/', $name, $matches)) {
Line 201: $name = 'skin/' . SubsiteSelector::$subsite_code . '/' . $matches[1];
Line 211: $name = 'skin/unavailable/' . $unavail;
Line 217: throw new Exception('View files must begin with skin/, sprout/, or modules/*/');
A total of 226 lines in 42 files were found