Prizm_Cloud_Embedded_Document_Viewer - Version 0.1.0

Version Notes

Initial Release

Download this release

Release Info

Developer Accusoft
Extension Prizm_Cloud_Embedded_Document_Viewer
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/Accusoft/Prizmclouddocsviewer/Adminhtml/Model/System/Config/Source/Ptype.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Used in creating options for flash/html config value selection
5
+ *
6
+ */
7
+ class Accusoft_Prizmclouddocsviewer_Adminhtml_Model_System_Config_Source_Ptype
8
+ {
9
+
10
+ /**
11
+ * Options getter
12
+ *
13
+ * @return array
14
+ */
15
+ public function toOptionArray()
16
+ {
17
+ return array(
18
+ array('value' => 'flash', 'label'=>Mage::helper('adminhtml')->__('flash')),
19
+ array('value' => 'html5', 'label'=>Mage::helper('adminhtml')->__('html5')),
20
+ );
21
+ }
22
+
23
+ /**
24
+ * Get options in "key-value" format
25
+ *
26
+ * @return array
27
+ */
28
+ public function toArray()
29
+ {
30
+ return array(
31
+ 'flash' => Mage::helper('adminhtml')->__('flash'),
32
+ 'html5' => Mage::helper('adminhtml')->__('html5'),
33
+ );
34
+ }
35
+
36
+ }
app/code/community/Accusoft/Prizmclouddocsviewer/Block/Adminhtml/Prizmclouddocsviewer.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Accusoft_Prizmclouddocsviewer_Block_Adminhtml_Prizmclouddocsviewer extends Mage_Adminhtml_Block_Template {
4
+
5
+
6
+
7
+ }
app/code/community/Accusoft/Prizmclouddocsviewer/Block/Viewer.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Accusoft_Prizmclouddocsviewer_Block_Viewer extends Mage_Core_Block_Abstract
4
+ {
5
+ protected function _toHtml()
6
+ {
7
+ $style = '<style>div.prizmcloud .prizmcloud_iframe {
8
+ border:0;
9
+ max-width:100%;
10
+ }</style>';
11
+ $html = '<div class="prizmcloud">' . $style;
12
+
13
+ if(Mage::getStoreConfig('prizmcloud/settings/pkey'))
14
+ {
15
+ $url_base = 'http://connect.ajaxdocumentviewer.com/?key=';
16
+ $pkey = Mage::getStoreConfig('prizmcloud/settings/pkey');
17
+ $ptype = ($this->getv_type()) ? $this->getv_type() : Mage::getStoreConfig('prizmcloud/settings/ptype');
18
+ $doc_url = ($this->getdoc_url()) ? $this->getdoc_url() : Mage::getStoreConfig('prizmcloud/settings/doc_url');
19
+ $width = ($this->getv_width()) ? $this->getv_width() : Mage::getStoreConfig('prizmcloud/settings/width');
20
+ $vwidth = ($width) ? '&viewerwidth=' . $width : '';
21
+ $iwidth = ($width) ? 'width="'.($width + 20).'"' : '';
22
+ $height = ($this->getv_height()) ? $this->getv_height() : Mage::getStoreConfig('prizmcloud/settings/height');
23
+ $vheight = ($height) ? '&viewerheight=' . $height : '';
24
+ $iheight = ($height) ? 'height="'.($height + 20).'"' : '';
25
+
26
+ if(
27
+ ($this->getprint_button() && $this->getprint_button() === 'Yes') ||
28
+ (Mage::getStoreConfig('prizmcloud/settings/print_button') && Mage::getStoreConfig('prizmcloud/settings/print_button') === 1))
29
+ {
30
+ $print_button = 'Yes';
31
+ }
32
+ else
33
+ {
34
+ $print_button = 'No';
35
+ }
36
+ $toolbar_color = ($this->gettoolbar_color()) ? $this->gettoolbar_color() : Mage::getStoreConfig('prizmcloud/settings/toolbar_color');
37
+ $toolbar_color = ($toolbar_color) ? '&toolbar_color='.$toolbar_color : '';
38
+ $url = $url_base . $pkey . '&viewertype=' . $ptype . '&document=' . $doc_url . $vheight . $vwidth . '&printButton=' . $print_button . $toolbar_color;
39
+ $iframe = '<iframe src="' . $url . '"' . $iwidth . $iheight . 'id="prizmcloud_docs_iframe" class="prizmcloud_iframe" seamless></iframe>';
40
+ $html .= $iframe;
41
+ }
42
+ else
43
+ {
44
+ $html .= '<p class="error">Please sign up for an account to use PrizmCloud Document Viewer. If you already signed up, add your key via the admin configuration panel. <a href="http://prizmcloud.accusoft.com/register.html" target="_blank" title="PrizmCloud ">Prizm Cloud Sign Up</a> </p>';
45
+ }
46
+ $html .= '</div>';
47
+
48
+ return $html;
49
+ }
50
+ }
app/code/community/Accusoft/Prizmclouddocsviewer/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Accusoft_Prizmclouddocsviewer_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/Accusoft/Prizmclouddocsviewer/Model/prizmclouddocsviewer.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Accusoft_Prizmclouddocsviewer_Model_Prizmclouddocsviewer extends Mage_Core_Model_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('prizmclouddocsviewer/prizmclouddocsviewer');
8
+ }
9
+ }
app/code/community/Accusoft/Prizmclouddocsviewer/etc/adminhtml.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <prizmcloud translate="title">
15
+ <title>PrizmCloud</title>
16
+ <sort_order>100</sort_order>
17
+ </prizmcloud>
18
+ </children>
19
+ </config>
20
+ </children>
21
+ </system>
22
+ </children>
23
+ </admin>
24
+ </resources>
25
+ </acl>
26
+ </config>
app/code/community/Accusoft/Prizmclouddocsviewer/etc/config.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Accusoft_Prizmclouddocsviewer>
5
+ <version>0.1.0</version>
6
+ </Accusoft_Prizmclouddocsviewer>
7
+ </modules>
8
+
9
+ <global>
10
+ <blocks>
11
+ <accusoft_prizmclouddocsviewer>
12
+ <class>Accusoft_Prizmclouddocsviewer_Block</class>
13
+ </accusoft_prizmclouddocsviewer>
14
+ </blocks>
15
+
16
+ <models>
17
+ <accusoft_prizmclouddocsviewer>
18
+ <class>Accusoft_Prizmclouddocsviewer_Model</class>
19
+ </accusoft_prizmclouddocsviewer>
20
+ <prizmclouddocsviewer_resource>
21
+ <class>Accusoft_Prizmclouddocsviewer_Model_Resources</class>
22
+ <entities>
23
+ <prizmclouddocsviewer>
24
+ <table>accusoft_prizmclouddocsviewer</table>
25
+ </prizmclouddocsviewer>
26
+ </entities>
27
+ </prizmclouddocsviewer_resource>
28
+ <prizmclouddocsviewer_adminhtml>
29
+ <class>Accusoft_Prizmclouddocsviewer_Adminhtml_Model</class>
30
+ </prizmclouddocsviewer_adminhtml>
31
+ </models>
32
+ <helpers>
33
+ <prizmclouddocsviewer>
34
+ <class>Accusoft_Prizmclouddocsviewer_Helper</class>
35
+ </prizmclouddocsviewer>
36
+ </helpers>
37
+ </global>
38
+
39
+ <adminhtml>
40
+ </adminhtml>
41
+ <default>
42
+ <prizmcloud>
43
+ <settings>
44
+ <toolbar_color>CCCCCC</toolbar_color>
45
+ </settings>
46
+ </prizmcloud>
47
+ </default>
48
+ </config>
app/code/community/Accusoft/Prizmclouddocsviewer/etc/system.xml ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <prizmcloud translate="label">
5
+ <label>Prizm Cloud Document Viewer</label>
6
+ <tab>general</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>1000</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <settings translate="label">
14
+ <label>Settings</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>1</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>1</show_in_website>
19
+ <show_in_store>1</show_in_store>
20
+ <expanded>1</expanded>
21
+ <fields>
22
+ <pkey translate="label,comment">
23
+ <label>Key</label>
24
+ <comment><![CDATA[Please <a href="http://prizmcloud.accusoft.com/register.html" target="_blank" title="PrizmCloud ">sign up</a> for an account and copy your key to this field. This is required to use this document viewer.]]></comment>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>1</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </pkey>
31
+ <ptype translate="label">
32
+ <label>Viewer type</label>
33
+ <frontend_type>select</frontend_type>
34
+ <source_model>prizmclouddocsviewer_adminhtml/system_config_source_ptype</source_model>
35
+ <sort_order>2</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ </ptype>
40
+ <doc_url translate="label">
41
+ <label>Document Url</label>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>3</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </doc_url>
48
+ <width translate="label">
49
+ <label>Viewer Width (px)</label>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>4</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ </width>
56
+ <height translate="label">
57
+ <label>Viewer Height (px)</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>5</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ </height>
64
+ <print_button translate="label">
65
+ <label>Print Button?</label>
66
+ <frontend_type>select</frontend_type>
67
+ <source_model>adminhtml/system_config_source_yesno</source_model>
68
+ <sort_order>6</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </print_button>
73
+ <toolbar_color translate="label">
74
+ <label>Toolbar Color</label>
75
+ <frontend_type>text</frontend_type>
76
+ <sort_order>7</sort_order>
77
+ <show_in_default>1</show_in_default>
78
+ <show_in_website>1</show_in_website>
79
+ <show_in_store>1</show_in_store>
80
+ </toolbar_color>
81
+ </fields>
82
+ </settings>
83
+ </groups>
84
+ </prizmcloud>
85
+ </sections>
86
+ </config>
app/code/community/Accusoft/Prizmclouddocsviewer/sql/Prizmclouddocsviewer_setup/install-0.1.0.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Accusoft PrizmCloud installation script
3
+ *
4
+ * @author Accusoft
5
+ */
6
+
7
+ /*
8
+ * @var $installer Mage_Core_Model_Resources_Setup
9
+ */
10
+ $installer = $this;
11
+
12
+ $table = $installer->getConnection()
13
+ ->newTable($installer->getTable('prizmclouddocsviewer'))
14
+ ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
15
+ 'unsigned' => true,
16
+ 'identity' => true,
17
+ 'nullable' => false,
18
+ 'primary' => true,
19
+ ), 'Entity id')
20
+ ->addColumn('pkey', Varien_Db_Ddl_Table::TYPE_VARCHAR, 100, array(), 'Key')
21
+ ->addColumn('ptype', Varien_Db_Ddl_Table::TYPE_VARCHAR, 20, array(), 'Type')
22
+ ->addColumn('doc_url', Varien_Db_Ddl_Table::TYPE_TVARCHAR, 255, array(), 'Key')
23
+ ->addColumn('width', Varien_Db_Ddl_Table::INTEGER, 5, array(), 'Key')
24
+ ->addColumn('height', Varien_Db_Ddl_Table::TYPE_INTEGER, 5, array(), 'Key')
25
+ ->addColumn('print_button', Varien_Db_Ddl_Table::TYPE_BOOLEAN, 1, array(), 'Key')
26
+ ->addColumn('toolbar_color', Varien_Db_Ddl_Table::TYPE_VARCHAR, 7, array(), 'Key');
27
+
28
+ $installer->getConnection()->createTable($table);
app/code/community/Accusoft/Prizmclouddocsviewer/sql/Prizmclouddocsviewer_setup/mysql4-install-0.1.0 ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // draft - http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {groupdocsv};
10
+ CREATE TABLE IF NOT EXISTS `groupdocsv` (
11
+ `id` int(11) NOT NULL AUTO_INCREMENT,
12
+ `date_entered` datetime DEFAULT NULL,
13
+ `date_modified` datetime DEFAULT NULL,
14
+ `modified_user_id` char(36) DEFAULT NULL,
15
+ `created_by` char(36) DEFAULT NULL,
16
+ `description` text,
17
+ `active` tinyint(1) DEFAULT '1',
18
+ `client_id` varchar(255) DEFAULT NULL,
19
+ `api_key` varchar(255) DEFAULT NULL,
20
+ `iframe` varchar(255) DEFAULT NULL,
21
+ `file_id` varchar(255) DEFAULT NULL,
22
+ PRIMARY KEY (`id`)
23
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
24
+
25
+ ");
26
+
27
+ $installer->endSetup();
app/etc/modules/Accusoft_Prizmclouddocsviewer.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Accusoft_Prizmclouddocsviewer>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Accusoft_Prizmclouddocsviewer>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Prizm_Cloud_Embedded_Document_Viewer</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>GPL2</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>A document viewer that displays over 300 different kinds of files on your website, no additional software.</summary>
10
+ <description>Prizm Cloud is a document viewer that enables you to display hundreds of different kinds of files on your website without worrying about whether your visitors have the software to view them and without installing any additional hardware or software. The document files stay on your server, so you can update, edit and change them anytime. Prizm Cloud supports more than 300 file types, including DOC, PDF, PPT, XLS and CAD.</description>
11
+ <notes>Initial Release</notes>
12
+ <authors><author><name>Accusoft</name><user>Accusoft</user><email>plugins@prizmcloud.com</email></author></authors>
13
+ <date>2013-06-28</date>
14
+ <time>14:19:14</time>
15
+ <contents><target name="magecommunity"><dir name="Accusoft"><dir name="Prizmclouddocsviewer"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Ptype.php" hash="37aab5199ae6c99466b7cec467b3b40c"/></dir></dir></dir></dir></dir><dir name="Block"><dir name="Adminhtml"><file name="Prizmclouddocsviewer.php" hash="2c66d93d7b8dfabf1a1403bcd18abc1d"/></dir><file name="Viewer.php" hash="b0eea8ebd83c3e891dca389f36d60cc2"/></dir><dir name="Helper"><file name="Data.php" hash="66057cfb95dd43e4faa7e224ae815cab"/></dir><dir name="Model"><file name="prizmclouddocsviewer.php" hash="2798a97fa1836ce53558726f41aa82ab"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a297ac65896cb3925b84c3c23730f76e"/><file name="config.xml" hash="5f68fae783f6d6065fab8329158291e6"/><file name="system.xml" hash="5c00b3ed99624a02d224930f3fdf1a25"/></dir><dir name="sql"><dir name="Prizmclouddocsviewer_setup"><file name="install-0.1.0.php" hash="80509794181e7741898136e8094e0040"/><file name="mysql4-install-0.1.0" hash="ff4a22a88da7623de400f7e5fba97a4e"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Accusoft_Prizmclouddocsviewer.xml" hash="1da3965ca0adb5722b52254378bc99f0"/></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>5.8.0</max></php></required></dependencies>
18
+ </package>