Aicod_AdminWysiwygImageUrlFix - Version 1.0.80311522

Version Notes

www.ecommercegrow.com

Download this release

Release Info

Developer ecommercegrow
Extension Aicod_AdminWysiwygImageUrlFix
Version 1.0.80311522
Comparing to
See all releases


Version 1.0.80311522

app/code/community/Aicod/AdminWysiwygImageUrlFix/README.TXT ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Aicod_AdminWysiwygImageUrlFix
2
+ http://www.ecommercegrow.com/
3
+
4
+ Purpose / Features:
5
+ - Fix image loading in magento backend that cause the wysiwyg editor of cms pages containing images to block until timeout (2/3 sec).
6
+
7
+ Compatibility:
8
+ - Magento 1.7+
9
+
10
+ Required Dependencies:
11
+ - NONE
12
+
13
+ Installation:
14
+ - ATTENTION: ALWAYS INSTALL THE "Required Dependencies" IN THE EXACT ORDER SPECIFIED BEFORE INSTALLING THIS MODULE OR YOUR SHOP COULD BECOME CORRUPTED!
15
+ - Intall the provided tgz package file with the magento web gui:
16
+ Magento Backend\System\Magento Connect\Magento Connect Manager\Direct package file upload\Upload
17
+ Alternatively via command line: "MAGENTO_ROOT/mage install-file PACKAGEFILE.tgz"
18
+ Alternatively manually extracting the tgz file directly to MAGENTO_ROOT
19
+ - Always remember to flush magento cache after installing any extension: Magento Backend\System\Cache Management\Flush Cache Storage
20
+ And logout/login from the magento backend.
21
+
22
+ Uninstallation:
23
+ - ATTENTION: ALWAYS UNINSTALL EACH MODULE IN THE INVERSE ORDER SPECIFIED IN THE SECTION "Required Dependencies" OR YOUR SHOP COULD BECOME CORRUPTED!
24
+ - Choose Unistall in Magento Backend\System\Magento Connect\Magento Connect Manager\Manage Existing Extensions
25
+ Alternatively via command line: "MAGENTO_ROOT/mage uninstall community PACKAGENAME" (use "MAGENTO_ROOT/mage list-installed" to retrive the list of installaed packages)
26
+ Alternatively manually remove each file you have extracted in the installation.
27
+
28
+ Configuration / Usage:
29
+ - Once installed the extension become immediatly active.
app/code/community/Aicod/AdminWysiwygImageUrlFix/controllers/Cms/WysiwygController.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml').DS.'Cms/WysiwygController.php';
4
+
5
+ class Aicod_AdminWysiwygImageUrlFix_Cms_WysiwygController extends Mage_Adminhtml_Cms_WysiwygController
6
+ {
7
+ public function directiveAction()
8
+ {
9
+ $directive = $this->getRequest()->getParam('___directive');
10
+ $directive = Mage::helper('core')->urlDecode($directive);
11
+ $url = Mage::getModel('core/email_template_filter')->filter($directive);
12
+ try {
13
+ $image = Varien_Image_Adapter::factory('GD2');
14
+ $urlinfo = parse_url($url);
15
+ if($urlinfo['scheme'] || $urlinfo['host']) {
16
+ $url = trim($urlinfo['path'],'/');
17
+ }
18
+ $notok = (!is_file($url) || !is_readable($url));
19
+ //var_dump($urlinfo);
20
+ //var_dump($url);
21
+ //var_dump($notok);
22
+ //exit;
23
+ if($notok) {
24
+ throw new Exception("Wysiwyg image not found or not readable: {$url}!");
25
+ }
26
+ $image->open($url);
27
+ $image->display();
28
+ } catch (Exception $e) {
29
+ $url = Mage::getSingleton('cms/wysiwyg_config')->getSkinImagePlaceholderUrl();
30
+ $notok = (!is_file($url) || !is_readable($url));
31
+ if(!$notok) {
32
+ $image = Varien_Image_Adapter::factory('GD2');
33
+ $image->open($url);
34
+ $image->display();
35
+ } else {
36
+ //$image = imagecreate(100, 100);
37
+ $image = imagecreate(100, 100);
38
+ $bkgrColor = imagecolorallocate($image,10,10,10);
39
+ imagefill($image,0,0,$bkgrColor);
40
+ $textColor = imagecolorallocate($image,255,255,255);
41
+ imagestring($image, 4, 10, 10, 'Skin image', $textColor);
42
+ //imagestring($image, 4, 10, 10, 'Image Not Found', $textColor);
43
+ header('Content-type: image/png');
44
+ imagepng($image);
45
+ imagedestroy($image);
46
+ }
47
+ }
48
+ }
49
+ }
app/code/community/Aicod/AdminWysiwygImageUrlFix/etc/config.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Aicod_AdminWysiwygImageUrlFix>
5
+ <version>1.0</version>
6
+ </Aicod_AdminWysiwygImageUrlFix>
7
+ </modules>
8
+
9
+ <!-- controller backend -->
10
+ <admin>
11
+ <routers>
12
+ <adminhtml>
13
+ <args>
14
+ <modules>
15
+ <aicod_adminwysiwygimageurlfix before="Mage_Adminhtml">Aicod_AdminWysiwygImageUrlFix</aicod_adminwysiwygimageurlfix>
16
+ </modules>
17
+ </args>
18
+ </adminhtml>
19
+ </routers>
20
+ </admin>
21
+
22
+ </config>
app/etc/modules/Aicod_AdminWysiwygImageUrlFix.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Aicod_AdminWysiwygImageUrlFix>
5
+ <active>1</active>
6
+ <codePool>community</codePool>
7
+ </Aicod_AdminWysiwygImageUrlFix>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Aicod_AdminWysiwygImageUrlFix</name>
4
+ <version>1.0.80311522</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.ecommercegrow.com/license">http://www.ecommercegrow.com/license</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>www.ecommercegrow.com</summary>
10
+ <description>www.ecommercegrow.com</description>
11
+ <notes>www.ecommercegrow.com</notes>
12
+ <authors>
13
+ <author>
14
+ <name>ecommercegrow</name>
15
+ <user>ecommercegrow</user>
16
+ <email>info@ecommercegrow.com</email>
17
+ </author>
18
+ </authors>
19
+ <compatible/>
20
+ <dependencies>
21
+ <required>
22
+ <php>
23
+ <min>5.2.0</min>
24
+ <max>6.0.0</max>
25
+ </php>
26
+ </required>
27
+ </dependencies>
28
+ <date>2013-05-31</date>
29
+ <time>13:49:44</time>
30
+ <contents>
31
+ <target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Aicod_AdminWysiwygImageUrlFix.xml" hash="a9d0d47cc0d8061b4d009e8e95f26730"/></dir></dir><dir name="code"><dir name="community"><dir name="Aicod"><dir name="AdminWysiwygImageUrlFix"><dir name="controllers"><dir name="Cms"><file name="WysiwygController.php" hash="10452cb38104623de3bb8885587e4ad4"/></dir></dir><dir name="etc"><file name="config.xml" hash="135ea60fef7bbc9481a60d2c9e8f1391"/></dir><file name="README.TXT" hash="d3680a8c2e8890fb81c8ca86c0fec986"/></dir></dir></dir></dir></dir></target>
32
+ </contents>
33
+ </package>