public function Checkversion($router, $version)
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition('router="' . $router . '"');
     $models = Argoworks::model()->findAll($criteria);
     foreach ($models as $model) {
         if (str_replace('.', '', $version) > str_replace('.', '', $model->version)) {
             return false;
         }
     }
     return true;
 }
 public function beforeAction($action)
 {
     date_default_timezone_set(_xls_get_conf('TIMEZONE'));
     if (Multicategory::CheckSetDb() === false) {
         Multicategory::model()->SetDb();
     } else {
         Multicategory::model()->Checkversion($this->InfoModule['router'], $this->InfoModule['version']);
     }
     $this->upgradeDataBase();
     $SelfmenuItems = array();
     $this->menuItems = $this->menuItems = Argoworks::model()->createMenuArgo($SelfmenuItems, $this->InfoModule['router']);
     return parent::beforeAction($action);
 }
 public function beforeAction($action)
 {
     date_default_timezone_set(_xls_get_conf('TIMEZONE'));
     if (Zoomproduct::CheckSetDb() === false) {
         Zoomproduct::model()->SetDb();
     } else {
         Zoomproduct::model()->Checkversion($this->InfoModule['router'], $this->InfoModule['version']);
     }
     $SelfmenuItems = array(array('label' => 'Manage Products', 'url' => array('zoomproduct/list'), 'linkOptions' => array('class' => 'level-1')), array('label' => 'Import Product CSV Zoom Images', 'url' => array('zoomproduct/import'), 'linkOptions' => array('class' => 'level-1')), array('label' => 'Module Settings', 'url' => array('zoomproduct/edit?id=111'), 'linkOptions' => array('class' => 'level-1')));
     $this->menuItems = $this->menuItems = Argoworks::model()->createMenuArgo($SelfmenuItems, $this->InfoModule['router']);
     //run parent init() after setting menu so highlighting works
     $css_file = Yii::app()->getRequest()->getBaseUrl() . '/css/zoomproduct/style.css';
     Yii::app()->clientScript->registerCssFile($css_file);
     return parent::beforeAction($action);
 }
 public function beforeAction($action)
 {
     date_default_timezone_set(_xls_get_conf('TIMEZONE'));
     if (Addimglist::CheckSetDb() === false) {
         Addimglist::model()->SetDb();
     } else {
         Addimglist::model()->Checkversion($this->InfoModule['router'], $this->InfoModule['version']);
     }
     if (!Argoworks::model()->checkLicense($this->InfoModule['router'])) {
         $this->redirect($this->createUrl('argoworks/license?router=' . $this->InfoModule['router']));
         // Check license . If fail will ridirect to activate
     }
     $SelfmenuItems = array(array('label' => 'Thumbnail Products', 'url' => array('addimglist/list'), 'linkOptions' => array('class' => 'level-1')), array('label' => 'Import Dual Thumbnail', 'url' => array('addimglist/import'), 'linkOptions' => array('class' => 'level-1')));
     $this->menuItems = $this->menuItems = Argoworks::model()->createMenuArgo($SelfmenuItems, $this->InfoModule['router']);
     return parent::beforeAction($action);
 }