public function init() { // this method is called when the module is being created // you may place code here to customize the module or the application // import the module-level models and components $this->setImport(array('charts.models.*', 'charts.components.*')); // Set module specific javascript packages $this->packages = array('jquery' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jquery.js')), 'jquerysparkline' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'css' => array('css/charts.css'), 'js' => array('js/splunk/jquery.sparkline.js'), 'depends' => array('jquery')), 'jqplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'css' => array('js/jqplot/jquery.jqplot.css', 'css/charts.css'), 'js' => array('js/jqplot/jquery.jqplot.js'), 'depends' => array('jquery')), 'jqlineplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.canvasTextRenderer.js', 'js/jqplot/plugins/jqplot.categoryAxisRenderer.js', 'js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js'), 'depends' => array('jqplot')), 'jqpieplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.pieRenderer.js'), 'depends' => array('jqplot')), 'jqbubbleplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.bubbleRenderer.js'), 'depends' => array('jqplot')), 'jqfunnelplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.funnelRenderer.js'), 'depends' => array('jqplot')), 'jqbarplot' => array('basePath' => $this->getBasePath(), 'baseUrl' => $this->assetsUrl, 'js' => array('js/jqplot/plugins/jqplot.barRenderer.js', 'js/jqplot/plugins/jqplot.canvasTextRenderer.js', 'js/jqplot/plugins/jqplot.categoryAxisRenderer.js', 'js/jqplot/plugins/jqplot.canvasAxisTickRenderer.js', 'js/jqplot/plugins/jqplot.dateAxisRenderer.js', 'js/jqplot/plugins/jqplot.pointLabels.js'), 'depends' => array('jqplot'))); if (AuxLib::isIE8()) { $this->packages['jqplot']['js'][] = 'js/jqplot/excanvas.js'; } Yii::app()->clientScript->packages = $this->packages; // set module layout // $this->layout = 'main'; }
/** * overrides parent method. Adds JS file necessary to run the setup script. */ public function getPackages() { if (!isset($this->_packages)) { $this->_packages = array_merge(parent::getPackages(), array('ChartWidgetJS' => array('baseUrl' => Yii::app()->request->baseUrl, 'js' => array('js/jqplot/jquery.jqplot.js', 'js/jqplot/plugins/jqplot.pieRenderer.js', 'js/jqplot/plugins/jqplot.categoryAxisRenderer.js', 'js/jqplot/plugins/jqplot.pointLabels.js', 'js/jqplot/plugins/jqplot.dateAxisRenderer.js', 'js/jqplot/plugins/jqplot.highlighter.js', 'js/jqplot/plugins/jqplot.enhancedLegendRenderer.js', 'js/lib/moment-with-locales.min.js', 'js/sortableWidgets/ChartWidget.js', 'js/X2Chart/X2Chart.js'), 'depends' => array('SortableWidgetJS')), 'ChartWidgetCss' => array('baseUrl' => Yii::app()->getTheme()->getBaseUrl(), 'css' => array('css/x2chart.css')), 'ChartWidgetCssExt' => array('baseUrl' => Yii::app()->request->baseUrl, 'css' => array('js/jqplot/jquery.jqplot.css')))); if (AuxLib::isIE8()) { $this->_packages['ChartWidgetJS']['js'][] = 'js/jqplot/excanvas.js'; } } return $this->_packages; }
* You can contact X2Engine, Inc. P.O. Box 66752, Scotts Valley, * California 95067, USA. or at email address contact@x2engine.com. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * X2Engine" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by X2Engine". *****************************************************************************************/ /** * Used by inline workflow widget to render the funnel */ if (AuxLib::isIE8()) { Yii::app()->clientScript->registerScriptFile(Yii::app()->getBaseUrl() . '/js/jqplot/excanvas.js'); } if ($this->id !== 'Workflow') { $assetsUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.modules.workflow.assets'), false, -1, YII_DEBUG ? true : null); } else { $assetsUrl = $this->module->assetsUrl; } Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/X2Geometry.js', CClientScript::POS_END); Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/BaseFunnel.js', CClientScript::POS_END); Yii::app()->clientScript->registerScriptFile($assetsUrl . '/js/InlineFunnel.js', CClientScript::POS_END); Yii::app()->clientScript->registerScript('_funnelJS', "\n\nx2.inlineFunnel = new x2.InlineFunnel ({\n workflowStatus: " . CJSON::encode($workflowStatus) . ",\n translations: " . CJSON::encode(array('Completed' => Yii::t('workflow', 'Completed'), 'Started' => Yii::t('workflow', 'Started'), 'Details' => Yii::t('workflow', 'Details'), 'Revert Stage' => Yii::t('workflow', 'Revert Stage'), 'Complete Stage' => Yii::t('workflow', 'Complete Stage'), 'Start' => Yii::t('workflow', 'Start'), 'noRevertPermissions' => Yii::t('workflow', 'You do not have permission to revert this stage.'), 'noCompletePermissions' => Yii::t('workflow', 'You do not have permission to complete this stage.'))) . ",\n stageCount: " . $stageCount . ",\n containerSelector: '#funnel-container',\n colors: " . CJSON::encode($colors) . ",\n revertButtonUrl: '" . Yii::app()->theme->getBaseUrl() . "/images/icons/Uncomplete.png',\n completeButtonUrl: '" . Yii::app()->theme->getBaseUrl() . "/images/icons/Complete.png',\n stageNames: " . CJSON::encode(Workflow::getStageNames($workflowStatus)) . ",\n stagePermissions: " . CJSON::encode(Workflow::getStagePermissions($workflowStatus)) . ",\n uncompletionPermissions: " . CJSON::encode(Workflow::getStageUncompletionPermissions($workflowStatus)) . ",\n stagesWhichRequireComments: " . CJSON::encode(Workflow::getStageCommentRequirements($workflowStatus)) . "\n});\n\n", CClientScript::POS_END); ?> <div id='funnel-container'></div>
/** * Checks if responsive layout should be used based on requested action */ private function checkResponsiveLayout() { if (AuxLib::isIE8() || strpos($this->owner->request->getPathInfo(), 'admin') === 0 || preg_match('/flowDesigner(\\/\\d+)?$/', $this->owner->request->getPathInfo())) { define('RESPONSIVE_LAYOUT', false); } else { define('RESPONSIVE_LAYOUT', true); //define('RESPONSIVE_LAYOUT', false); } }
public function getPackages() { if (!isset($this->_packages)) { $this->_packages = array_merge(parent::getPackages(), array('WorkflowStageDetailsWorkflowJS' => array('baseUrl' => $this->module->assetsUrl, 'js' => array('js/WorkflowManagerBase.js', 'js/WorkflowManager.js'), 'depends' => array('auxlib')), 'WorkflowStageDetailsWidgetJS' => array('baseUrl' => Yii::app()->request->baseUrl, 'js' => array('js/sortableWidgets/WorkflowStageDetailsWidget.js'), 'depends' => array('SortableWidgetJS')), 'WorkflowStageDetailsWidgetCSS' => array('baseUrl' => Yii::app()->getTheme()->getBaseUrl(), 'css' => array('css/workflowFunnel.css')))); if (AuxLib::isIE8()) { $this->_packages['WorkflowExcanvas'] = array('baseUrl' => Yii::app()->request->baseUrl, 'js' => array('js/jqplot/excanvas.js')); } } return $this->_packages; }
public static function getLayoutType() { $pathInfo = strtolower(Yii::app()->request->getPathInfo()); if (AuxLib::isIE8() || strpos($pathInfo, 'admin') === 0 || preg_match('/flowDesigner(\\/\\d+)?$/', $pathInfo)) { return 'static'; } else { return 'responsive'; } }