Esempio n. 1
0
 public function getPage2()
 {
     return array('title' => _xls_get_conf('LIGHTSPEED_CLOUD', 0) > 0 ? '<p>Please verify the server timezone.</p><p>You must also enter an email address and password which will be granted admin access when logging into <strong>' . Yii::app()->createAbsoluteUrl('admin') . '</strong> in any web browser. If this email already exists in Web Store, the password will be updated and admin access granted.</p></b>' : (_xls_get_conf('LIGHTSPEED_MT', 0) > 0 ? '<p>Enter a store password and verify the server timezone. <strong>You must type in your store password even if this is an upgrade. Your new store password will be reset to what is entered here.</strong></p><p>You can enter an email address and password which will be granted admin access when logging into <strong>' . Yii::app()->createAbsoluteUrl('admin') . '</strong> in any web browser. If this email already exists in Web Store, the password will be updated and admin access granted.</p></b>' : '<p>Enter a store password and verify the server timezone. The encryption keys are used to encrypt all passwords, you can generally accept the randomly generated ones below. <strong>Type in your store password even if this is an upgrade. Your new store password will be reset to what is entered here.</strong></p><p>You can enter an email address and password which will be granted admin access when logging into <strong>' . Yii::app()->createAbsoluteUrl('admin') . '</strong> in any web browser. If this email already exists in Web Store, the password will be updated and admin access granted.</p></b>'), 'elements' => array('LSKEY' => array('type' => 'password', 'maxlength' => 64, 'visible' => _xls_get_conf('LIGHTSPEED_CLOUD', 0) > 0 ? false : true), 'TIMEZONE' => array('type' => 'dropdownlist', 'items' => _xls_timezones()), 'encryptionKey' => array('type' => 'text', 'maxlength' => 64, 'visible' => _xls_get_conf('LIGHTSPEED_CLOUD', 0) > 0 || _xls_get_conf('LIGHTSPEED_MT', 0) > 0 ? false : true), 'encryptionSalt' => array('type' => 'text', 'maxlength' => 64, 'size' => 60, 'visible' => _xls_get_conf('LIGHTSPEED_CLOUD', 0) > 0 || _xls_get_conf('LIGHTSPEED_MT', 0) > 0 ? false : true), 'loginemail' => array('type' => 'email', 'maxlength' => 64, 'size' => 60, 'pattern' => '^[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&\'*+\\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'loginpassword' => array('type' => 'password', 'maxlength' => 64, 'size' => 60), 'page' => array('type' => 'hidden', 'value' => $this->page)));
 }
Esempio n. 2
0
 /**
  * Short Description.
  *
  * @param $strId
  * @return array
  */
 public static function getAdminDropdownOptions($strId)
 {
     switch ($strId) {
         case 'VIEWSET':
             $arr = array();
             $d = dir(YiiBase::getPathOfAlias('application'));
             while (false !== ($filename = $d->read())) {
                 if (substr($filename, 0, 6) == "views-") {
                     $strView = substr($filename, 6, 100);
                     $arr[$strView] = ucfirst($strView);
                 }
             }
             $d->close();
             return $arr;
         case 'THEME':
             $arr = array();
             $d = dir(YiiBase::getPathOfAlias('webroot') . "/themes");
             while (false !== ($filename = $d->read())) {
                 if ($filename[0] != ".") {
                     $fnOptions = YiiBase::getPathOfAlias('webroot') . "/themes/" . $filename . "/config.xml";
                     if (file_exists($fnOptions)) {
                         $strXml = file_get_contents($fnOptions);
                         $oXML = new SimpleXMLElement($strXml);
                         if ($oXML->viewset) {
                             $arr[$filename] = $oXML->name;
                         }
                     }
                 }
             }
             $d->close();
             return $arr;
         case 'CHILD_THEME':
             $fnOptions = YiiBase::getPathOfAlias('webroot') . '/themes/' . _xls_get_conf('THEME') . '/config.xml';
             $arr = array();
             if (file_exists($fnOptions)) {
                 $strXml = file_get_contents($fnOptions);
                 // Parse xml for response values
                 $oXML = new SimpleXMLElement($strXml);
                 if ($oXML->themes) {
                     foreach ($oXML->themes->theme as $item) {
                         $arr[(string) $item->valuestring] = (string) $item->keystring;
                     }
                 } else {
                     $arr['webstore'] = 'n/a';
                 }
             } else {
                 $arr['webstore'] = 'config.xml missing';
             }
             return $arr;
             break;
         case 'COUNTRY':
             return CHtml::listData(Country::model()->findAllByAttributes(array('active' => 1), array('order' => 'sort_order,country')), 'id', 'country');
         case 'STATE':
             return array(0 => '') + CHtml::listData(State::model()->findAllByAttributes(array('active' => 1), array('order' => 'sort_order, state')), 'id', 'state');
         case 'WEIGHT':
             return array('lb' => 'Pound', 'kg' => 'Kilogram');
         case 'DIMENSION':
             return array('in' => 'Inch', 'cm' => 'Centimeter');
         case 'ENCODING':
             return array('ISO-8859-1' => 'ISO-8859-1', 'ISO-8859-15' => 'ISO-8859-15', 'UTF-8' => 'UTF-8', 'cp1251' => 'cp1251', 'cp1252' => 'cp1252', 'KOI8-R' => 'KOI8-R', 'BIG5' => 'BIG5', 'GB2312' => 'GB2312', 'BIG5-HKSCS' => 'BIG5-HKSCS', 'Shift_JIS' => 'Shift_JIS', 'EUC-JP' => 'EUC-JP');
         case 'TIMEZONE':
             $arr = _xls_timezones();
             $arr = _xls_values_as_keys($arr);
             return $arr;
         case 'PRODUCT_SORT':
             return array("title" => _sp("Product Name"), "-id" => _sp("Most Recently Created"), "-modified" => _sp("Most Recently Updated"), "code" => _sp("Product Code"), "sell_web" => _sp("Price"), "-inventory_avail" => _sp("Most Inventory"), "description_short" => _sp("Short Description"));
         case 'ENABLE_FAMILIES':
             return array(0 => _sp("Off"), 1 => _sp("Bottom of Products Menu"), 2 => _sp("Top of Products Menu"), 3 => _sp("Blended into Products Menu"));
         case 'EMAIL_SMTP_SECURITY_MODE':
             return array(0 => _sp("Autodetect"), 1 => _sp("Force No Security"), 2 => _sp("Force SSL"), 3 => _sp("Force TLS"));
         case 'STORE_IMAGE_LOCATION':
             return array('DB' => 'Database', 'FS' => 'File System');
         case 'CAPTCHA_REGISTRATION':
             return array(1 => _sp("ON for Everyone"), 0 => _sp("OFF for Everyone"));
         case 'CAPTCHA_CONTACTUS':
             return array(2 => _sp("ON for Everyone"), 1 => _sp("OFF for Logged-in Users"), 0 => _sp("OFF for Everyone"));
         case 'CAPTCHA_CHECKOUT':
             return array(2 => _sp("ON for Everyone"), 1 => _sp("OFF for Logged-in Users"), 0 => _sp("OFF for Everyone"));
         case 'CAPTCHA_STYLE':
             return array(0 => _sp("Google ReCAPTCHA"), 1 => _sp("Integrated Captcha (DEPRECATED)"));
         case 'CAPTCHA_THEME':
             return array('red' => _sp("Red"), 'white' => _sp("White"), 'blackglass' => _sp("Blackglass"), 'clean' => _sp("Clean"));
         case 'ENABLE_SLASHED_PRICES':
             return array(0 => _sp("Off"), 1 => _sp("Only on Details Page"), 2 => _sp("On Grid and Details Pages"));
         case 'IMAGE_FORMAT':
             return array('jpg' => "JPG", 'png' => "PNG");
         case 'LOGGING':
             return array('error' => 'Error Logging', 'info' => 'Troubleshooting Logging', 'trace' => 'Ludicrous Logging');
         case 'INVENTORY_OUT_ALLOW_ADD':
             return array(Product::InventoryAllowBackorders => _sp('Display and Allow backorders'), Product::InventoryDisplayNotOrder => _sp('Display but Do Not Allow ordering'), Product::InventoryMakeDisappear => _sp('Make product disappear'));
         case 'MATRIX_PRICE':
             return array(Product::HIGHEST_PRICE => _sp('Show Highest Price'), Product::PRICE_RANGE => _sp('Show Price Range'), Product::CLICK_FOR_PRICING => _sp('Show "Click for Pricing"'), Product::LOWEST_PRICE => _sp('Show Lowest Price'), Product::MASTER_PRICE => _sp('Show Master Item Price'));
         case 'SSL_NO_NEED_FORWARD':
             return array(1 => _sp('Only when going to Checkout'), 0 => _sp('At all times including browsing product pages'));
         case 'REQUIRE_ACCOUNT':
             return array(1 => _sp('without registering (default)'), 0 => _sp('only after creating an account'));
         case 'AFTER_ADD_CART':
             return array(0 => _sp('Stay on page'), 1 => _sp('Redirect to Edit Cart page'));
         case 'PRODUCTS_PER_ROW':
             return array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 6 => 6);
         case 'HOME_PAGE':
             $arr = array('*products' => _sp('Product grid'));
             if (Yii::app()->params['LIGHTSPEED_MT'] == '1') {
                 if (Yii::app()->theme->info->showCustomIndexOption) {
                     $arr['*index'] = _sp(Yii::app()->theme->info->name . ' home page');
                 }
             } else {
                 if (Yii::app()->theme->info->showCustomIndexOption) {
                     $arr['*index'] = _sp(Yii::app()->theme->info->name . ' home page');
                 } else {
                     $arr['*index'] = _sp('site/index.php');
                 }
             }
             foreach (CustomPage::model()->findAll(array('order' => 'title')) as $item) {
                 $arr[$item->page_key] = $item->title;
             }
             return $arr;
             //processors
         //processors
         case 'CEventPhoto':
             return CHtml::listData(Modules::model()->findAllByAttributes(array('category' => 'CEventPhoto'), array('order' => 'name')), 'module', 'name');
         case 'PROCESSOR_RECOMMEND':
             return array('wsrecommend' => 'Default');
         case 'PROCESSOR_MENU':
             return array('wsmenu' => 'Dropdown Menu');
         case 'PROCESSOR_LANGMENU':
             return array('wslanglinks' => 'Language options as links', 'wslangdropdown' => 'Language options as dropdown', 'wslangflags' => 'Language options as flags');
         case 'EMAIL_TEST':
             return array(1 => 'On', 0 => 'Off');
         case 'AUTO_UPDATE_TRACK':
             return array(0 => 'Release Versions', 1 => 'Beta and Release Versions');
         case 'IMAGE_ZOOM':
             return array('flyout' => 'Flyout', 'inside' => 'Inside');
         default:
             return array(1 => 'On', 0 => 'Off');
     }
 }