Version Notes
Base extension required by all our other extensions
Download this release
Release Info
Developer | Magento Core Team |
Extension | Ayaline_Core |
Version | 1.1.4 |
Comparing to | |
See all releases |
Code changes from version 1.1.2 to 1.1.4
- app/code/community/Ayaline/Core/Block/Adminhtml/Catalog/Product/Edit/TabsInitializer.php +40 -0
- app/code/community/Ayaline/Core/Helper/Data.php +28 -0
- app/code/community/Ayaline/Core/Helper/Js.php +55 -0
- app/code/community/Ayaline/Core/Model/Cron/Abstract.php +4 -4
- app/code/community/Ayaline/Core/etc/config.xml +14 -1
- app/design/adminhtml/default/default/layout/ayaline/core.xml +11 -0
- package.xml +4 -4
app/code/community/Ayaline/Core/Block/Adminhtml/Catalog/Product/Edit/TabsInitializer.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* created : 2 juil. 2012
|
4 |
+
*
|
5 |
+
* @category Ayaline
|
6 |
+
* @package Ayaline_XXXX
|
7 |
+
* @author aYaline
|
8 |
+
* @copyright Ayaline - 2012 - http://magento-shop.ayaline.com
|
9 |
+
* @license http://shop.ayaline.com/magento/fr/conditions-generales-de-vente.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ayaline_Core_Block_Adminhtml_Catalog_Product_Edit_TabsInitializer extends Mage_Core_Block_Abstract {
|
13 |
+
|
14 |
+
protected function _prepareLayout() {
|
15 |
+
$product = Mage::registry('product');
|
16 |
+
|
17 |
+
if(!($setId = $product->getAttributeSetId())) {
|
18 |
+
$setId = $this->getRequest()->getParam('set', null);
|
19 |
+
}
|
20 |
+
|
21 |
+
if($setId) {
|
22 |
+
/* @var $block Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs */
|
23 |
+
$block = $this->getLayout()->getBlock('product_tabs');
|
24 |
+
|
25 |
+
if(!$block) {
|
26 |
+
// This case occurs for example during the first step of configurable product creation
|
27 |
+
return parent::_prepareLayout();
|
28 |
+
}
|
29 |
+
|
30 |
+
$data = array(
|
31 |
+
'tabs' => $block,
|
32 |
+
'request' => $this->getRequest(),
|
33 |
+
);
|
34 |
+
Mage::dispatchEvent('ayaline_core_adminhtml_catalog_product_tabs_initializer', $data);
|
35 |
+
|
36 |
+
}
|
37 |
+
return parent::_prepareLayout();
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
app/code/community/Ayaline/Core/Helper/Data.php
CHANGED
@@ -58,4 +58,32 @@ class Ayaline_Core_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
58 |
$notification->setDescription($notificationObject->getDescription());
|
59 |
$notification->save();
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
58 |
$notification->setDescription($notificationObject->getDescription());
|
59 |
$notification->save();
|
60 |
}
|
61 |
+
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Upload a file on server
|
65 |
+
*
|
66 |
+
* @param string $field (field in $_FILES)
|
67 |
+
* @param string $path
|
68 |
+
* @param array $allowedExt
|
69 |
+
* @return string
|
70 |
+
* @throws Exception
|
71 |
+
*/
|
72 |
+
public function upload($field, $path, $allowedExt = array('jpg','jpeg','gif','png')){
|
73 |
+
try {
|
74 |
+
$uploader = new Varien_File_Uploader($field);
|
75 |
+
$uploader->setAllowedExtensions($allowedExt);
|
76 |
+
$uploader->setAllowRenameFiles(true);
|
77 |
+
$uploader->setFilesDispersion(true);
|
78 |
+
$uploader->setAllowCreateFolders(true);
|
79 |
+
|
80 |
+
$uplResult = $uploader->save($path);
|
81 |
+
return $uplResult['file'];
|
82 |
+
} catch(Exception $e) {
|
83 |
+
Mage::logException($e);
|
84 |
+
throw $e;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
}
|
app/code/community/Ayaline/Core/Helper/Js.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* created : 20 avr. 2012
|
4 |
+
*
|
5 |
+
* @category Ayaline
|
6 |
+
* @package Ayaline_XXXX
|
7 |
+
* @author aYaline
|
8 |
+
* @copyright Ayaline - 2012 - http://magento-shop.ayaline.com
|
9 |
+
* @license http://shop.ayaline.com/magento/fr/conditions-generales-de-vente.html
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Ayaline_Core_Helper_Js extends Mage_Core_Helper_Js {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Array of senteces of JS translations
|
16 |
+
*
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
protected $_translateData = null;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Retrieve JS translator initialization javascript
|
23 |
+
*
|
24 |
+
* @return string
|
25 |
+
*/
|
26 |
+
public function getTranslatorScript() {
|
27 |
+
$script = 'var AyalineTranslator = new Translate('.$this->getTranslateJson().');';
|
28 |
+
return $this->getScript($script);
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Retrieve JS translation array
|
33 |
+
*
|
34 |
+
* @return array
|
35 |
+
*/
|
36 |
+
protected function _getTranslateData() {
|
37 |
+
if($this->_translateData === null) {
|
38 |
+
$_translateData = array(
|
39 |
+
|
40 |
+
);
|
41 |
+
|
42 |
+
$_translateData = new Varien_Object($_translateData);
|
43 |
+
Mage::dispatchEvent('ayalinecore_helper_js_translate', array('translate_data' => $_translateData));
|
44 |
+
$this->_translateData = $_translateData->getData();
|
45 |
+
|
46 |
+
foreach($this->_translateData as $key => $value) {
|
47 |
+
if($key == $value) {
|
48 |
+
unset($this->_translateData[$key]);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
return $this->_translateData;
|
53 |
+
}
|
54 |
+
|
55 |
+
}
|
app/code/community/Ayaline/Core/Model/Cron/Abstract.php
CHANGED
@@ -31,7 +31,7 @@ abstract class Ayaline_Core_Model_Cron_Abstract extends Varien_Object {
|
|
31 |
// ex: {{base_dir}}/var/log/ayaline/competition
|
32 |
$this->_ayalineLogPath = Mage::getBaseDir('log').DS.self::AYALINE_DIR.DS.$this->_getLogPath();
|
33 |
|
34 |
-
$this->_ayalineLogFilename = self::AYALINE_DIR.DS.$this->_getLogPath().DS.$this->
|
35 |
}
|
36 |
|
37 |
/**
|
@@ -41,7 +41,7 @@ abstract class Ayaline_Core_Model_Cron_Abstract extends Varien_Object {
|
|
41 |
* @param int $level (see Zend_Log)
|
42 |
*/
|
43 |
protected function _log($message, $level = null) {
|
44 |
-
$forceLog = $this->
|
45 |
if($forceLog) {
|
46 |
if(!is_dir($this->_ayalineLogPath)) {
|
47 |
mkdir($this->_ayalineLogPath, 0755, true);
|
@@ -64,7 +64,7 @@ abstract class Ayaline_Core_Model_Cron_Abstract extends Varien_Object {
|
|
64 |
*
|
65 |
* @return bool
|
66 |
*/
|
67 |
-
abstract protected function
|
68 |
|
69 |
/**
|
70 |
* Path to log files, from {{base_dir}}/var/log/ayaline
|
@@ -78,6 +78,6 @@ abstract class Ayaline_Core_Model_Cron_Abstract extends Varien_Object {
|
|
78 |
*
|
79 |
* @return string
|
80 |
*/
|
81 |
-
abstract protected function
|
82 |
|
83 |
}
|
31 |
// ex: {{base_dir}}/var/log/ayaline/competition
|
32 |
$this->_ayalineLogPath = Mage::getBaseDir('log').DS.self::AYALINE_DIR.DS.$this->_getLogPath();
|
33 |
|
34 |
+
$this->_ayalineLogFilename = self::AYALINE_DIR.DS.$this->_getLogPath().DS.$this->_getLogFilename();
|
35 |
}
|
36 |
|
37 |
/**
|
41 |
* @param int $level (see Zend_Log)
|
42 |
*/
|
43 |
protected function _log($message, $level = null) {
|
44 |
+
$forceLog = $this->_logIsActive();
|
45 |
if($forceLog) {
|
46 |
if(!is_dir($this->_ayalineLogPath)) {
|
47 |
mkdir($this->_ayalineLogPath, 0755, true);
|
64 |
*
|
65 |
* @return bool
|
66 |
*/
|
67 |
+
abstract protected function _logIsActive();
|
68 |
|
69 |
/**
|
70 |
* Path to log files, from {{base_dir}}/var/log/ayaline
|
78 |
*
|
79 |
* @return string
|
80 |
*/
|
81 |
+
abstract protected function _getLogFilename();
|
82 |
|
83 |
}
|
app/code/community/Ayaline/Core/etc/config.xml
CHANGED
@@ -11,11 +11,13 @@
|
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
|
|
14 |
<modules>
|
15 |
<Ayaline_Core>
|
16 |
-
<version>1.1.
|
17 |
</Ayaline_Core>
|
18 |
</modules>
|
|
|
19 |
<global>
|
20 |
<blocks>
|
21 |
<ayalinecore>
|
@@ -33,6 +35,7 @@
|
|
33 |
</ayalinecore>
|
34 |
</models>
|
35 |
</global>
|
|
|
36 |
<adminhtml>
|
37 |
<layout>
|
38 |
<updates>
|
@@ -62,6 +65,16 @@
|
|
62 |
</events>-->
|
63 |
</adminhtml>
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
<default>
|
66 |
<ayalinecore>
|
67 |
<adminnotification>
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
14 |
+
|
15 |
<modules>
|
16 |
<Ayaline_Core>
|
17 |
+
<version>1.1.4</version>
|
18 |
</Ayaline_Core>
|
19 |
</modules>
|
20 |
+
|
21 |
<global>
|
22 |
<blocks>
|
23 |
<ayalinecore>
|
35 |
</ayalinecore>
|
36 |
</models>
|
37 |
</global>
|
38 |
+
|
39 |
<adminhtml>
|
40 |
<layout>
|
41 |
<updates>
|
65 |
</events>-->
|
66 |
</adminhtml>
|
67 |
|
68 |
+
<frontend>
|
69 |
+
<layout>
|
70 |
+
<updates>
|
71 |
+
<ayalinecore>
|
72 |
+
<file>ayaline/core.xml</file>
|
73 |
+
</ayalinecore>
|
74 |
+
</updates>
|
75 |
+
</layout>
|
76 |
+
</frontend>
|
77 |
+
|
78 |
<default>
|
79 |
<ayalinecore>
|
80 |
<adminnotification>
|
app/design/adminhtml/default/default/layout/ayaline/core.xml
CHANGED
@@ -11,9 +11,20 @@
|
|
11 |
*/
|
12 |
-->
|
13 |
<layout>
|
|
|
14 |
<default>
|
15 |
<reference name="head">
|
16 |
<action method="addCss"><name>ayaline.css</name></action>
|
17 |
</reference>
|
18 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</layout>
|
11 |
*/
|
12 |
-->
|
13 |
<layout>
|
14 |
+
|
15 |
<default>
|
16 |
<reference name="head">
|
17 |
<action method="addCss"><name>ayaline.css</name></action>
|
18 |
</reference>
|
19 |
</default>
|
20 |
+
|
21 |
+
<!-- Product tabs initializer -->
|
22 |
+
<adminhtml_catalog_product_new>
|
23 |
+
<block type="ayalinecore/adminhtml_catalog_product_edit_tabsInitializer" name="ayaline.core.adminhtml.catalog.product.edit.tabs_initializer" />
|
24 |
+
</adminhtml_catalog_product_new>
|
25 |
+
|
26 |
+
<adminhtml_catalog_product_edit>
|
27 |
+
<block type="ayalinecore/adminhtml_catalog_product_edit_tabsInitializer" name="ayaline.core.adminhtml.catalog.product.edit.tabs_initializer" />
|
28 |
+
</adminhtml_catalog_product_edit>
|
29 |
+
|
30 |
</layout>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ayaline_Core</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.ayaline.com/magento/fr/conditions-generales-de-vente.html">aYaline Custom License</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Ayaline_Core is the base extension required by all our other extensions</description>
|
11 |
<notes>Base extension required by all our other extensions</notes>
|
12 |
<authors><author><name>aYaline Team</name><user>auto-converted</user><email>magento@ayaline.com</email></author></authors>
|
13 |
-
<date>2012-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Ayaline"><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="7abaab0e11728ca0924f04c7498af573"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ayaline_Core</name>
|
4 |
+
<version>1.1.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.ayaline.com/magento/fr/conditions-generales-de-vente.html">aYaline Custom License</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Ayaline_Core is the base extension required by all our other extensions</description>
|
11 |
<notes>Base extension required by all our other extensions</notes>
|
12 |
<authors><author><name>aYaline Team</name><user>auto-converted</user><email>magento@ayaline.com</email></author></authors>
|
13 |
+
<date>2012-07-02</date>
|
14 |
+
<time>15:18:29</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Ayaline"><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><file name="TabsInitializer.php" hash="60daf7663aa1affd3e0d34e05bb8f697"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="7abaab0e11728ca0924f04c7498af573"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="b8e644139ab008ace07fb70de8e6b589"/><file name="Js.php" hash="9a567518e1d824361583ead670359760"/></dir><dir name="Model"><dir name="Cron"><file name="Abstract.php" hash="a221e0b0d11463e502a603598c091918"/></dir><file name="Feed.php" hash="57cf6d665cb1b1ecad82a2aa713755e1"/><file name="Observer.php" hash="a1cb4b6bd1062e71365e50e93899bf32"/></dir><dir name="etc"><file name="config.xml" hash="69860742504b552171f37695d11d7cda"/><file name="system.xml" hash="21e2f7e8a0a9e914cfcf3001366fc143"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="ayaline"><dir name="core"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="2036c4ed80b51a1ebd539b24390186da"/></dir></dir></dir></dir></dir></dir><dir name="layout"><dir name="ayaline"><file name="core.xml" hash="889bda7082fc806879b27a419968e06c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ayaline_Core.xml" hash="24cec14ac18e6e809e0b8dd6c3a65e2e"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Ayaline_Core.csv" hash="9a20fba048bc91df06ef1a639f67a130"/></dir><dir name="fr_FR"><file name="Ayaline_Core.csv" hash="10d5987f7d5d2ed22be099fbb9cc3c68"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="ayaline"><file name="ayaline_header.png" hash="8da709173dec62ed2abef4a9bb64705f"/><file name="ayaline_icommerce.png" hash="583c9808ae4654ca969871dd6fcb07df"/></dir></dir><file name="ayaline.css" hash="edf290ba956af85a695411fd34adfd28"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|