Version Notes
Updated version
Download this release
Release Info
Developer | Marketplace |
Extension | GroupDocsViewer |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- app/code/local/Gdv/Groupdocsviewer/Block/Adminhtml/Cms/Page/Edit.php +48 -0
- app/code/local/Gdv/Groupdocsviewer/Block/Adminhtml/Groupdocsviewer.php +7 -0
- app/code/local/Gdv/Groupdocsviewer/Helper/Data.php +5 -0
- app/code/local/Gdv/Groupdocsviewer/Model/Mysql4/Groupdocsviewer/Collection.php +9 -0
- app/code/local/Gdv/Groupdocsviewer/Model/Mysql4/groupdocsviewer.php +8 -0
- app/code/local/Gdv/Groupdocsviewer/Model/groupdocsviewer.php +9 -0
- app/code/local/Gdv/Groupdocsviewer/controllers/Adminhtml/ViewerController.php +45 -0
- app/code/local/Gdv/Groupdocsviewer/etc/config.xml +119 -0
- app/code/local/Gdv/Groupdocsviewer/sql/Groupdocsviewer_setup/mysql4-install-0.1.0 +27 -0
- app/etc/modules/Gdv_Groupdocsviewer.xml +9 -0
- package.xml +5 -5
app/code/local/Gdv/Groupdocsviewer/Block/Adminhtml/Cms/Page/Edit.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script>
|
2 |
+
// Insert GroupDocs File ID at cms edit page
|
3 |
+
function gdfileid(){
|
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-viewer/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 Gdv_Groupdocsviewer_Block_Adminhtml_Cms_Page_Edit extends Mage_Adminhtml_Block_Cms_Page_Edit {
|
38 |
+
public function __construct() {
|
39 |
+
|
40 |
+
parent::__construct();
|
41 |
+
|
42 |
+
$this->_addButton('button_id', array(
|
43 |
+
'label' => Mage::helper('cms')->__('GroupDocs File ID'),
|
44 |
+
'onclick' => 'gdfileid()',
|
45 |
+
'class' => 'go'
|
46 |
+
), 0, 100, 'footer', 'header');
|
47 |
+
}
|
48 |
+
}
|
app/code/local/Gdv/Groupdocsviewer/Block/Adminhtml/Groupdocsviewer.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Gdv_Groupdocsviewer_Block_Adminhtml_Groupdocsviewer extends Mage_Adminhtml_Block_Template {
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
}
|
app/code/local/Gdv/Groupdocsviewer/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Gdv_Groupdocsviewer_Helper_Data extends Mage_Core_Helper_Abstract {
|
4 |
+
|
5 |
+
}
|
app/code/local/Gdv/Groupdocsviewer/Model/Mysql4/Groupdocsviewer/Collection.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Gdv_Groupdocsviewer_Model_Mysql4_Groupdocsviewer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('groupdocsviewer/groupdocsviewer');
|
8 |
+
}
|
9 |
+
}
|
app/code/local/Gdv/Groupdocsviewer/Model/Mysql4/groupdocsviewer.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Gdv_Groupdocsviewer_Model_Mysql4_Groupdocsviewer extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('groupdocsviewer/groupdocsviewer', 'id');
|
7 |
+
}
|
8 |
+
}
|
app/code/local/Gdv/Groupdocsviewer/Model/groupdocsviewer.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Gdv_Groupdocsviewer_Model_Groupdocsviewer extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('groupdocsviewer/groupdocsviewer');
|
8 |
+
}
|
9 |
+
}
|
app/code/local/Gdv/Groupdocsviewer/controllers/Adminhtml/ViewerController.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Gdv_Groupdocsviewer_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('groupdocsviewer/groupdocsviewer')->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/Gdv/Groupdocsviewer/etc/config.xml
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Gdv_Groupdocsviewer>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Gdv_Groupdocsviewer>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
|
11 |
+
<blocks>
|
12 |
+
<adminhtml>
|
13 |
+
<rewrite>
|
14 |
+
<cms_page_edit>Gdv_Groupdocsviewer_Block_Adminhtml_Cms_Page_Edit</cms_page_edit>
|
15 |
+
</rewrite>
|
16 |
+
</adminhtml>
|
17 |
+
</blocks>
|
18 |
+
|
19 |
+
|
20 |
+
<models>
|
21 |
+
<groupdocsviewer>
|
22 |
+
<class>Gdv_Groupdocsviewer_Model</class>
|
23 |
+
<resourceModel>groupdocsviewer_mysql4</resourceModel>
|
24 |
+
</groupdocsviewer>
|
25 |
+
<groupdocsviewer_mysql4>
|
26 |
+
<class>Gdv_Groupdocsviewer_Model_Mysql4</class>
|
27 |
+
<entities>
|
28 |
+
<groupdocsviewer>
|
29 |
+
<table>groupdocsv</table>
|
30 |
+
</groupdocsviewer>
|
31 |
+
</entities>
|
32 |
+
</groupdocsviewer_mysql4>
|
33 |
+
</models>
|
34 |
+
<resources>
|
35 |
+
<groupdocsviewer_write>
|
36 |
+
<connection>
|
37 |
+
<use>core_write</use>
|
38 |
+
</connection>
|
39 |
+
</groupdocsviewer_write>
|
40 |
+
|
41 |
+
<groupdocsviewer_read>
|
42 |
+
<connection>
|
43 |
+
<use>core_read</use>
|
44 |
+
</connection>
|
45 |
+
</groupdocsviewer_read>
|
46 |
+
|
47 |
+
<groupdocsviewer_delete>
|
48 |
+
<connection>
|
49 |
+
<use>core_delete</use>
|
50 |
+
</connection>
|
51 |
+
</groupdocsviewer_delete>
|
52 |
+
</resources>
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
<blocks>
|
59 |
+
<groupdocsviewer>
|
60 |
+
<class>Gdv_Groupdocsviewer_Block</class>
|
61 |
+
</groupdocsviewer>
|
62 |
+
</blocks>
|
63 |
+
<helpers>
|
64 |
+
<groupdocsviewer>
|
65 |
+
<class>Gdv_Groupdocsviewer_Helper</class>
|
66 |
+
</groupdocsviewer>
|
67 |
+
</helpers>
|
68 |
+
</global>
|
69 |
+
|
70 |
+
<admin>
|
71 |
+
<routers>
|
72 |
+
<groupdocsviewer>
|
73 |
+
<use>admin</use>
|
74 |
+
<args>
|
75 |
+
<module>Gdv_Groupdocsviewer</module>
|
76 |
+
<frontName>groupdocsviewer</frontName>
|
77 |
+
</args>
|
78 |
+
</groupdocsviewer>
|
79 |
+
</routers>
|
80 |
+
</admin>
|
81 |
+
|
82 |
+
<adminhtml>
|
83 |
+
|
84 |
+
<menu>
|
85 |
+
<catalog>
|
86 |
+
<children>
|
87 |
+
<groupdocsviewer_adminform translate="title" module="groupdocsviewer">
|
88 |
+
<title>Groupdocs Viewer</title>
|
89 |
+
<action>groupdocsviewer/adminhtml_viewer</action>
|
90 |
+
</groupdocsviewer_adminform>
|
91 |
+
</children>
|
92 |
+
</catalog>
|
93 |
+
</menu>
|
94 |
+
|
95 |
+
<acl>
|
96 |
+
<resources>
|
97 |
+
<admin>
|
98 |
+
<children>
|
99 |
+
<catalog>
|
100 |
+
<children>
|
101 |
+
<groupdocsviewer_adminform>
|
102 |
+
<title>Groupdocs Viewer</title>
|
103 |
+
</groupdocsviewer_adminform>
|
104 |
+
</children>
|
105 |
+
</catalog>
|
106 |
+
</children>
|
107 |
+
</admin>
|
108 |
+
</resources>
|
109 |
+
</acl>
|
110 |
+
|
111 |
+
<layout>
|
112 |
+
<updates>
|
113 |
+
<groupdocsviewer>
|
114 |
+
<file>groupdocsviewer.xml</file>
|
115 |
+
</groupdocsviewer>
|
116 |
+
</updates>
|
117 |
+
</layout>
|
118 |
+
</adminhtml>
|
119 |
+
</config>
|
app/code/local/Gdv/Groupdocsviewer/sql/Groupdocsviewer_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/Gdv_Groupdocsviewer.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Gdv_Groupdocsviewer>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Gdv_Groupdocsviewer>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>GroupDocsViewer</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
@@ -10,11 +10,11 @@
|
|
10 |
<description>GroupDocs Viewer allow to view documents and images from GroupDocs Account. Functionalities like File Upload and GroupDocs Acc. File Browsing avalible from "ver. 1.3". 
|
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
|
12 |
For more details go to: http://groupdocs.com</description>
|
13 |
-
<notes>
|
14 |
<authors><author><name>Marketplace</name><user>groupdocs</user><email>support@groupdocs.com</email></author></authors>
|
15 |
<date>2012-11-09</date>
|
16 |
-
<time>
|
17 |
-
<contents><target name="magelocal"><dir name="
|
18 |
<compatible/>
|
19 |
-
<dependencies><required><php><min>5.3.0</min><max>5.4.8</max></php
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>GroupDocsViewer</name>
|
4 |
+
<version>1.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
10 |
<description>GroupDocs Viewer allow to view documents and images from GroupDocs Account. Functionalities like File Upload and GroupDocs Acc. File Browsing avalible from "ver. 1.3". 
|
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
|
12 |
For more details go to: http://groupdocs.com</description>
|
13 |
+
<notes>Updated version</notes>
|
14 |
<authors><author><name>Marketplace</name><user>groupdocs</user><email>support@groupdocs.com</email></author></authors>
|
15 |
<date>2012-11-09</date>
|
16 |
+
<time>13:13:36</time>
|
17 |
+
<contents><target name="magelocal"><dir><dir name="Gdv"><dir name="Groupdocsviewer"><dir name="Block"><dir name="Adminhtml"><file name="Groupdocsviewer.php" hash="2ab98ae44c640a6f6db59b4d67c4f9aa"/><dir name="Cms"><dir name="Page"><file name="Edit.php" hash="68e60b50525d06da6d04a2a3504f9140"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ViewerController.php" hash="8581889e732003b55a0a1d5cbc9ee9df"/></dir></dir><dir name="etc"><file name="config.xml" hash="d72d6a96b8bc3dcc1c09a7331f0db05f"/></dir><dir name="Helper"><file name="Data.php" hash="6bc4a4889980f633b47a37cb16d699d0"/></dir><dir name="Model"><file name="groupdocsviewer.php" hash="a8bf450c76627f2f99d47dab7ce4dd8d"/><dir name="Mysql4"><file name="groupdocsviewer.php" hash="1522ec3ddecaf1bdaee7cb22bd51af72"/><dir name="Groupdocsviewer"><file name="Collection.php" hash="5909054d74e838e456240e0c56563999"/></dir></dir></dir><dir name="sql"><dir name="Groupdocsviewer_setup"><file name="mysql4-install-0.1.0" hash="ff4a22a88da7623de400f7e5fba97a4e"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Gdv_Groupdocsviewer.xml" hash="e7ed6019781839f87c6066c82300470c"/></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>
|