当前位置: 首页>>代码示例>>PHP>>正文


PHP shopFunctions::getSuggestedSafePath方法代码示例

本文整理汇总了PHP中shopFunctions::getSuggestedSafePath方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctions::getSuggestedSafePath方法的具体用法?PHP shopFunctions::getSuggestedSafePath怎么用?PHP shopFunctions::getSuggestedSafePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在shopFunctions的用法示例。


在下文中一共展示了shopFunctions::getSuggestedSafePath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkSafePath

 static function checkSafePath($safePath = 0)
 {
     if ($safePath == 0) {
         $safePath = VmConfig::get('forSale_path', 0);
         if (self::$tested) {
             return $safePath;
         }
     }
     $warn = FALSE;
     $uri = JFactory::getURI();
     $configlink = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=config';
     VmConfig::loadJLang('com_virtuemart');
     if (empty($safePath)) {
         $warn = 'COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET';
     } else {
         //jimport('joomla.filesystem.folder');
         if (!class_exists('JFolder')) {
             require_once JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'filesystem' . DS . 'folder.php';
         }
         $exists = JFolder::exists($safePath);
         if (!$exists) {
             $warn = 'COM_VIRTUEMART_WARN_SAFE_PATH_WRONG';
         } else {
             if (!is_writable($safePath)) {
                 VmConfig::loadJLang('com_virtuemart_config');
                 VmError('COM_VIRTUEMART_WARN_SAFE_PATH_NOT_WRITEABLE', vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $safePath, $configlink);
             } else {
                 if (!is_writable(self::getInvoicePath($safePath))) {
                     VmConfig::loadJLang('com_virtuemart_config');
                     VmError('COM_VIRTUEMART_WARN_SAFE_PATH_INV_NOT_WRITEABLE', vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $safePath, $configlink);
                 }
             }
         }
     }
     if ($warn) {
         $suggestedPath = shopFunctions::getSuggestedSafePath();
         VmConfig::loadJLang('com_virtuemart_config');
         VmWarn($warn, vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath, $configlink);
         return FALSE;
     }
     return $safePath;
 }
开发者ID:lenard112,项目名称:cms,代码行数:42,代码来源:shopfunctions.php

示例2: checkSafePath

 static function checkSafePath($sPath = 0)
 {
     static $safePath = null;
     if (isset($safePath)) {
         return $safePath;
     }
     if ($sPath == 0) {
         $safePath = VmConfig::get('forSale_path', 0);
     } else {
         $safePath = $sPath;
     }
     $warn = false;
     $uri = JFactory::getURI();
     VmConfig::loadJLang('com_virtuemart');
     if (empty($safePath)) {
         $warn = 'COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET';
     } else {
         if (!class_exists('JFolder')) {
             require_once VMPATH_LIBS . DS . 'joomla' . DS . 'filesystem' . DS . 'folder.php';
         }
         $exists = JFolder::exists($safePath);
         if (!$exists) {
             $warn = 'COM_VIRTUEMART_WARN_SAFE_PATH_WRONG';
         } else {
             if (!is_writable($safePath)) {
                 VmConfig::loadJLang('com_virtuemart_config');
                 vmdebug('checkSafePath $safePath not writeable ' . $safePath);
                 VmError(vmText::sprintf('COM_VIRTUEMART_WARN_SAFE_PATH_INV_NOT_WRITEABLE', vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $safePath), vmText::sprintf('COM_VIRTUEMART_WARN_SAFE_PATH_INV_NOT_WRITEABLE', '', ''));
             } else {
                 if (!is_writable(self::getInvoicePath($safePath))) {
                     VmConfig::loadJLang('com_virtuemart_config');
                     vmdebug('checkSafePath $safePath/invoice not writeable ' . addslashes($safePath));
                     VmError(vmText::sprintf('COM_VIRTUEMART_WARN_SAFE_PATH_INV_NOT_WRITEABLE', vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $safePath), vmText::sprintf('COM_VIRTUEMART_WARN_SAFE_PATH_INV_NOT_WRITEABLE', '', ''));
                 }
             }
         }
     }
     if ($warn) {
         $safePath = false;
         $suggestedPath = shopFunctions::getSuggestedSafePath();
         $suggestedPath2 = VMPATH_ADMIN . DS . self::generateRandomString(12) . DS;
         VmConfig::loadJLang('com_virtuemart_config');
         $configlink = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=config';
         VmError(vmText::sprintf($warn, vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath, $configlink, $suggestedPath2));
     }
     return $safePath;
 }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:47,代码来源:shopfunctions.php

示例3: checkSafePath

 static function checkSafePath($safePath = 0)
 {
     if ($safePath == 0) {
         $safePath = VmConfig::get('forSale_path', 0);
         if (self::$tested) {
             return $safePath;
         }
     }
     $warn = FALSE;
     $uri = JFactory::getURI();
     $configlink = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=config';
     VmConfig::loadJLang('com_virtuemart');
     if (empty($safePath)) {
         $warn = 'COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET';
     } else {
         $exists = JFolder::exists($safePath);
         if (!$exists) {
             $warn = 'COM_VIRTUEMART_WARN_SAFE_PATH_WRONG';
         } else {
             if (!is_writable($safePath)) {
                 VmConfig::loadJLang('com_virtuemart_config');
                 VmWarn('COM_VIRTUEMART_WARN_SAFE_PATH_NOT_WRITEABLE', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $safePath, $configlink);
             } else {
                 if (!is_writable(self::getInvoicePath($safePath))) {
                     VmConfig::loadJLang('com_virtuemart_config');
                     VmWarn('COM_VIRTUEMART_WARN_SAFE_PATH_INV_NOT_WRITEABLE', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $safePath, $configlink);
                 }
             }
         }
     }
     if ($warn) {
         self::$tested = true;
         $suggestedPath = shopFunctions::getSuggestedSafePath();
         VmConfig::loadJLang('com_virtuemart_config');
         VmWarn($warn, JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath, $configlink);
         return FALSE;
     }
     return $safePath;
 }
开发者ID:juanmcortez,项目名称:Lectorum,代码行数:39,代码来源:shopfunctions.php

示例4: checkSafePath

 static function checkSafePath($safePath = 0)
 {
     if ($safePath == 0) {
         $safePath = VmConfig::get('forSale_path', 0);
     }
     if (empty($safePath)) {
         $suggestedPath = shopFunctions::getSuggestedSafePath();
         $uri = JFactory::getURI();
         $configlink = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=config';
         VmWarn('COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath, $configlink);
         return FALSE;
     } else {
         $exists = JFolder::exists($safePath);
         if (!$exists) {
             $uri = JFactory::getURI();
             $configlink = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=config';
             $suggestedPath = shopFunctions::getSuggestedSafePath();
             VmWarn('COM_VIRTUEMART_WARN_SAFE_PATH_WRONG', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath, $configlink);
             return FALSE;
         } else {
             return $safePath;
         }
     }
 }
开发者ID:romuland,项目名称:khparts,代码行数:24,代码来源:shopfunctions.php

示例5: getKlarna_pc_type

 /**
  * @static
  * @return null|string
  */
 static function getKlarna_pc_type()
 {
     $safePath = VmConfig::get('forSale_path', '');
     if ($safePath) {
         return $safePath . "klarna/klarna.json";
     } else {
         $suggestedPath = shopFunctions::getSuggestedSafePath();
         //VmError('COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET',JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'),$suggestedPath);
         $uri = JFactory::getURI();
         $link = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=config';
         VmError(JText::sprintf('VMPAYMENT_KLARNA_CANNOT_STORE_CONFIG', '<a href="' . $link . '">' . $link . '</a>', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH')));
         return NULL;
     }
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:18,代码来源:klarnahandler.php

示例6: getMediaUrlByView

 /**
  * The type of the media determines the used path for storing them
  *
  * @author Max Milbers
  * @param string $type type of the media, allowed values product, category, shop, vendor, manufacturer, forSale
  */
 public function getMediaUrlByView($type)
 {
     //the problem is here, that we use for autocreatoin the name of the model, here products
     //But for storing we use the product to build automatically the table out of it (product_medias)
     $choosed = false;
     if ($type == 'product' || $type == 'products') {
         $relUrl = VmConfig::get('media_product_path');
         $choosed = true;
     } else {
         if ($type == 'category' || $type == 'categories') {
             $relUrl = VmConfig::get('media_category_path');
             $choosed = true;
         } else {
             if ($type == 'shop') {
                 $relUrl = VmConfig::get('media_path');
                 $choosed = true;
             } else {
                 if ($type == 'vendor' || $type == 'vendors') {
                     $relUrl = VmConfig::get('media_vendor_path');
                     //	$relUrl = 'components/com_virtuemart/assets/images/vendors/';
                     $choosed = true;
                 } else {
                     if ($type == 'manufacturer' || $type == 'manufacturers') {
                         $relUrl = VmConfig::get('media_manufacturer_path');
                         $choosed = true;
                     } else {
                         if ($type == 'forSale' || $type == 'file_is_forSale') {
                             //todo add this path to config
                             $safePath = VmConfig::get('forSale_path', 0);
                             if (empty($safePath)) {
                                 $suggestedPath = shopFunctions::getSuggestedSafePath();
                                 VmWarn('COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath);
                             } else {
                                 $relUrl = $safePath;
                                 $choosed = true;
                                 $this->file_is_forSale = 1;
                             }
                         }
                     }
                 }
             }
         }
     }
     // 		$this->type = $type;
     // 		$this->setRole=false;
     if ($choosed && empty($relUrl)) {
         $uri = JFactory::getURI();
         $link = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=config';
         vmInfo('COM_VIRTUEMART_MEDIA_NO_PATH_TYPE', $type, $link);
         //Todo add general media_path to config
         //$relUrl = VmConfig::get('media_path');
         $relUrl = 'images/stories/virtuemart/';
         $this->setRole = true;
         // 		} else if(!$choosed and empty($relUrl) and $this->file_is_forSale==0){
     } else {
         if (!$choosed and empty($relUrl)) {
             vmWarn('COM_VIRTUEMART_MEDIA_CHOOSE_TYPE', $this->file_title);
             // 			vmError('Ignore this message, when it appears while the media synchronisation process, else report to http://forum.virtuemart.net/index.php?board=127.0 : cant create media of unknown type, a programmers error, used type ',$type);
             //$relUrl = VmConfig::get('media_path');
             $relUrl = 'images/stories/virtuemart/typeless/';
             $this->setRole = true;
         } else {
             if (!$choosed and $this->file_is_forSale == 1) {
                 $relUrl = '';
                 $this->setRole = false;
             }
         }
     }
     return $relUrl;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:76,代码来源:mediahandler.php


注:本文中的shopFunctions::getSuggestedSafePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。