PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 9.4
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v9.4
10.56 1.2.1 10 10.1 10.2 10.3 10.31 10.32 10.33 10.34 10.50 10.51 10.52 10.53 10.55 9.0 9.0.1 9.4 trunk 1.0.0 1.1 1.2
easy-code-manager / framework / developer / lib / template / template.php

template.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 9.4, at framework/developer/lib/template/template.php

55 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 /**
10 *
11 */
12 class CJT_Framework_Developer_Lib_Template {
13
14 /**
15 * put your comment there...
16 *
17 * @var mixed
18 */
19 protected $source;
20
21 /**
22 * put your comment there...
23 *
24 * @param mixed $source
25 */
26 public function __construct($source) {
27 $this->source = $source;
28 }
29
30 /**
31 * put your comment there...
32 *
33 * @param mixed $name
34 */
35 public function useTheme($name) {
36 // Get template name from theme name.
37 // Template name is [BLOCKNAME-THEMENAME-theme].
38 $templateName = "{$this->source->name} - {$name} theme";
39 // Load template record from database.
40 $tblTemplate = CJTxTable::getInstance('template')
41 ->setData(array('name' => $templateName))
42 ->load(array('name'));
43 $mdlTemplate = CJTModel::getInstance('template');
44 $mdlTemplate->inputs['id'] = $tblTemplate->get('id');
45 $template = $mdlTemplate->getItem();
46 // Link Style sheet.
47 $queueObject = CJTModel::getInstance('coupling')
48 ->getQueueObject('styles');
49 $queueObject->add($template->queueName, "/{$template->file}");
50 $queueObject->enqueue($template->queueName);
51 // Chaining.
52 return $this;
53 }
54
55 } // End class.