HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
TagsReaperUIModule.php
Go to the documentation of this file.
1 <?php
2 class TagsReaperUIModule extends CWebModule
3 {
4  private $cache = false;
5  private $_assetsUrl;
6 
7  public $session = array(
8  'timeout' => '-24 hour',
9  'password' => '',
10  'glue' => '|',
11  'api' => array(
12  'token' => 'qRs5RgNbzRAJts00BNpFeLLVNEtFxwFOMRX5deLrMptcb9bgdRqS3TXcm3vaEFRA'
13  )
14  );
15 
16  public function init()
17  {
18  $this->defaultController = 'TagsReaperUI';
19 
20  // this method is called when the module is being created
21  // you may place code here to customize the module or the application
22 
23  // import the module-level models and components
24  $this->setImport(array(
25  'TagsReaperUI.models.*',
26  'TagsReaperUI.models.TagsReaperUISession.*',
27  'TagsReaperUI.models.Demo.*',
28  'TagsReaperUI.models.Batch.*',
29  'TagsReaperUI.models.Command.*',
30  'TagsReaperUI.models.Command.Error.*',
31  'TagsReaperUI.components.*',
32  'TagsReaperUI.controllers.*',
33  ));
34  }
35 
36  public function beforeControllerAction($controller, $action)
37  {
38  if(parent::beforeControllerAction($controller, $action))
39  {
40  // this method is called before any module controller action is performed
41  // you may place customized code here
42  return true;
43  }
44  else
45  return false;
46  }
47 
51  public function registerScripts()
52  {
53  // Get the url to the module assets
54  $assetsUrl = $this->getAssetsUrl();
55 
56  // Register the necessary scripts
57  $cs = Yii::app()->getClientScript();
58  $cs->registerScriptFile($assetsUrl . '/js/tryIt.js');
59  $cs->registerCssFile($assetsUrl . '/css/style.css');
60 
61  $cs->registerCssFile($assetsUrl . '/js/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css');
62  $cs->registerCssFile($assetsUrl . '/js/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.css');
63  $cs->registerScriptFile($assetsUrl . '/js/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js');
64 
65 // $cs->registerCssFile($assetsUrl . '/js/plugins/bootstrap/css/bootstrap.min.css');
66 // $cs->registerScriptFile($assetsUrl . '/js/plugins/bootstrap/js/bootstrap.min.js');
67 
68  $cs->registerCssFile($assetsUrl . '/js/plugins/jstree/themes/default/style.min.css');
69  $cs->registerScriptFile($assetsUrl . '/js/plugins/jstree/jstree.js');
70 
71  $cs->registerScriptFile($assetsUrl . '/js/plugins/chained/chained.min.js');
72 
73  $cs->registerScriptFile($assetsUrl . '/js/plugins/typeahead/typeahead.min.js');
74  $cs->registerCssFile($assetsUrl . '/js/plugins/typeahead/typeahead.css');
75 
76  $cs->registerScriptFile($assetsUrl . '/js/plugins/format/jquery.format.js');
77 
78 
79 // $cs->registerScriptFile($assetsUrl . '/js/plugins/cookie/jquery.cookie.js');
80  //$cs->registerScriptFile($assetsUrl . '/js/plugins/unserialize/unserialize.jquery.latest.js');
81  //$cs->registerScriptFile($assetsUrl . '/js/plugins/sisyphus/sisyphus.js');
82 // $cs->registerScriptFile($assetsUrl . '/js/plugins/jQuery-Storage-API/jquery.storageapi.js');
83 
84  //$cs->registerScriptFile($assetsUrl . '/js/plugins/xpathrefine/xpathrefine.js');
85  //$cs->registerScriptFile($assetsUrl . '/js/plugins/xpathrefine/xpath_tool_injection.js');
86 
87  //$cs->registerCssFile($assetsUrl . '/css/log.css');
88 
89  $cssAlaskaNames = array(
90  'font-awesome.min',
91  'jquery.flipcountdown',
92  'jquery-ui',
93  //'bootstrap.min',
94  'owl.carousel',
95  'easy-responsive-tabs',
96  'jquery.circliful',
97  'cubeportfolio.min',
98  'megamenu',
99  'styles',
100  'custom',
101  'custom2'
102 
103  /*//'bootstrap.min',
104  //'bootstrap-theme',
105  'cubeportfolio.min',
106  'custom',
107  'easy-responsive-tabs',
108  'font-awesome.min',
109  'jquery.circliful',
110  'jquery.flipcountdown',
111  'jquery-ui',
112  'megamenu',
113  //'old_styles',
114  'owl.carousel',
115  'responsive-tabs',
116  'styles',
117  'custom2',*/
118  );
119 // foreach ($cssAlaskaNames as $cssAlaskaName) {
120 // $cs->registerCssFile($assetsUrl . '/css/alaska/css/' . $cssAlaskaName . '.css');
121 // }
122  }
123 
124  public function getAssetsUrl()
125  {
126  if ($this->_assetsUrl === null) {
127  $assetsPath = Yii::getPathOfAlias('TagsReaperUI.assets');
128 
129  if ($this->cache === false) {
130  $this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, false, -1, true);
131  } else {
132  $this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath);
133  }
134  }
135 
136  return $this->_assetsUrl;
137  }
138 }