本文整理汇总了PHP中is_Dir函数的典型用法代码示例。如果您正苦于以下问题:PHP is_Dir函数的具体用法?PHP is_Dir怎么用?PHP is_Dir使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_Dir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLayouts
static function getLayouts($dirs, $type = 0)
{
$result = array();
$emptyOption = JHtml::_('select.option', '0', vmText::_('COM_VIRTUEMART_ADMIN_CFG_NO_OVERRIDE'));
$result[] = $emptyOption;
$alreadyAddedFile = array();
foreach ($dirs as $dir) {
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (!empty($file) and strpos($file, '.') !== 0 and $file != 'index.html' and !is_Dir($file)) {
if (!empty($type) and strpos($file, $type) === 0 or empty($type) and strpos($file, '_') == 0) {
//Handling directly for extension is much cleaner
$path_info = pathinfo($file);
if (empty($path_info['extension'])) {
vmError('Attention file ' . $file . ' has no extension and directory ' . $dir);
$path_info['extension'] = '';
}
if ($path_info['extension'] == 'php' && !in_array($file, $alreadyAddedFile)) {
$alreadyAddedFile[] = $file;
$result[] = JHtml::_('select.option', $path_info['filename'], $path_info['filename']);
}
}
}
}
}
}
return $result;
}
示例2: getLayoutList
/**
* Retrieve a list of layouts from the default and chosen templates directory.
*
* @author Max Milbers
* @param name of the view
* @return object List of flypage objects
*/
static function getLayoutList($view) {
$dirs[] = JPATH_ROOT.DS.'components'.DS.'com_virtuemart'.DS.'views'.DS.$view.DS.'tmpl';
//This does not work, joomla takes only overrides of their standard template
// $tplpath = VmConfig::get('vmtemplate',0);
//So we look for template overrides in the joomla standard template
//This method does not work, we get the Template of the backend
//$app = JFactory::getApplication('site');
//$tplpath = $app->getTemplate();vmdebug('template',$tplpath);
if (JVM_VERSION === 2) {
$q = 'SELECT `template` FROM `#__template_styles` WHERE `client_id` ="0" AND `home`="1" ';
} else {
$q = 'SELECT `template` FROM `#__templates_menu` WHERE `client_id` ="0" ';
}
$db = JFactory::getDBO();
$db->setQuery($q);
$tplnames = $db->loadResult();
if($tplnames){
if(is_dir(JPATH_ROOT.DS.'templates'.DS.$tplnames.DS.'html'.DS.'com_virtuemart'.DS.$view)){
$dirs[] = JPATH_ROOT.DS.'templates'.DS.$tplnames.DS.'html'.DS.'com_virtuemart'.DS.$view;
}
}
$result = array();
$emptyOption = JHTML::_('select.option', '0', JText::_('COM_VIRTUEMART_ADMIN_CFG_NO_OVERRIDE'));
$result[] = $emptyOption;
$alreadyAddedFile = array();
foreach($dirs as $dir){
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if(!empty($file) and strpos($file,'.')!==0 and strpos($file,'_')==0 and $file != 'index.html' and !is_Dir($file)){
//Handling directly for extension is much cleaner
$path_info = pathinfo($file);
if(empty($path_info['extension'])){
vmError('Attention file '.$file.' has no extension in view '.$view.' and directory '.$dir);
$path_info['extension'] = '';
}
if ($path_info['extension'] == 'php' && !in_array($file,$alreadyAddedFile)) {
$alreadyAddedFile[] = $file;
//There is nothing to translate here
// $result[] = JHTML::_('select.option', $file, $path_info['filename']);
$result[] = JHTML::_('select.option', $path_info['filename'], $path_info['filename']);
}
}
}
}
}
return $result;
}
示例3: display
function display($tpl = null)
{
$this->loadHelper('image');
$this->loadHelper('html');
$model = VmModel::getModel();
$usermodel = VmModel::getModel('user');
JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
$this->addStandardEditViewCommands();
$config = VmConfig::loadConfig();
if (!empty($config->_params)) {
unset($config->_params['pdf_invoice']);
// parameter remove and replaced by inv_os
}
$this->config = $config;
$this->userparams = JComponentHelper::getParams('com_users');
$this->jTemplateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
$this->vmLayoutList = $model->getLayoutList('virtuemart', VmConfig::get('vmlayout', 0), 'vmlayout');
$this->categoryLayoutList = $model->getLayoutList('category', VmConfig::get('categorylayout', 0), 'categorylayout');
$this->productLayoutList = $model->getLayoutList('productdetails', VmConfig::get('productlayout', 0), 'productlayout');
$this->noimagelist = $model->getNoImageList();
$this->orderStatusModel = VmModel::getModel('orderstatus');
$this->currConverterList = $model->getCurrencyConverterList();
$this->moduleList = $model->getModuleList();
$this->activeLanguages = $model->getActiveLanguages(VmConfig::get('active_languages'));
$this->orderByFields = $model->getProductFilterFields('browse_orderby_fields');
$this->searchFields = $model->getProductFilterFields('browse_search_fields');
$this->aclGroups = $usermodel->getAclGroupIndentedTree();
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->imagePath = $imagePath;
shopFunctions::checkSafePath();
$this->checkVmUserVendor();
parent::display($tpl);
}
示例4: search_records
function search_records($path, $records, $file_to_search)
{
foreach ($records as $record) {
$single_path = trim($record);
if (is_dir($single_path)) {
$single_path = trim($single_path);
$is_folder = end(explode("/", $single_path));
if ($is_folder == $file_to_search) {
$single_path = trim($single_path);
$files = glob($single_path . '/{,.}*', GLOB_BRACE);
foreach ($files as $filename) {
$file_name = end(explode('/', $filename));
if (is_Dir($filename)) {
echo '<div class="show_image" data-url=' . HTTP_PATH . '/views/window_action.php>';
echo '<img src=' . IMAGE_PATH . '/icons/folder.png height="32" width="32" data-file=' . $file_name . '>';
echo '<div>' . $file_name . '</div>';
echo '</div>';
} else {
$ext = pathinfo($file_name, PATHINFO_EXTENSION);
echo '<div class="show_image">';
switch ($ext) {
case "txt":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-txt.png height="32" width="32">';
break;
case "html":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-htm.png height="22" width="22">';
break;
case "jpg":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-jpg.png height="22" width="22">';
break;
case "avi":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-avi.png height="22" width="22">';
break;
case "mov":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-mov.png height="22" width="22">';
break;
case "doc":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-doc.png height="22" width="22">';
break;
case "ppt":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-ppt.png height="22" width="22">';
break;
case "pdf":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-pdf.png height="22" width="22">';
break;
case "zip":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-zip.png height="22" width="22">';
break;
case "mp3":
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-mp3.png height="22" width="22">';
break;
case "xls":
echo '<img src=' . IMAGE_PATH . '/icons/icon-xls-txt.png height="22" width="22">';
break;
case "php":
echo '<img src=' . IMAGE_PATH . '/icons/php.ico height="32" width="32">';
break;
case "js":
echo '<img src=' . IMAGE_PATH . '/icons/js.png height="32" width="32">';
break;
default:
echo '<img src=' . IMAGE_PATH . '/icons/icon-doc-other.png height="22" width="22">';
break;
}
echo '<div class="content_name">' . $file_name . '</div>';
echo '</div>';
}
}
echo '<input type = "hidden" name = "path" id = "path" value=' . $single_path . '/>';
$record = 1;
break;
}
}
}
if (!$record) {
echo 1;
}
}
示例5: fetchElement
//.........这里部分代码省略.........
$product->image->file_title = '';
$product->image->file_description = '';
$product->image->file_meta = '';
$product->image->file_url = '';
$product->image->file_url_thumb = '';
$product->image->file_title = '';
}
//Get manufacturers
$model = JModel::getInstance('Manufacturer', 'VirtuemartModel');
$manufacturers = $model->getManufacturerDropdown($product->virtuemart_manufacturer_id);
if (count($manufacturers) > 0) {
$lists['manufacturers'] = JHTML::_('select.genericlist', $manufacturers, 'virtuemart_manufacturer_id', 'class="inputbox"', 'value', 'text', $product->virtuemart_manufacturer_id);
}
//Get shopper groups
if (isset($product->shoppergroups)) {
$lists['shopperGroups'] = ShopFunctions::renderShopperGroupList($product->shoppergroups, true);
}
//Get product price
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'calculationh.php';
$calculator = calculationHelper::getInstance();
$product->prices = $calculator->getProductPrices($product);
// Get product price override options
$options = array(0 => 'Disabled', 1 => 'Overwrite final', -1 => 'Overwrite price to tax');
$lists['price_override_options'] = VmHtml::radioList('override', $product->override, $options);
// Get tax rules
$dbTax = '';
foreach ($calculator->rules['DBTax'] as $rule) {
$dbTax .= $rule['calc_name'] . '<br />';
}
$dbTaxRules = $dbTax;
$tax = JText::_('COM_VIRTUEMART_TAX_EFFECTING');
foreach ($calculator->rules['Tax'] as $rule) {
$tax .= $rule['calc_name'] . '<br />';
}
$taxRules = $tax;
$daTax = '';
foreach ($calculator->rules['DATax'] as $rule) {
$daTax .= $rule['calc_name'] . '<br />';
}
$daTaxRules = $daTax;
// Removed in VM 2.0.4
//$override = $calculator->override;
//$product_override_price = $calculator->product_override_price;
if (!isset($product->product_tax_id)) {
$product->product_tax_id = 0;
}
$lists['taxrates'] = ShopFunctions::renderTaxList($product->product_tax_id, 'product_tax_id');
// Discounts
if (!isset($product->product_discount_id)) {
$product->product_discount_id = 0;
}
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'models' . DS . 'calc.php';
$discounts = VirtueMartModelCalc::getDiscounts();
$discountrates = array();
$discountrates[] = JHTML::_('select.option', '-1', JText::_('COM_VIRTUEMART_PRODUCT_DISCOUNT_NONE'), 'product_discount_id');
$discountrates[] = JHTML::_('select.option', '0', JText::_('COM_VIRTUEMART_PRODUCT_DISCOUNT_NO_SPECIAL'), 'product_discount_id');
foreach ($discounts as $discount) {
$discountrates[] = JHTML::_('select.option', $discount->virtuemart_calc_id, $discount->calc_name, 'product_discount_id');
}
$lists['discounts'] = JHTML::_('select.genericlist', $discountrates, 'product_discount_id', '', 'product_discount_id', 'text', $product->product_discount_id);
//Define Virtuemart image path
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
// Get currencies
$model = JModel::getInstance('Currency', 'VirtuemartModel');
$vendorModel = JModel::getInstance('Vendor', 'VirtuemartModel');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
if (empty($product->product_currency)) {
$product->product_currency = $vendor->vendor_currency;
}
$lists['currencies'] = JHTML::_('select.genericlist', $model->getCurrencies(), 'product_currency', '', 'virtuemart_currency_id', 'currency_name', $product->product_currency);
$currency = $model->getCurrency($product->product_currency);
$productCurrency = $currency->currency_symbol;
$currency = $model->getCurrency($vendor->vendor_currency);
$vendorCurrency = $currency->currency_symbol;
//Get dimensions
$lists['product_weight_uom'] = ShopFunctions::renderWeightUnitList('product_weight_uom', !isset($product->product_weight_uom) ? $config->get('weight_unit_default') : $product->product_weight_uom);
$lists['product_lwh_uom'] = ShopFunctions::renderLWHUnitList('product_lwh_uom', !isset($product->product_lwh_uom) ? $config->get('lwh_unit_default') : $product->product_lwh_uom);
//Get custom fields
$model = JModel::getInstance('CustomFields', 'VirtuemartModel');
$fieldTypes = $model->getField_types();
$customsList = JHTML::_('select.genericlist', $model->getCustomsList(), 'customlist');
if (!isset($product->customfields)) {
$product->customfields = array();
}
//Set some script variables
$document->addScriptDeclaration('var k2martVmImagePath="' . JURI::root(true) . $imagePath . '"; var tip_image="' . JURI::root(true) . '/components/com_virtuemart/assets/js/images/vtip_arrow.png"; var k2martVmCustomFieldsNum = "' . count($product->customfields) . '";');
//Edit icon
$application = JFactory::getApplication('admin');
$editIcon = JURI::root(true) . '/administrator/templates/' . $application->getTemplate() . '/images/menu/icon-16-edit.png';
//Output
ob_start();
include JPATH_SITE . DS . 'plugins' . DS . 'k2' . DS . 'k2mart' . DS . 'tmpl' . DS . 'admin' . DS . 'form.php';
$contents = ob_get_clean();
return $contents;
}
示例6: display
function display($tpl = null)
{
// Get the task
$task = JRequest::getWord('task');
// Load helpers
$this->loadHelper('currencydisplay');
$this->loadHelper('html');
$this->loadHelper('image');
//$category_model = VmModel::getModel('category');
$model = VmModel::getModel();
// Handle any publish/unpublish
switch ($task) {
case 'add':
case 'edit':
//this was in the controller for the edit tasks, I dont know if it is still needed,
$this->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'views' . DS . 'product' . DS . 'tmpl');
$virtuemart_product_id = JRequest::getVar('virtuemart_product_id', array());
if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
$virtuemart_product_id = (int) $virtuemart_product_id[0];
} else {
$virtuemart_product_id = (int) $virtuemart_product_id;
}
$product = $model->getProductSingle($virtuemart_product_id, false);
$product_parent = $model->getProductParent($product->product_parent_id);
$mf_model = VmModel::getModel('manufacturer');
$manufacturers = $mf_model->getManufacturerDropdown($product->virtuemart_manufacturer_id);
$this->assignRef('manufacturers', $manufacturers);
// Get the category tree
if (isset($product->categories)) {
$category_tree = ShopFunctions::categoryListTree($product->categories);
} else {
$category_tree = ShopFunctions::categoryListTree();
}
$this->assignRef('category_tree', $category_tree);
//Get the shoppergoup list - Cleanshooter Custom Shopper Visibility
if (isset($product->shoppergroups)) {
$shoppergroupList = ShopFunctions::renderShopperGroupList($product->shoppergroups, true);
}
$this->assignRef('shoppergroupList', $shoppergroupList);
// Load the product price
if (!class_exists('calculationHelper')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'calculationh.php';
}
$calculator = calculationHelper::getInstance();
$product->prices = $calculator->getProductPrices($product);
$product_childIds = $model->getProductChildIds($virtuemart_product_id);
$product_childs = array();
foreach ($product_childIds as $id) {
$product_childs[] = $model->getProductSingle($id, false);
}
$this->assignRef('product_childs', $product_childs);
$DBTax = '';
//JText::_('COM_VIRTUEMART_RULES_EFFECTING') ;
foreach ($calculator->rules['DBTax'] as $rule) {
$DBTax .= $rule['calc_name'] . '<br />';
}
$this->assignRef('DBTaxRules', $DBTax);
$tax = '';
//JText::_('COM_VIRTUEMART_TAX_EFFECTING').'<br />';
foreach ($calculator->rules['Tax'] as $rule) {
$tax .= $rule['calc_name'] . '<br />';
}
foreach ($calculator->rules['VatTax'] as $rule) {
$tax .= $rule['calc_name'] . '<br />';
}
$this->assignRef('taxRules', $tax);
$DATax = '';
//JText::_('COM_VIRTUEMART_RULES_EFFECTING');
foreach ($calculator->rules['DATax'] as $rule) {
$DATax .= $rule['calc_name'] . '<br />';
}
$this->assignRef('DATaxRules', $DATax);
// $this->assignRef('override', $calculator->override);
// $this->assignRef('product_override_price', $calculator->product_override_price);
if (!isset($product->product_tax_id)) {
$product->product_tax_id = 0;
}
$lists['taxrates'] = ShopFunctions::renderTaxList($product->product_tax_id, 'product_tax_id');
if (!isset($product->product_discount_id)) {
$product->product_discount_id = 0;
}
$lists['discounts'] = $this->renderDiscountList($product->product_discount_id);
if (!class_exists('VirtueMartModelConfig')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'config.php';
}
$productLayouts = VirtueMartModelConfig::getLayoutList('productdetails');
$this->assignRef('productLayouts', $productLayouts);
// Load Images
$model->addImages($product);
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->assignRef('imagePath', $imagePath);
// Load the vendors
$vendor_model = VmModel::getModel('vendor');
// $vendors = $vendor_model->getVendors();
// $lists['vendors'] = JHTML::_('select.genericlist', $vendors, 'virtuemart_vendor_id', '', 'virtuemart_vendor_id', 'vendor_name', $product->virtuemart_vendor_id);
if (Vmconfig::get('multix', 'none') !== 'none') {
//.........这里部分代码省略.........
示例7: fopen
$fpLockFile = fopen($szLockFile, "a+");
clearstatcache();
if (!file_exists($szCacheFile) || $bForce) {
flock($fpLockFile, LOCK_EX);
fwrite($fpLockFile, ".");
//check once more to see if the cache file was created while waiting for
//the lock
clearstatcache();
if (!file_exists($szCacheFile) || $bForce) {
if (!extension_loaded('MapScript')) {
dl($szPHPMapScriptModule);
}
if (!extension_loaded('gd')) {
dl($szPHPGDModule);
}
if (!@is_Dir($szMetaDir)) {
makeDirs($szMetaDir);
}
$oMap = ms_newMapObj($szMapFile);
/* Metatile width/height include 2x the metaBuffer value */
$oMap->set('width', $tileWidth * $metaWidth + 2 * $metaBuffer);
$oMap->set('height', $tileHeight * $metaHeight + 2 * $metaBuffer);
/* Tell MapServer to not render labels inside the metaBuffer area
* (new in 4.6)
* TODO: Until MapServer bugs 1353/1355 are resolved, we need to
* pass a negative value for "labelcache_map_edge_buffer"
*/
$oMap->setMetadata("labelcache_map_edge_buffer", -$metaBuffer);
$inchesPerUnit = array(1, 12, 63360.0, 39.3701, 39370.1, 4374754);
$geoWidth = $scale / ($oMap->resolution * $inchesPerUnit[$oMap->units]);
$geoHeight = $scale / ($oMap->resolution * $inchesPerUnit[$oMap->units]);
示例8: listFile
/**
* @return null
* @param string $field_name - Имя поля формы и макроса для вывода элемента в шаблон
* @param string $value - Список файлов
* @desc Элемент формы для загрузки списка файлов
*/
public static function listFile($field_name, $value)
{
if (file_exists(MODUL_DIR . '/mpanel/template/list_file.tpl')) {
include MODUL_DIR . '/mpanel/template/list_file.tpl';
/*
if (system::fileExtIs($file_name, array('flv', 'png', 'jpg', 'jpeg', 'png')))
page::assign('link_type', 'href="#" onclick="$.prettyPhoto.open(\'%value%\');"');
else
page::assign('link_type', 'href="%value%" target="_target"');
*/
//
if (!empty($value)) {
$files = explode(";", $value);
$items = '';
while (list($key, $file_name) = each($files)) {
if (!empty($file_name) && file_exists(ROOT_DIR . $file_name) && !is_Dir(ROOT_DIR . $file_name)) {
$info = stat(ROOT_DIR . $file_name);
if (system::fileExtIs($file_name, array('png', 'gif', 'jpg', 'jpeg'))) {
$size = getimagesize(ROOT_DIR . $file_name);
$size_img = ', ' . $size[0] . 'x' . $size[1] . 'px';
} else {
$size_img = '';
}
page::assign('file.name', system::fileName($file_name));
page::assign('file.url', $file_name);
page::assign('file.ext', system::fileExt($file_name));
page::assign('file.size', round($info[7] / 1024, 0) . ' Кбайт' . $size_img);
$items .= page::parse($TEMPLATE['files']);
}
}
page::assign('files', $items);
return page::parse($TEMPLATE['frame_view']);
} else {
page::assign('value', $value);
page::assign('sname', $field_name);
return page::parse($TEMPLATE['frame_add']);
}
}
}
示例9: display
function display($tpl = null)
{
// Load the helper(s)
$this->loadHelper('image');
$this->loadHelper('html');
$model = VmModel::getModel();
$usermodel = VmModel::getModel('user');
JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
$this->addStandardEditViewCommands();
$config = VmConfig::loadConfig();
unset($config->_params['pdf_invoice']);
// parameter remove and replaced by inv_os
$this->assignRef('config', $config);
$mainframe = JFactory::getApplication();
$this->assignRef('joomlaconfig', $mainframe);
$userparams = JComponentHelper::getParams('com_users');
$this->assignRef('userparams', $userparams);
$templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
$this->assignRef('jTemplateList', $templateList);
$vmLayoutList = $model->getLayoutList('virtuemart');
$this->assignRef('vmLayoutList', $vmLayoutList);
// Outcommented to revert rev. 2916
// $vendorList = ShopFunctions::renderVendorList(VmConfig::get('default_virtuemart_vendor_id'));
// // We must replace the fieldname and ID 'virtuemart_vendor_id' to 'default_vendor'
// $vendorList = preg_replace('/"virtuemart_vendor_id"/', '"default_virtuemart_vendor_id"', $vendorList);
// $this->assignRef('vendorList', $vendorList);
$categoryLayoutList = $model->getLayoutList('category');
$this->assignRef('categoryLayoutList', $categoryLayoutList);
$productLayoutList = $model->getLayoutList('productdetails');
$this->assignRef('productLayoutList', $productLayoutList);
$noimagelist = $model->getNoImageList();
$this->assignRef('noimagelist', $noimagelist);
$orderStatusModel = VmModel::getModel('orderstatus');
$orderStates = $orderStatusModel->getOrderStatusList();
$orderStatusList = array();
$orderStatusList[0] = JText::_('COM_VIRTUEMART_NONE');
foreach ($orderStates as $orderState) {
$orderStatusList[$orderState->order_status_code] = JText::_($orderState->order_status_name);
}
$this->assignRef('orderStatusList', $orderStatusList);
/*
$oderstatusModel = VmModel::getModel('Orderstatus');
$orderStatusList = $oderstatusModel->getOrderStatusList();
$this->assignRef('orderStatusList', $orderStatusList);
*/
$currConverterList = $model->getCurrencyConverterList();
$this->assignRef('currConverterList', $currConverterList);
$moduleList = $model->getModuleList();
$this->assignRef('moduleList', $moduleList);
//$contentLinks = $model->getContentLinks();
//$this->assignRef('contentLinks', $contentLinks);
$activeLanguages = $model->getActiveLanguages(VmConfig::get('active_languages'));
$this->assignRef('activeLanguages', $activeLanguages);
$orderByFields = $model->getProductFilterFields('browse_orderby_fields');
$this->assignRef('orderByFields', $orderByFields);
$searchFields = $model->getProductFilterFields('browse_search_fields');
$this->assignRef('searchFields', $searchFields);
$aclGroups = $usermodel->getAclGroupIndentedTree();
$this->assignRef('aclGroups', $aclGroups);
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->assignRef('imagePath', $imagePath);
$safePath = VmConfig::get('forSale_path', 0);
$lastIndex = strrpos(JPATH_ROOT, DS);
$suggestedPath = substr(JPATH_ROOT, 0, $lastIndex) . DS . 'vmfiles';
if (empty($safePath)) {
VmWarn('COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath);
} else {
$exists = JFolder::exists($safePath);
if (!$exists) {
VmWarn('COM_VIRTUEMART_WARN_SAFE_PATH_WRONG', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath);
}
}
parent::display($tpl);
}
示例10: bloginfo
bloginfo('pingback_url');
?>
" />
<link rel="shortcut icon" type="image/ico" href="<?php
bloginfo('home');
?>
/favicon.ico" />
<?php
include_once TEMPLATEPATH . '/plugins/random-posts.php';
include_once TEMPLATEPATH . '/plugins/related-posts.php';
include_once TEMPLATEPATH . '/plugins/search-excerpt.php';
include_once TEMPLATEPATH . '/plugins/search-highlight.php';
clearstatcache();
if (!is_dir(ABSPATH . 'wp-content/uploads/activity')) {
if (!is_Dir(ABSPATH . 'wp-content/uploads')) {
mkdir(ABSPATH . 'wp-content/uploads', 0777);
}
mkdir(ABSPATH . 'wp-content/uploads/activity', 0777);
}
if (is_user_logged_in()) {
?>
<script src="http://myintarweb.uservoice.com/pages/general/widgets/tab.js?alignment=left&color=00BCBA" type="text/javascript"></script>
<?php
}
?>
<?php
wp_head();
?>
示例11: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('CurrencyDisplay')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
}
//Load helpers
//$this->loadHelper('currencydisplay');
//$this->loadHelper('html');
$configModel = VmModel::getModel('config');
$model = VmModel::getModel();
$shipModel = VmModel::getModel('shipmentmethod');
$shipments = $shipModel->getShipments();
function cmpShipments($a, $b)
{
return strcmp($a->virtuemart_shipmentmethod_id, $b->virtuemart_shipmentmethod_id);
}
usort($shipments, "cmpShipments");
//sort, coz it comes in random order
$this->assignRef('shipmentMethods', $shipments);
$this->assignRef('js_path', $model->updateJSApi());
$this->assignRef('moduleVersion', $model->checkModuleVersion());
$this->assignRef('errors', $model->errors);
$this->assignRef('warnings', $model->warnings);
$paymentModel = VmModel::getModel('paymentmethod');
$payments = $paymentModel->getPayments();
function cmpPayments($a, $b)
{
return strcmp($a->virtuemart_paymentmethod_id, $b->virtuemart_paymentmethod_id);
}
usort($payments, "cmpPayments");
//sort, coz it comes in random order
$this->assignRef('paymentMethods', $payments);
$usermodel = VmModel::getModel('user');
$ordersModel = VmModel::getModel('zasilkovna_orders');
$task = JRequest::getWord('task');
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
$orderStatusModel = VmModel::getModel('orderstatus');
$orderStates = $orderStatusModel->getOrderStatusList();
$this->SetViewTitle('ORDER');
JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
$config = VmConfig::loadConfig();
unset($config->_params['pdf_invoice']);
// parameter remove and replaced by inv_os
$this->assignRef('config', $config);
$mainframe = JFactory::getApplication();
$this->assignRef('joomlaconfig', $mainframe);
$userparams = JComponentHelper::getParams('com_users');
$this->assignRef('userparams', $userparams);
$templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
$this->assignRef('jTemplateList', $templateList);
$vmLayoutList = $configModel->getLayoutList('virtuemart');
$this->assignRef('vmLayoutList', $vmLayoutList);
$categoryLayoutList = $configModel->getLayoutList('category');
$this->assignRef('categoryLayoutList', $categoryLayoutList);
$productLayoutList = $configModel->getLayoutList('productdetails');
$this->assignRef('productLayoutList', $productLayoutList);
$noimagelist = $configModel->getNoImageList();
$this->assignRef('noimagelist', $noimagelist);
$orderStatusModel = VmModel::getModel('orderstatus');
$this->assignRef('orderStatusModel', $orderStatusModel);
$currConverterList = $configModel->getCurrencyConverterList();
$this->assignRef('currConverterList', $currConverterList);
$activeLanguages = $configModel->getActiveLanguages(VmConfig::get('active_languages'));
$this->assignRef('activeLanguages', $activeLanguages);
$orderByFields = $configModel->getProductFilterFields('browse_orderby_fields');
$this->assignRef('orderByFields', $orderByFields);
$searchFields = $configModel->getProductFilterFields('browse_search_fields');
$this->assignRef('searchFields', $searchFields);
$aclGroups = $usermodel->getAclGroupIndentedTree();
$this->assignRef('aclGroups', $aclGroups);
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->assignRef('imagePath', $imagePath);
$this->setLayout('orders');
$this->addStandardDefaultViewLists($ordersModel, 'created_on');
$this->lists['state_list'] = $this->renderOrderstatesList();
$shipping_method_selectec_id = JRequest::getInt('order_shipment_code');
$orderslist = $ordersModel->getOrdersListByShipment($shipping_method_selectec_id);
$this->assignRef('orderstatuses', $orderStates);
if (!class_exists('CurrencyDisplay')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php';
}
/* Apply currency This must be done per order since it's vendor specific */
$_currencies = array();
// Save the currency data during this loop for performance reasons
if ($orderslist) {
foreach ($orderslist as $virtuemart_order_id => $order) {
//This is really interesting for multi-X, but I avoid to support it now already, lets stay it in the code
//.........这里部分代码省略.........
示例12: getAvai
function getAvai()
{
jimport('joomla.filesystem.folder');
if (!class_exists('shopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
if (method_exists('shopFunctionsF', 'loadVmTemplateStyle')) {
$vmtemplate = shopFunctionsF::loadVmTemplateStyle();
if (is_Dir(JPATH_ROOT . DS . 'templates' . DS . $vmtemplate . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = 'templates' . DS . $vmtemplate . DS . 'images' . DS . 'availability' . DS;
} else {
$imagePath = 'components' . DS . 'com_virtuemart' . DS . 'assets' . DS . 'images' . DS . 'availability' . DS;
}
} else {
$imagePath = 'components' . DS . 'com_virtuemart' . DS . 'assets' . DS . 'images' . DS . 'availability' . DS;
}
$imagePath = JPATH_SITE . DS . $imagePath;
jimport('joomla.filesystem.file');
$avail = JFolder::files($imagePath, '.gif|.png|.jpg|.jpeg', false, false);
$ret = array();
foreach ($avail as $img) {
$obj = new stdClass();
$pattern = '/[^\\w]+/';
//'[^a-zA-Z\s]';
$key2 = preg_replace($pattern, '_', $img);
//var_dump($key2);
//var_dump($img); die();
//$key2 .= md5($img);
$obj->{$key2} = $img;
$obj->img = $img;
//1-2m.gif
switch ($img) {
case "24h.gif":
$avai = 24;
$deliverydate = "24 hours";
break;
case "ihned.gif":
$avai = 24;
$deliverydate = "24 hours";
break;
case "2-3d.gif":
$avai = 60;
$deliverydate = "2-3 days";
break;
case "48h.gif":
$avai = 48;
$deliverydate = "48 hours";
break;
case "1-2m.gif":
$avai = 60;
$deliverydate = "1 to 2 months";
break;
case "1-4w.gif":
$avai = 14;
$deliverydate = "1 to 4 weeks";
break;
case "14d.gif":
$avai = 14;
$deliverydate = "2 weeks";
break;
case "24h.gif":
$avai = 1;
$deliverydate = "24 hours";
break;
case "3-5d.gif":
$avai = 4;
$deliverydate = "3 to 5 days";
break;
case "48h.gif":
$avai = 2;
$deliverydate = "48 hours";
break;
case "7d.gif":
$avai = 7;
$deliverydate = "7 days";
break;
case "not_available.gif":
$avai = 60;
$deliverydate = "Not available";
break;
case "on-order.gif":
$avai = 168;
$deliverydate = "1 week";
break;
default:
$avai = 60;
$deliverydate = "2-3 days";
}
$obj->avai = $avai;
$obj->deliverytext = $deliverydate;
$ret[$key2] = $obj;
}
return $ret;
}
示例13: setHomePath
/**
* Set the instance-home-Path
*
* @param string $homePath This instances home-path.
*
* @throws Exception\PathNotFoundException
* @throws Exception\PathNotDirException
* @return \Org\Heigl\Hyphenator\Hyphenator
*/
public function setHomePath($homePath)
{
if (!file_exists($homePath)) {
throw new Exception\PathNotFoundException($homePath . ' does not exist');
}
if (!is_Dir($homePath)) {
throw new Exception\PathNotDirException($homePath . ' is not a directory');
}
$this->_homePath = realpath($homePath);
return $this;
}
示例14: upload
function upload(&$out)
{
set_time_limit(0);
global $restore;
global $file;
global $file_name;
global $folder;
if (!$folder) {
if (substr(php_uname(), 0, 7) == "Windows") {
$folder = '/.';
} else {
$folder = '/';
}
} else {
$folder = '/' . $folder;
}
if ($restore != '') {
$file = $restore;
} elseif ($file != '') {
copy($file, ROOT . 'saverestore/' . $file_name);
$file = $file_name;
}
umask(0);
@mkdir(ROOT . 'saverestore/temp', 0777);
if ($file != '') {
// && mkdir(ROOT.'saverestore/temp', 0777)
chdir(ROOT . 'saverestore/temp');
if (substr(php_uname(), 0, 7) == "Windows") {
// for windows only
exec(DOC_ROOT . '/gunzip ../' . $file, $output, $res);
//echo DOC_ROOT.'/tar xvf ../'.str_replace('.tgz', '.tar', $file);exit;
exec(DOC_ROOT . '/tar xvf ../' . str_replace('.tgz', '.tar', $file), $output, $res);
} else {
exec('tar xzvf ../' . $file, $output, $res);
}
$x = 0;
$dir = opendir('./');
while (($filec = readdir($dir)) !== false) {
if ($filec == '.' || $filec == '..') {
continue;
}
if (is_Dir($filec)) {
$latest_dir = $filec;
} elseif (is_File($filec)) {
$latest_file = $filec;
}
$x++;
}
if ($x == 1 && $latest_dir) {
$folder = '/' . $latest_dir;
}
@unlink(ROOT . 'saverestore/temp' . $folder . '/config.php');
@unlink(ROOT . 'saverestore/temp' . $folder . '/README.md');
chdir('../../');
// UPDATING FILES DIRECTLY
$this->copyTree(ROOT . 'saverestore/temp' . $folder, ROOT, 1);
// restore all files
$source = ROOT . 'modules';
if ($dir = @opendir($source)) {
while (($file = readdir($dir)) !== false) {
if (Is_Dir($source . "/" . $file) && $file != '.' && $file != '..') {
// && !file_exists($source."/".$file."/installed")
@unlink(ROOT . "modules/" . $file . "/installed");
}
}
}
@unlink(ROOT . "modules/control_modules/installed");
@SaveFile(ROOT . 'reboot', 'updated');
global $name;
global $version;
$rec = SQLSelectOne("SELECT * FROM plugins WHERE MODULE_NAME LIKE '" . DBSafe($name) . "'");
$rec['MODULE_NAME'] = $name;
$rec['CURRENT_VERSION'] = $version;
$rec['IS_INSTALLED'] = 1;
$rec['LATEST_UPDATE'] = date('Y-m-d H:i:s');
if ($rec['ID']) {
SQLUpdate('plugins', $rec);
} else {
SQLInsert('plugins', $rec);
}
$this->redirect("?mode=clear&ok_msg=" . urlencode("Updates Installed!"));
}
}
示例15: getAvailabilityIconUrl
static function getAvailabilityIconUrl($vmtemplate)
{
if (!empty($vmtemplate) and is_array($vmtemplate)) {
$vmtemplate = $vmtemplate['template'];
}
if (is_Dir(VMPATH_ROOT . DS . 'templates' . DS . $vmtemplate . DS . 'images' . DS . 'availability' . DS)) {
return '/templates/' . $vmtemplate . '/images/availability/';
} else {
return '/' . VmConfig::get('assets_general_path') . 'images/availability/';
}
}