// Merge -> revision 8952
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8957 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+5
-2
@@ -535,8 +535,11 @@ if (Tools::isSubmit('loadImportMatchs'))
|
||||
|
||||
if (Tools::isSubmit('toggleScreencast'))
|
||||
{
|
||||
$context->employee->show_screencast = (int)(!(bool)$context->employee->show_screencast);
|
||||
$context->employee->save();
|
||||
if (Validate::isLoadedObject($context->employee))
|
||||
{
|
||||
$context->employee->bo_show_screencast = !$context->employee->bo_show_screencast;
|
||||
$context->employee->update();
|
||||
}
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('helpAccess'))
|
||||
|
||||
@@ -43,5 +43,5 @@ $smtpPort = $_GET['smtpPort'];
|
||||
$smtpEncryption = $_GET['smtpEnc'];
|
||||
|
||||
$result = Mail::sendMailTest(Tools::htmlentitiesUTF8($smtpChecked), Tools::htmlentitiesUTF8($smtpServer), Tools::htmlentitiesUTF8($content), Tools::htmlentitiesUTF8($subject), Tools::htmlentitiesUTF8($type), Tools::htmlentitiesUTF8($to), Tools::htmlentitiesUTF8($from), Tools::htmlentitiesUTF8($smtpLogin), Tools::htmlentitiesUTF8($smtpPassword), Tools::htmlentitiesUTF8($smtpPort), Tools::htmlentitiesUTF8($smtpEncryption));
|
||||
die($result ? 'ok' : 'fail');
|
||||
die($result === true ? 'ok' : $result);
|
||||
|
||||
|
||||
@@ -167,9 +167,9 @@ class AdminCarts extends AdminTab
|
||||
SELECT id_image
|
||||
FROM '._DB_PREFIX_.'image
|
||||
WHERE id_product = '.(int)($product['id_product']).' AND cover = 1');
|
||||
|
||||
|
||||
$productObj = new Product($product['id_product']);
|
||||
|
||||
|
||||
/* Customization display */
|
||||
$this->displayCustomizedDatas($customizedDatas, $product, $currency, $image, $tokenCatalog, $stock);
|
||||
if ($product['cart_quantity'] > $product['customizationQuantityTotal'])
|
||||
@@ -257,10 +257,7 @@ class AdminCarts extends AdminTab
|
||||
|
||||
if (is_array($customizedDatas) AND isset($customizedDatas[(int)($product['id_product'])][(int)($product['id_product_attribute'])]))
|
||||
{
|
||||
if (isset($image['id_image']))
|
||||
$image = new Image($image['id_image']);
|
||||
else
|
||||
$image = new Image();
|
||||
if ($image = new Image($image['id_image']))
|
||||
echo '
|
||||
<tr>
|
||||
<td align="center">'.($image->id ? cacheImage(_PS_IMG_DIR_.'p/'.$image->getExistingImgPath().'.jpg',
|
||||
@@ -319,17 +316,17 @@ class AdminCarts extends AdminTab
|
||||
$this->displayList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function _displayDeleteLink($token = NULL, $id)
|
||||
{
|
||||
{
|
||||
foreach ($this->_list as $cart)
|
||||
if ($id == $cart['id_cart'])
|
||||
if ($cart['id_order'])
|
||||
return;
|
||||
|
||||
|
||||
$_cacheLang['Delete'] = $this->l('Delete', __CLASS__, true, false);
|
||||
$_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, true, false).$id.' ?)';
|
||||
|
||||
|
||||
echo '
|
||||
<a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token).'" onclick="return confirm(\''.$_cacheLang['DeleteItem'].'\');">
|
||||
<img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" /></a>
|
||||
|
||||
@@ -152,6 +152,14 @@ class AdminEmployees extends AdminTab
|
||||
<input type="radio" name="bo_uimode" id="uimode_off" value="click" '.($this->getFieldValue($obj, 'bo_uimode') == 'click' ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="uimode_off">'.$this->l('Click on tabs').'</label>
|
||||
</div><div class="clear"> </div>
|
||||
<label>'.$this->l('Show screencast:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="bo_show_screencast" id="bo_show_screencast_on" value="1" '.($this->getFieldValue($obj, 'bo_show_screencast') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Enabled').'" /></label>
|
||||
<input type="radio" name="bo_show_screencast" id="bo_show_screencast_off" value="0" '.(!$this->getFieldValue($obj, 'bo_show_screencast') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||
<p>'.$this->l('Show the welcome video on the dashbord of the back office').'</p>
|
||||
</div>
|
||||
<label>'.$this->l('Status:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="active" id="active_on" value="1" '.($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
|
||||
|
||||
@@ -101,6 +101,9 @@ class AdminImport extends AdminTab
|
||||
'image_position' => array('label' => $this->l('Image position'),
|
||||
'help' => $this->l('Position of the product image to use for this combination. If you use this field, leave image URL empty.')),
|
||||
'image_url' => array('label' => $this->l('Image URL')),
|
||||
'delete_existing_images' => array(
|
||||
'label' => $this->l('Delete existing images (0 = no, 1 = yes)'),
|
||||
'help' => $this->l('If you do not specify this column and you specify the column images, all images of the product will be replaced by those specified in the import file')),
|
||||
);
|
||||
|
||||
self::$default_values = array(
|
||||
@@ -475,8 +478,7 @@ class AdminImport extends AdminTab
|
||||
$path = _PS_CAT_IMG_DIR_.(int)($id_entity);
|
||||
break;
|
||||
}
|
||||
|
||||
if (copy(trim($url), $tmpfile))
|
||||
if (copy(str_replace(' ', '%20', trim($url)), $tmpfile))
|
||||
{
|
||||
imageResize($tmpfile, $path.'.jpg');
|
||||
$imagesTypes = ImageType::getImagesTypes($entity);
|
||||
@@ -938,6 +940,11 @@ class AdminImport extends AdminTab
|
||||
|
||||
$product = new Product((int)($info['id_product']), false, $defaultLanguage);
|
||||
$id_image = null;
|
||||
//delete existing images if "delete_existing_images" is set to 1
|
||||
if (array_key_exists('delete_existing_images', $info) && $info['delete_existing_images'])
|
||||
$product->deleteImages();
|
||||
elseif (array_key_exists('image_url', $info))
|
||||
$product->deleteImages();
|
||||
|
||||
if (isset($info['image_url']) && $info['image_url'])
|
||||
{
|
||||
|
||||
@@ -446,6 +446,7 @@ class AdminPerformance extends AdminTab
|
||||
</select>
|
||||
</div>
|
||||
<div id="directory_depth">
|
||||
<div class="warn">'.$this->l('The system CacheFS should be used only when the infrastructure contain only one front-end server. Ask your hosting company if you don\'t know.').'</div>
|
||||
<label>'.$this->l('Directory depth:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="ps_cache_fs_directory_depth" value="'.($depth ? $depth : 1).'" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -34,21 +34,21 @@ class AdminScenes extends AdminTab
|
||||
$this->lang = true;
|
||||
$this->edit = true;
|
||||
$this->delete = true;
|
||||
|
||||
|
||||
$this->fieldImageSettings = array(
|
||||
array('name' => 'image', 'dir' => 'scenes'),
|
||||
array('name' => 'thumb', 'dir' => 'scenes/thumbs')
|
||||
);
|
||||
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_scene' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'name' => array('title' => $this->l('Image Maps'), 'width' => 150, 'filter_key' => 'b!name'),
|
||||
'active' => array('title' => $this->l('Activated'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
|
||||
);
|
||||
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function afterImageUpload()
|
||||
{
|
||||
/* Generate image with differents size */
|
||||
@@ -73,64 +73,17 @@ class AdminScenes extends AdminTab
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a categories tree
|
||||
*
|
||||
* @param array $indexedCategories Array with categories where product is indexed (in order to check checkbox)
|
||||
* @param array $categories Categories to list
|
||||
* @param array $current Current category
|
||||
* @param integer $id_category Current category id
|
||||
*/
|
||||
public function recurseCategoryForInclude($indexedCategories, $categories, $current, $id_category = 1, $id_category_default = NULL, $has_suite = array())
|
||||
{
|
||||
global $done;
|
||||
static $irow;
|
||||
|
||||
$id_obj = (int)(Tools::getValue($this->id));
|
||||
|
||||
if (!isset($done[$current['infos']['id_parent']]))
|
||||
$done[$current['infos']['id_parent']] = 0;
|
||||
$done[$current['infos']['id_parent']] += 1;
|
||||
|
||||
$todo = sizeof($categories[$current['infos']['id_parent']]);
|
||||
$doneC = $done[$current['infos']['id_parent']];
|
||||
|
||||
$level = $current['infos']['level_depth'] + 1;
|
||||
|
||||
echo '
|
||||
<tr class="'.($irow++ % 2 ? 'alt_row' : '').'">
|
||||
<td>
|
||||
<input type="checkbox" name="categories[]" class="categoryBox'.($id_category_default == $id_category ? ' id_category_default' : '').'" id="categoryBox_'.$id_category.'" value="'.$id_category.'"'.((in_array($id_category, $indexedCategories) OR ((int)(Tools::getValue('id_category')) == $id_category AND !(int)($id_obj))) ? ' checked="checked"' : '').' />
|
||||
</td>
|
||||
<td>
|
||||
'.$id_category.'
|
||||
</td>
|
||||
<td>';
|
||||
for ($i = 2; $i < $level; $i++)
|
||||
echo '<img src="../img/admin/lvl_'.$has_suite[$i - 2].'.gif" alt="" style="vertical-align: middle;"/>';
|
||||
echo '<img src="../img/admin/'.($level == 1 ? 'lv1.gif' : 'lv2_'.($todo == $doneC ? 'f' : 'b').'.gif').'" alt="" style="vertical-align: middle;"/>
|
||||
<label for="categoryBox_'.$id_category.'" class="t">'.stripslashes($current['infos']['name']).'</label></td>
|
||||
</tr>';
|
||||
|
||||
if ($level > 1)
|
||||
$has_suite[] = ($todo == $doneC ? 0 : 1);
|
||||
if (isset($categories[$id_category]))
|
||||
foreach ($categories[$id_category] AS $key => $row)
|
||||
if ($key != 'infos')
|
||||
$this->recurseCategoryForInclude($indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite);
|
||||
}
|
||||
|
||||
public function displayForm($isMainTab = true)
|
||||
{
|
||||
parent::displayForm();
|
||||
|
||||
|
||||
if (!($obj = $this->loadObject(true)))
|
||||
return;
|
||||
|
||||
|
||||
$langtags = 'name';
|
||||
$active = $this->getFieldValue($obj, 'active');
|
||||
|
||||
|
||||
echo '
|
||||
<script type="text/javascript">';
|
||||
echo 'startingData = new Array();'."\n";
|
||||
@@ -139,7 +92,7 @@ class AdminScenes extends AdminTab
|
||||
$productObj = new Product($product['id_product'], true, $this->context->language->id);
|
||||
echo 'startingData['.$key.'] = new Array(\''.$productObj->name.'\', '.$product['id_product'].', '.$product['x_axis'].', '.$product['y_axis'].', '.$product['zone_width'].', '.$product['zone_height'].');';
|
||||
}
|
||||
|
||||
|
||||
echo
|
||||
'</script>
|
||||
<form id="scenesForm" action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
|
||||
@@ -151,7 +104,7 @@ class AdminScenes extends AdminTab
|
||||
'.$this->l('When a customer hovers over the image with the mouse, a pop-up appears displaying a brief description of the product. The customer can then click to open the product\'s full product page. To achieve this, please define the \'mapping zone\' that, when hovered over, will display the pop-up. Left-click with your mouse to draw the four-sided mapping zone, then release. Then, begin typing the name of the associated product. A list of products appears. Click the appropriate product, then click OK. Repeat these steps for each mapping zone you wish to create. When you have finished mapping zones, click Save Image Map.').'
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
echo '<label>'.$this->l('Image map name:').' </label>
|
||||
<div class="margin-form">';
|
||||
foreach ($this->_languages as $language)
|
||||
@@ -162,8 +115,8 @@ class AdminScenes extends AdminTab
|
||||
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, $langtags, 'name');
|
||||
echo ' <div class="clear"></div>
|
||||
</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
echo '<label>'.$this->l('Status:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="active" id="active_on" value="1" '.((!$obj->id OR Tools::getValue('active', $obj->active)) ? 'checked="checked" ' : '').'/>
|
||||
@@ -172,8 +125,8 @@ class AdminScenes extends AdminTab
|
||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Deactivated').'" title="'.$this->l('Deactivated').'" /></label>
|
||||
<p>'.$this->l('Activate or deactivate the image map').'</p>
|
||||
</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
$sceneImageTypes = ImageType::getImagesTypes('scenes');
|
||||
$largeSceneImageType = NULL;
|
||||
$thumbSceneImageType = NULL;
|
||||
@@ -184,14 +137,14 @@ class AdminScenes extends AdminTab
|
||||
if ($sceneImageType['name'] == 'thumb_scene')
|
||||
$thumbSceneImageType = $sceneImageType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
echo '<label>'.$this->l('Image to be mapped:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="hidden" id="stay_here" name="stay_here" value="" />
|
||||
<input type="file" name="image" id="image_input" /> <input type="button" value="'.$this->l('Upload image').'" onclick="{$(\'#stay_here\').val(\'true\');$(\'#scenesForm\').submit();}" class="button" /><br/>
|
||||
<p>'.$this->l('Format:').' JPG, GIF, PNG. '.$this->l('File size:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('KB max.').' '.$this->l('If larger than the image size setting, the image will be reduced to ').' '.$largeSceneImageType['width'].'x'.$largeSceneImageType['height'].'px '.$this->l('(width x height). If smaller than the image-size setting, a white background will be added in order to achieve the correct image size.').'.<br />'.$this->l('Note: To change image dimensions, please change the \'large_scene\' image type settings to the desired size (in Back Office > Preferences > Images).').'</p>';
|
||||
|
||||
|
||||
if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_.$obj->id.'-large_scene.jpg'))
|
||||
{
|
||||
echo '<img id="large_scene_image" style="clear:both;border:1px solid black;" alt="" src="'._THEME_SCENE_DIR_.$obj->id.'-large_scene.jpg" /><br />';
|
||||
@@ -223,29 +176,23 @@ class AdminScenes extends AdminTab
|
||||
echo '</div>
|
||||
';
|
||||
|
||||
echo '<label>'.$this->l('Category:').' </label>
|
||||
<div class="margin-form">
|
||||
<div style="overflow: auto; max-height: 300px; padding-top: 0.6em;" id="categoryList">
|
||||
<table cellspacing="0" cellpadding="0" class="table" style="width: 600px;">
|
||||
<tr>
|
||||
<th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'categories[]\', this.checked)" /></th>
|
||||
<th>'.$this->l('ID').'</th>
|
||||
<th>'.$this->l('Image map name:').'</th>
|
||||
</tr>';
|
||||
$categories = Category::getCategories($this->context->language->id, false);
|
||||
$done = array();
|
||||
$index = array();
|
||||
if (Tools::isSubmit('categories'))
|
||||
foreach (Tools::getValue('categories') AS $k => $row)
|
||||
$index[] = $row;
|
||||
elseif ($obj->id)
|
||||
foreach (Scene::getIndexedCategories($obj->id) AS $k => $row)
|
||||
$index[] = $row['id_category'];
|
||||
$this->recurseCategoryForInclude($index, $categories, $categories[0][1], 1, null);
|
||||
echo '</table>
|
||||
<p style="padding:0px; margin:0px 0px 10px 0px;">'.$this->l('Mark all checkbox(es) of the categories for which the image map is to appear.').'<sup> *</sup></p>
|
||||
</div>
|
||||
</div>';
|
||||
$selectedCat = array();
|
||||
if (Tools::isSubmit('categories'))
|
||||
foreach (Tools::getValue('categories') as $k => $row)
|
||||
$selectedCat[] = $row;
|
||||
else if ($obj->id)
|
||||
foreach (Scene::getIndexedCategories($obj->id) as $k => $row)
|
||||
$selectedCat[] = $row['id_category'];
|
||||
|
||||
$trads = array(
|
||||
'Home' => $this->l('Home'),
|
||||
'selected' => $this->l('selected'),
|
||||
'Collapse All' => $this->l('Collapse All'),
|
||||
'Expand All' => $this->l('Expand All'),
|
||||
'Check All' => $this->l('Check All'),
|
||||
'Uncheck All' => $this->l('Uncheck All')
|
||||
);
|
||||
|
||||
if (Shop::isMultiShopActivated())
|
||||
{
|
||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||
@@ -253,9 +200,16 @@ class AdminScenes extends AdminTab
|
||||
echo '</div>';
|
||||
}
|
||||
echo '
|
||||
<label>'.$this->l('Categories:').'</label>
|
||||
<div class="margin-form">
|
||||
';
|
||||
echo Helper::renderAdminCategorieTree($trads, $selectedCat, 'categories');
|
||||
echo '
|
||||
</div>
|
||||
<div id="save_scene" class="margin-form" '.(($obj->id && file_exists(_PS_SCENE_IMG_DIR_.$obj->id.'-large_scene.jpg')) ? '' : 'style="display:none;"') .'>
|
||||
<input type="submit" name="save_image_map" value="'.$this->l('Save Image Map(s)').'" class="button" />
|
||||
</div>';
|
||||
</div>
|
||||
';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,7 +221,7 @@ class AdminScenes extends AdminTab
|
||||
$this->displayAssoShop();
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
echo '
|
||||
<div class="small"><sup>*</sup> '.$this->l('Required field').'</div>
|
||||
@@ -275,7 +229,7 @@ class AdminScenes extends AdminTab
|
||||
</form>
|
||||
';
|
||||
}
|
||||
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('save_image_map'))
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<p>{l s ='To receive PrestaShop update warnings, you need to activate the <b>allow_url_fopen</b> command in your <b>php.ini</b> config file.'} [<a href="http://www.php.net/manual/'.$isoUser.'/ref.filesystem.php">{l s ='more info'}</a>]</p>
|
||||
<p>{l s ='If you don\'t know how to do that, please contact your host administrator !'}</p><br />
|
||||
{/if}
|
||||
{if $show_screencast}
|
||||
{if $employee->bo_show_screencast}
|
||||
<div id="adminpresentation">
|
||||
<iframe src="{$protocol}://screencasts.prestashop.com/screencast.php?iso_lang={$isoUser}" style="border:none;width:100%;height:420px;" scrolling="no"></iframe>
|
||||
<div id="footer_iframe_home">
|
||||
@@ -76,7 +76,7 @@ $(document).ready(function() {
|
||||
$('#adminpresentation').fadeIn('slow');
|
||||
else
|
||||
$('#adminpresentation').fadeOut('slow');
|
||||
|
||||
|
||||
$('#partner_preactivation').fadeOut('slow', function() {
|
||||
if (json.partner_preactivation != 'NOK')
|
||||
$('#partner_preactivation').html(json.partner_preactivation);
|
||||
@@ -84,7 +84,7 @@ $(document).ready(function() {
|
||||
$('#partner_preactivation').html('');
|
||||
$('#partner_preactivation').fadeIn('slow');
|
||||
});
|
||||
|
||||
|
||||
$('#discover_prestashop').fadeOut('slow', function() {
|
||||
if (json.discover_prestashop != 'NOK')
|
||||
$('#discover_prestashop').html(json.discover_prestashop);
|
||||
@@ -96,7 +96,7 @@ $(document).ready(function() {
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
$('#adminpresentation').fadeOut('slow');
|
||||
$('#partner_preactivation').fadeOut('slow');
|
||||
$('#partner_preactivation').fadeOut('slow');
|
||||
$('#discover_prestashop').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user