GroupDocsAnnotation - Version 1.0.0

Version Notes

This is the first version of plugin

Download this release

Release Info

Developer Marketplace
Extension GroupDocsAnnotation
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Gda/Groupdocsannotation/Block/Adminhtml/Cms/Page/Edit.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script>
2
+ // Insert GroupDocs File ID at cms edit page
3
+ function gdafileid(){
4
+ var anchor = document.getElementsByTagName("a");
5
+ // Switch the right tab
6
+ for (var i = 0; i < anchor.length; i++){
7
+ if (anchor[i].className.match(/tab-item-link/) || anchor[i].className.match(/tab-item-link active/)){
8
+ if (anchor[i].title!="Content"){
9
+ anchor[i].className ="tab-item-link";
10
+ var tab1 = document.getElementById('page_tabs_main_section_content');
11
+ var tab3 = document.getElementById('page_tabs_design_section_content');
12
+ var tab4 = document.getElementById('page_tabs_meta_section_content');
13
+ tab1.style.display = 'none';
14
+ tab3.style.display = 'none';
15
+ tab4.style.display = 'none';
16
+ } else {
17
+ anchor[i].className ="tab-item-link active";
18
+ var tab2 = document.getElementById('page_tabs_content_section_content');
19
+ tab2.style.display = 'block';
20
+ }
21
+ }
22
+ }
23
+ // Enter GroupDocs File ID
24
+ var ans=prompt('Enter GroupDocs File ID:','');
25
+ if(ans.length<50) { alert('Sorry, but this File ID is too short'); return false; }
26
+ if(ans.length>70) { alert('Sorry, but this File ID is too big'); return false; }
27
+ // all good continue
28
+ var iframe = '<iframe src="https://apps.groupdocs.com/document-annotation/embed/'+ans+'" frameborder="0" width="600" height="400"></iframe>';
29
+ var tinyMceContent = tinyMCE.activeEditor.getContent();
30
+ // set content
31
+ tinyMCE.activeEditor.setContent(tinyMceContent+iframe);
32
+
33
+
34
+ }
35
+ </script>
36
+ <?php
37
+ class Gda_Groupdocsannotation_Block_Adminhtml_Cms_Page_Edit extends Mage_Adminhtml_Block_Cms_Page_Edit {
38
+ public function __construct() {
39
+
40
+ parent::__construct();
41
+
42
+ $this->_addButton('annotation_button_id', array(
43
+ 'label' => Mage::helper('cms')->__('GroupDocs Annotation File ID'),
44
+ 'onclick' => 'gdafileid()',
45
+ 'class' => 'go'
46
+ ), 0, 100, 'footer', 'header');
47
+ }
48
+ }
app/code/local/Gda/Groupdocsannotation/Block/Adminhtml/Groupdocsannotation.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gda_Groupdocsannotation_Block_Adminhtml_Groupdocsannotation extends Mage_Adminhtml_Block_Template {
4
+
5
+
6
+
7
+ }
app/code/local/Gda/Groupdocsannotation/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gda_Groupdocsannotation_Helper_Data extends Mage_Core_Helper_Abstract {
4
+
5
+ }
app/code/local/Gda/Groupdocsannotation/Model/Mysql4/Groupdocsannotation/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gda_Groupdocsannotation_Model_Mysql4_Groupdocsannotation_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('groupdocsannotation/groupdocsannotation');
8
+ }
9
+ }
app/code/local/Gda/Groupdocsannotation/Model/Mysql4/groupdocsannotation.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Gda_Groupdocsannotation_Model_Mysql4_Groupdocsannotation extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('groupdocsannotation/groupdocsannotation', 'id');
7
+ }
8
+ }
app/code/local/Gda/Groupdocsannotation/Model/groupdocsannotation.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Gda_Groupdocsannotation_Model_Groupdocsannotation extends Mage_Core_Model_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('groupdocsannotation/groupdocsannotation');
8
+ }
9
+ }
app/code/local/Gda/Groupdocsannotation/controllers/Adminhtml/ViewerController.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Gda_Groupdocsannotation_Adminhtml_ViewerController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ public $jj;
6
+
7
+ public function indexAction()
8
+ {
9
+ $this->loadLayout();
10
+
11
+ // gether data
12
+ $block = $this->getLayout()->getBlock('viewer');
13
+ // //on initialize la variable
14
+ // $retour = '';
15
+ // /* we are doing the query to select all elements of the pfay_test table (thanks to our model test/test and we sort them by id_pfay_test */
16
+ // $collection = Mage::getModel('groupdocsannotation/groupdocsannotation')->getCollection()
17
+ // ->setOrder('id');
18
+ //
19
+ // /* then, we check the result of the query and with the function getData() */
20
+ // foreach ($collection as $data) {
21
+ // $retour.= $data->getData('id') .' => '. $data->getData('file_id') . '<br />';
22
+ // }
23
+ // $block->setData('doc',$retour);
24
+
25
+ $this->renderLayout();
26
+ }
27
+
28
+ public function postAction()
29
+ {
30
+ $post = $this->getRequest()->getPost();
31
+ try {
32
+ if (empty($post)) {
33
+ Mage::throwException($this->__('Invalid form data.'));
34
+ }
35
+
36
+ /* here's your form processing */
37
+
38
+ $message = $this->__('Your form has been submitted successfully.');
39
+ Mage::getSingleton('adminhtml/session')->addSuccess($message);
40
+ } catch (Exception $e) {
41
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
42
+ }
43
+ $this->_redirect('*/*');
44
+ }
45
+ }
app/code/local/Gda/Groupdocsannotation/etc/config.xml ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Gda_Groupdocsannotation>
5
+ <version>0.1.0</version>
6
+ </Gda_Groupdocsannotation>
7
+ </modules>
8
+
9
+ <global>
10
+
11
+ <blocks>
12
+ <adminhtml>
13
+ <rewrite>
14
+ <cms_page_edit>Gda_Groupdocsannotation_Block_Adminhtml_Cms_Page_Edit</cms_page_edit>
15
+ </rewrite>
16
+ </adminhtml>
17
+ </blocks>
18
+
19
+
20
+ <models>
21
+ <groupdocsannotation>
22
+ <class>Gda_Groupdocsannotation_Model</class>
23
+ <resourceModel>groupdocsannotation_mysql4</resourceModel>
24
+ </groupdocsannotation>
25
+ <groupdocsannotation_mysql4>
26
+ <class>Gda_Groupdocsannotation_Model_Mysql4</class>
27
+ <entities>
28
+ <groupdocsannotation>
29
+ <table>groupdocsv</table>
30
+ </groupdocsannotation>
31
+ </entities>
32
+ </groupdocsannotation_mysql4>
33
+ </models>
34
+ <resources>
35
+ <groupdocsannotation_write>
36
+ <connection>
37
+ <use>core_write</use>
38
+ </connection>
39
+ </groupdocsannotation_write>
40
+
41
+ <groupdocsannotation_read>
42
+ <connection>
43
+ <use>core_read</use>
44
+ </connection>
45
+ </groupdocsannotation_read>
46
+
47
+ <groupdocsannotation_delete>
48
+ <connection>
49
+ <use>core_delete</use>
50
+ </connection>
51
+ </groupdocsannotation_delete>
52
+ </resources>
53
+
54
+
55
+
56
+
57
+
58
+ <blocks>
59
+ <groupdocsannotation>
60
+ <class>Gda_Groupdocsannotation_Block</class>
61
+ </groupdocsannotation>
62
+ </blocks>
63
+ <helpers>
64
+ <groupdocsannotation>
65
+ <class>Gda_Groupdocsannotation_Helper</class>
66
+ </groupdocsannotation>
67
+ </helpers>
68
+ </global>
69
+
70
+ <admin>
71
+ <routers>
72
+ <groupdocsannotation>
73
+ <use>admin</use>
74
+ <args>
75
+ <module>Gda_Groupdocsannotation</module>
76
+ <frontName>groupdocsannotation</frontName>
77
+ </args>
78
+ </groupdocsannotation>
79
+ </routers>
80
+ </admin>
81
+
82
+ <adminhtml>
83
+
84
+ <menu>
85
+ <catalog>
86
+ <children>
87
+ <groupdocsannotation_adminform translate="title" module="groupdocsannotation">
88
+ <title>Groupdocs Anotation</title>
89
+ <action>groupdocsannotation/adminhtml_viewer</action>
90
+ </groupdocsannotation_adminform>
91
+ </children>
92
+ </catalog>
93
+ </menu>
94
+
95
+ <acl>
96
+ <resources>
97
+ <admin>
98
+ <children>
99
+ <catalog>
100
+ <children>
101
+ <groupdocsannotation_adminform>
102
+ <title>Groupdocs Anotation</title>
103
+ </groupdocsannotation_adminform>
104
+ </children>
105
+ </catalog>
106
+ </children>
107
+ </admin>
108
+ </resources>
109
+ </acl>
110
+
111
+ <layout>
112
+ <updates>
113
+ <groupdocsannotation>
114
+ <file>groupdocsannotation.xml</file>
115
+ </groupdocsannotation>
116
+ </updates>
117
+ </layout>
118
+ </adminhtml>
119
+ </config>
app/code/local/Gda/Groupdocsannotation/sql/Groupdocsannotation_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 {groupdocsa};
10
+ CREATE TABLE IF NOT EXISTS `groupdocsa` (
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/Gda_Groupdocsannotation.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Gda_Groupdocsannotation>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Gda_Groupdocsannotation>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>GroupDocsAnnotation</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>GroupDocs Annotation allow to view and annotate documents and images from GroupDocs Account</summary>
10
+ <description>GroupDocs Annotation allow to view and annotate documents and images from GroupDocs Account. Functionalities like File Upload and GroupDocs Acc. File Browsing avalible from "ver. 1.3". &#xD;
11
+ GroupDocs is a next generation Document Management solution that makes it easier for businesses to collaborate, share and work with documents online. So, organise, view, annotate, compare, assemble and share all your documents with Magento&#xD;
12
+ For more details go to: http://groupdocs.com</description>
13
+ <notes>This is the first version of plugin</notes>
14
+ <authors><author><name>Marketplace</name><user>groupdocs</user><email>support@groupdocs.com</email></author></authors>
15
+ <date>2012-11-26</date>
16
+ <time>06:50:17</time>
17
+ <contents><target name="magelocal"><dir><dir name="Gda"><dir name="Groupdocsannotation"><dir name="Block"><dir name="Adminhtml"><file name="Groupdocsannotation.php" hash="8a8a709a7a43f13abea6062830903a82"/><dir name="Cms"><dir name="Page"><file name="Edit.php" hash="932efec00043beda371bac70f96c2b89"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ViewerController.php" hash="5fee77f4fa3fb5de83ad8582d4fc8f3a"/></dir></dir><dir name="etc"><file name="config.xml" hash="fe330fab17c370936e182b8c6e87130a"/></dir><dir name="Helper"><file name="Data.php" hash="5f30d82096dc6053d5a380d9916fa448"/></dir><dir name="Model"><dir name="Mysql4"><file name="groupdocsannotation.php" hash="4362cd11eb1a124f6576946530e7f95c"/><file name="groupdocsannotation.php" hash="4362cd11eb1a124f6576946530e7f95c"/><dir name="Groupdocsannotation"><file name="Collection.php" hash="1605eccfdf2256de3ad8c74920ca4410"/></dir></dir><file name="groupdocsannotation.php" hash="75092db6c48c719265eaf2f170d36da7"/></dir><dir name="sql"><dir name="Groupdocsannotation_setup"><file name="mysql4-install-0.1.0" hash="93af873794fedc03517b63fa587ef64b"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Gda_Groupdocsannotation.xml" hash="973c8babff9adb5a0e01bf21b1fef4a9"/></dir></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.3.0</min><max>5.4.8</max></php></required></dependencies>
20
+ </package>