LinkDirectory - Version 0.1.0

Version Notes

Versioin 0.1.0

Download this release

Release Info

Developer Magento Core Team
Extension LinkDirectory
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (28) hide show
  1. app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory.php +12 -0
  2. app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit.php +45 -0
  3. app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit/Form.php +19 -0
  4. app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit/Tab/Form.php +58 -0
  5. app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit/Tabs.php +24 -0
  6. app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Grid.php +116 -0
  7. app/code/community/Magestore/Linkdirectory/Block/Linkdirectory.php +85 -0
  8. app/code/community/Magestore/Linkdirectory/Helper/Data.php +298 -0
  9. app/code/community/Magestore/Linkdirectory/Model/Category.php +39 -0
  10. app/code/community/Magestore/Linkdirectory/Model/Linkdirectory.php +38 -0
  11. app/code/community/Magestore/Linkdirectory/Model/Mysql4/Linkdirectory.php +11 -0
  12. app/code/community/Magestore/Linkdirectory/Model/Mysql4/Linkdirectory/Collection.php +10 -0
  13. app/code/community/Magestore/Linkdirectory/Model/Status.php +15 -0
  14. app/code/community/Magestore/Linkdirectory/controllers/Adminhtml/LinkdirectoryController.php +214 -0
  15. app/code/community/Magestore/Linkdirectory/controllers/IndexController.php +45 -0
  16. app/code/community/Magestore/Linkdirectory/controllers/InterfaceController.php +104 -0
  17. app/code/community/Magestore/Linkdirectory/controllers/TestController.php +106 -0
  18. app/code/community/Magestore/Linkdirectory/etc/config.xml +147 -0
  19. app/code/community/Magestore/Linkdirectory/etc/system.xml +153 -0
  20. app/code/community/Magestore/Linkdirectory/sql/linkdirectory_setup/mysql4-install-0.1.0.php +1 -0
  21. app/design/adminhtml/default/default/layout/linkdirectory.xml +15 -0
  22. app/design/frontend/default/default/layout/linkdirectory.xml +30 -0
  23. app/design/frontend/default/default/template/linkdirectory/linkdirectory.phtml +11 -0
  24. app/design/frontend/default/default/template/linkdirectory/view.phtml +8 -0
  25. app/etc/modules/Magestore_Linkdirectory.xml +9 -0
  26. package.xml +18 -0
  27. skin/adminhtml/default/default/css/magestore/linkdirectory.css +33 -0
  28. skin/frontend/default/default/css/magestore/linkdirectory.css +112 -0
app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Magestore_Linkdirectory_Block_Adminhtml_Linkdirectory extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_linkdirectory';
7
+ $this->_blockGroup = 'linkdirectory';
8
+ $this->_headerText = Mage::helper('linkdirectory')->__('Item Manager');
9
+ $this->_addButtonLabel = Mage::helper('linkdirectory')->__('Add Item');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Block_Adminhtml_Linkdirectory_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'linkdirectory';
11
+ $this->_controller = 'adminhtml_linkdirectory';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('linkdirectory')->__('Save Item'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('linkdirectory')->__('Delete Item'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+
22
+ $this->_formScripts[] = "
23
+ function toggleEditor() {
24
+ if (tinyMCE.getInstanceById('linkdirectory_content') == null) {
25
+ tinyMCE.execCommand('mceAddControl', false, 'linkdirectory_content');
26
+ } else {
27
+ tinyMCE.execCommand('mceRemoveControl', false, 'linkdirectory_content');
28
+ }
29
+ }
30
+
31
+ function saveAndContinueEdit(){
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ ";
35
+ }
36
+
37
+ public function getHeaderText()
38
+ {
39
+ if( Mage::registry('linkdirectory_data') && Mage::registry('linkdirectory_data')->getId() ) {
40
+ return Mage::helper('linkdirectory')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('linkdirectory_data')->getTitle()));
41
+ } else {
42
+ return Mage::helper('linkdirectory')->__('Add Item');
43
+ }
44
+ }
45
+ }
app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Block_Adminhtml_Linkdirectory_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit/Tab/Form.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Block_Adminhtml_Linkdirectory_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset('linkdirectory_form', array('legend'=>Mage::helper('linkdirectory')->__('Item information')));
10
+
11
+ $fieldset->addField('title', 'text', array(
12
+ 'label' => Mage::helper('linkdirectory')->__('Title'),
13
+ 'class' => 'required-entry',
14
+ 'required' => true,
15
+ 'name' => 'title',
16
+ ));
17
+
18
+ $fieldset->addField('filename', 'file', array(
19
+ 'label' => Mage::helper('linkdirectory')->__('File'),
20
+ 'required' => false,
21
+ 'name' => 'filename',
22
+ ));
23
+
24
+ $fieldset->addField('status', 'select', array(
25
+ 'label' => Mage::helper('linkdirectory')->__('Status'),
26
+ 'name' => 'status',
27
+ 'values' => array(
28
+ array(
29
+ 'value' => 1,
30
+ 'label' => Mage::helper('linkdirectory')->__('Enabled'),
31
+ ),
32
+
33
+ array(
34
+ 'value' => 2,
35
+ 'label' => Mage::helper('linkdirectory')->__('Disabled'),
36
+ ),
37
+ ),
38
+ ));
39
+
40
+ $fieldset->addField('content', 'editor', array(
41
+ 'name' => 'content',
42
+ 'label' => Mage::helper('linkdirectory')->__('Content'),
43
+ 'title' => Mage::helper('linkdirectory')->__('Content'),
44
+ 'style' => 'width:700px; height:500px;',
45
+ 'wysiwyg' => false,
46
+ 'required' => true,
47
+ ));
48
+
49
+ if ( Mage::getSingleton('adminhtml/session')->getLinkdirectoryData() )
50
+ {
51
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getLinkdirectoryData());
52
+ Mage::getSingleton('adminhtml/session')->setLinkdirectoryData(null);
53
+ } elseif ( Mage::registry('linkdirectory_data') ) {
54
+ $form->setValues(Mage::registry('linkdirectory_data')->getData());
55
+ }
56
+ return parent::_prepareForm();
57
+ }
58
+ }
app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Block_Adminhtml_Linkdirectory_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('linkdirectory_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('linkdirectory')->__('Item Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('linkdirectory')->__('Item Information'),
18
+ 'title' => Mage::helper('linkdirectory')->__('Item Information'),
19
+ 'content' => $this->getLayout()->createBlock('linkdirectory/adminhtml_linkdirectory_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/community/Magestore/Linkdirectory/Block/Adminhtml/Linkdirectory/Grid.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Block_Adminhtml_Linkdirectory_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('linkdirectoryGrid');
9
+ $this->setDefaultSort('linkdirectory_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('linkdirectory/linkdirectory')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('linkdirectory_id', array(
24
+ 'header' => Mage::helper('linkdirectory')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'linkdirectory_id',
28
+ ));
29
+
30
+ $this->addColumn('title', array(
31
+ 'header' => Mage::helper('linkdirectory')->__('Title'),
32
+ 'align' =>'left',
33
+ 'index' => 'title',
34
+ ));
35
+
36
+ /*
37
+ $this->addColumn('content', array(
38
+ 'header' => Mage::helper('linkdirectory')->__('Item Content'),
39
+ 'width' => '150px',
40
+ 'index' => 'content',
41
+ ));
42
+ */
43
+
44
+ $this->addColumn('status', array(
45
+ 'header' => Mage::helper('linkdirectory')->__('Status'),
46
+ 'align' => 'left',
47
+ 'width' => '80px',
48
+ 'index' => 'status',
49
+ 'type' => 'options',
50
+ 'options' => array(
51
+ 1 => 'Enabled',
52
+ 2 => 'Disabled',
53
+ ),
54
+ ));
55
+
56
+ $this->addColumn('action',
57
+ array(
58
+ 'header' => Mage::helper('linkdirectory')->__('Action'),
59
+ 'width' => '100',
60
+ 'type' => 'action',
61
+ 'getter' => 'getId',
62
+ 'actions' => array(
63
+ array(
64
+ 'caption' => Mage::helper('linkdirectory')->__('Edit'),
65
+ 'url' => array('base'=> '*/*/edit'),
66
+ 'field' => 'id'
67
+ )
68
+ ),
69
+ 'filter' => false,
70
+ 'sortable' => false,
71
+ 'index' => 'stores',
72
+ 'is_system' => true,
73
+ ));
74
+
75
+ $this->addExportType('*/*/exportCsv', Mage::helper('linkdirectory')->__('CSV'));
76
+ $this->addExportType('*/*/exportXml', Mage::helper('linkdirectory')->__('XML'));
77
+
78
+ return parent::_prepareColumns();
79
+ }
80
+
81
+ protected function _prepareMassaction()
82
+ {
83
+ $this->setMassactionIdField('linkdirectory_id');
84
+ $this->getMassactionBlock()->setFormFieldName('linkdirectory');
85
+
86
+ $this->getMassactionBlock()->addItem('delete', array(
87
+ 'label' => Mage::helper('linkdirectory')->__('Delete'),
88
+ 'url' => $this->getUrl('*/*/massDelete'),
89
+ 'confirm' => Mage::helper('linkdirectory')->__('Are you sure?')
90
+ ));
91
+
92
+ $statuses = Mage::getSingleton('linkdirectory/status')->getOptionArray();
93
+
94
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
95
+ $this->getMassactionBlock()->addItem('status', array(
96
+ 'label'=> Mage::helper('linkdirectory')->__('Change status'),
97
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
+ 'additional' => array(
99
+ 'visibility' => array(
100
+ 'name' => 'status',
101
+ 'type' => 'select',
102
+ 'class' => 'required-entry',
103
+ 'label' => Mage::helper('linkdirectory')->__('Status'),
104
+ 'values' => $statuses
105
+ )
106
+ )
107
+ ));
108
+ return $this;
109
+ }
110
+
111
+ public function getRowUrl($row)
112
+ {
113
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
+ }
115
+
116
+ }
app/code/community/Magestore/Linkdirectory/Block/Linkdirectory.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Magestore_Linkdirectory_Block_Linkdirectory extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getLinkdirectory()
10
+ {
11
+ $link_id = $this->getRequest()->getParam('id');
12
+
13
+ $link = Mage::getModel('linkdirectory/linkdirectory')->load($link_id);
14
+
15
+ return $link->getData();
16
+ }
17
+
18
+ public function getListLinkHTML()
19
+ {
20
+ if(! intval(Mage::getStoreConfig('linkdirectory/general/customer_enabled')))
21
+ {
22
+ return;
23
+ }
24
+
25
+ $data = $this->getRequest()->getPost();
26
+
27
+ // prepare data to send
28
+ if($this->getRequest()->getParam('title'))
29
+ $data['title'] = $this->getRequest()->getParam('title');
30
+
31
+ if($this->getRequest()->getParam('tag'))
32
+ $data['tag'] = $this->getRequest()->getParam('tag');
33
+
34
+ if($this->getRequest()->getParam('category'))
35
+ {
36
+ $listCategory = Mage::getModel('linkdirectory/category')->toOptionArray();
37
+ foreach($listCategory as $cat)
38
+ {
39
+ if(Mage::helper('linkdirectory')->refineString($cat['label']) == $this->getRequest()->getParam('category'))
40
+ $data['category_id'] = $cat['value'];
41
+ }
42
+ }
43
+ if($this->getRequest()->getParam('begin'))
44
+ $data['begin'] = $this->getRequest()->getParam('begin');
45
+
46
+ $data['base_url'] = Mage::getBaseUrl();
47
+
48
+ $data['code_authentication'] = Mage::helper('linkdirectory')->getCodeAuthentication();
49
+
50
+ //prepare url
51
+ $url = Mage::helper('linkdirectory')->getServerUrl();
52
+
53
+ $url .= '/linkdirectory/service/getHtmlLinks';
54
+
55
+ Mage::helper('linkdirectory')->sendDataToUrl($data,$url);
56
+ }
57
+
58
+ public function getLinkDetailHTML()
59
+ {
60
+ if(! intval(Mage::getStoreConfig('linkdirectory/general/customer_enabled')))
61
+ {
62
+ return;
63
+ }
64
+
65
+ $link = $this->getRequest()->getParam('link');
66
+
67
+ if(!$link)
68
+ {
69
+ return;
70
+ }
71
+
72
+ $url = Mage::helper('linkdirectory')->getServerUrl();
73
+
74
+ $url .= '/linkdirectory/service/getLinkDetailHTML';
75
+
76
+ $data['base_url'] = Mage::getBaseUrl();
77
+
78
+ $data['refine_url_view'] = $link;
79
+
80
+ $data['code_authentication'] = Mage::helper('linkdirectory')->getCodeAuthentication();
81
+
82
+ Mage::helper('linkdirectory')->sendDataToUrl($data,$url);
83
+ }
84
+
85
+ }
app/code/community/Magestore/Linkdirectory/Helper/Data.php ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ public function getDataToSend()
6
+ {
7
+ $data = Mage::getStoreConfig('linkdirectory/general');
8
+
9
+ $data['base_url'] = Mage::getBaseUrl();
10
+
11
+ if (isset($_SERVER['HTTP_REFERER']))
12
+ {
13
+ $data['ip_address']= $_SERVER['REMOTE_ADDR'];
14
+ }
15
+
16
+ return $data;
17
+ }
18
+
19
+
20
+ public function incClicks($refine_url_update,$url_request)
21
+ {
22
+ try{
23
+ $send_data['base_url'] = Mage::getBaseUrl();
24
+
25
+ $send_data['refine_url_update'] = $refine_url_update;
26
+
27
+ $send_data['url_request'] = $url_request;
28
+
29
+ $send_data['code_authentication'] = $this->getCodeAuthentication();
30
+
31
+ $url = $this->getServerUrl();
32
+
33
+ $url .= '/linkdirectory/service/incClicks';
34
+
35
+ $this->sendDataToUrl($send_data,$url);
36
+
37
+ } catch(Exception $e) {
38
+
39
+ }
40
+ }
41
+
42
+ public function getMetaContent($refine_url_view)
43
+ {
44
+ $url = $this->getServerUrl();
45
+
46
+ $url .= '/linkdirectory/service/getMeta/refine_url_view/'. $refine_url_view;
47
+
48
+ try{
49
+ $metas = file_get_contents($url);
50
+
51
+ return $metas;
52
+
53
+ } catch(Exception $e) {
54
+
55
+ return;
56
+ }
57
+ }
58
+
59
+ public function sendClientDataToServer($data)
60
+ {
61
+ try{
62
+ $url = $this->getServerUrl();
63
+
64
+ $url .= '/linkdirectory/service/saveSiteInfo/';
65
+
66
+ $code_authentication = $this->getCodeAuthentication();
67
+
68
+ $data['code_authentication'] = $code_authentication . '';
69
+
70
+ $this->sendDataToUrl($data,$url);
71
+
72
+ } catch(Exception $e) {
73
+
74
+ }
75
+ }
76
+
77
+ public function getConfigXML()
78
+ {
79
+ $config_path = Mage::getBaseDir('code') . DS .'community'. DS .'Magestore'. DS .'Linkdirectory'. DS .'etc'. DS . 'config.xml';
80
+
81
+ try {
82
+ chmod($config_path,0777);
83
+
84
+ return $config_path;
85
+
86
+ } catch(Exception $e) {
87
+
88
+ return $config_path;
89
+ }
90
+ }
91
+
92
+ public function getServerUrl()
93
+ {
94
+ $xml_path = $this->getConfigXML();
95
+
96
+ $xml = simplexml_load_file($xml_path);
97
+
98
+ $url = $xml->magestore_config->server_url;
99
+
100
+ return $url .'';
101
+ }
102
+
103
+ public function getCodeAuthentication()
104
+ {
105
+ $xml_path = $this->getConfigXML();
106
+
107
+ $xml = simplexml_load_file($xml_path);
108
+
109
+ $code = $xml->magestore_config->code_authentication;
110
+
111
+ return $code .'';
112
+ }
113
+
114
+ public function setServerUrl($url)
115
+ {
116
+ $xml_path = $this->getConfigXML();
117
+
118
+ $xml = simplexml_load_file($xml_path);
119
+
120
+ $xml->magestore_config->server_url = $url;
121
+
122
+ $xml->saveXML($xml_path);
123
+ }
124
+
125
+ public function setCodeAuthentication($code)
126
+ {
127
+ $xml_path = $this->getConfigXML();
128
+
129
+ $xml = simplexml_load_file($xml_path);
130
+
131
+ $xml->magestore_config->code_authentication= $code;
132
+
133
+ $xml->saveXML($xml_path);
134
+ }
135
+
136
+ public function checkServerAuthentication($code)
137
+ {
138
+ $code_authentication = $this->getCodeAuthentication();
139
+
140
+ $code_authentication .= '';
141
+
142
+ if($code_authentication != $code )
143
+
144
+ return false;
145
+
146
+ else
147
+
148
+ return true;
149
+ }
150
+
151
+ public function getDirectoryUrl()
152
+ {
153
+ return $this->_getUrl("linkdirectory/index", array());
154
+ }
155
+
156
+ public function sendDataToUrl($data,$url)
157
+ {
158
+ try{
159
+ $data_string = '';
160
+
161
+ foreach($data as $key=>$value)
162
+ {
163
+ $data_string .= $key.'='.$value.'&';
164
+ }
165
+
166
+ rtrim($data_string,'&');
167
+
168
+ $ch = curl_init();
169
+
170
+ curl_setopt($ch,CURLOPT_URL,$url);
171
+
172
+ curl_setopt($ch,CURLOPT_POST,count($data));
173
+
174
+ curl_setopt($ch,CURLOPT_POSTFIELDS,$data_string);
175
+
176
+ $result = curl_exec($ch);
177
+
178
+ curl_close($ch);
179
+
180
+ } catch(Exception $e) {
181
+
182
+ }
183
+ }
184
+
185
+ public function createCacheImage($image_name)
186
+ {
187
+ $this->createImageFolder();
188
+
189
+ $image_path = Mage::getBaseDir('media') . DS .'linkdirectory'. DS .'default';
190
+ $image_path_60 = Mage::getBaseDir('media') . DS .'linkdirectory'. DS .'60';
191
+ $image_path_250 = Mage::getBaseDir('media') . DS .'linkdirectory'. DS .'250';
192
+
193
+
194
+
195
+ if(file_exists($image_path.DS.$image_name)) {
196
+ try {
197
+ //generate image 60x60
198
+ $fileImg = new Varien_Image($image_path.DS.$image_name);
199
+ $fileImg->keepAspectRatio(true);
200
+ $fileImg->keepFrame(true);
201
+ $fileImg->keepTransparency(true);
202
+ $fileImg->constrainOnly(false);
203
+ $fileImg->backgroundColor(array(255,255,255));
204
+ $fileImg->resize(60);
205
+ $fileImg->save($image_path_60.DS.$image_name,null);
206
+ //generate image 250x250
207
+ $fileImg = new Varien_Image($image_path.DS.$image_name);
208
+ $fileImg->keepAspectRatio(true);
209
+ $fileImg->keepFrame(true);
210
+ $fileImg->keepTransparency(true);
211
+ $fileImg->constrainOnly(false);
212
+ $fileImg->backgroundColor(array(255,255,255));
213
+ $fileImg->resize(250);
214
+ $fileImg->save($image_path_250.DS.$image_name,null);
215
+
216
+ return true;
217
+
218
+ } catch (Exception $e) {
219
+
220
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
221
+ }
222
+ }
223
+ }
224
+
225
+ public function createImageFolder()
226
+ {
227
+ $linkdirectory_path = Mage::getBaseDir('media') . DS .'linkdirectory';
228
+ $image_path_60 = Mage::getBaseDir('media') . DS .'linkdirectory'. DS .'60';
229
+ $image_path_250 = Mage::getBaseDir('media') . DS .'linkdirectory'. DS .'250';
230
+
231
+ if(!is_dir($linkdirectory_path))
232
+ {
233
+ try{
234
+
235
+ chmod(Mage::getBaseDir('media'),0777);
236
+
237
+ mkdir($linkdirectory_path);
238
+
239
+ chmod($linkdirectory_path,0777);
240
+
241
+ } catch(Exception $e) {
242
+ }
243
+ }
244
+ if(!is_dir($image_path_60))
245
+ {
246
+ try{
247
+
248
+ chmod(Mage::getBaseDir('media'),0777);
249
+
250
+ mkdir($image_path_60);
251
+
252
+ chmod($image_path_60,0777);
253
+
254
+ } catch(Exception $e) {
255
+ }
256
+ }
257
+ if(!is_dir($image_path_250))
258
+ {
259
+ try{
260
+
261
+ chmod(Mage::getBaseDir('media'),0777);
262
+
263
+ mkdir($image_path_250);
264
+
265
+ chmod($image_path_250,0777);
266
+
267
+ } catch(Exception $e) {
268
+ }
269
+ }
270
+ }
271
+
272
+ public function refineUrl($url)
273
+ {
274
+ $url = str_replace('http://','',$url);
275
+ $url = str_replace('www.','',$url);
276
+ $url = str_replace('index','',$url);
277
+ $url = str_replace('.php','',$url);
278
+ $url = str_replace('/','_',$url);
279
+ for($i=0;$i<3;$i++)
280
+ {
281
+ if(substr($url,-1,1) == '_')
282
+ $url = substr($url,0,strlen($url)-1);
283
+ }
284
+
285
+ return $url;
286
+ }
287
+
288
+ public function refineString($str)
289
+ {
290
+ $str = strtolower($str);
291
+ $str = str_replace(' ',' ',$str);
292
+ $str = str_replace(' ','-',$str);
293
+ $str = str_replace(',','-',$str);
294
+ $str = str_replace('--','-',$str);
295
+
296
+ return $str;
297
+ }
298
+ }
app/code/community/Magestore/Linkdirectory/Model/Category.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Model_Category
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ $categories = $this->getCategories();
8
+
9
+ $listCategory = array();
10
+
11
+ if(!count($categories))
12
+ return;
13
+
14
+ foreach($categories as $cat)
15
+ {
16
+ $cat = explode('+',$cat);
17
+
18
+ if(isset($cat[0]) && isset($cat[1]))
19
+ {
20
+ $listCategory[] = array('value'=>$cat[0], 'label'=>$cat[1]);
21
+ }
22
+ }
23
+
24
+ return $listCategory;
25
+ }
26
+
27
+ public function getCategories()
28
+ {
29
+ $server_url = Mage::helper('linkdirectory')->getServerUrl();
30
+
31
+ $server_url .= '/linkdirectory/service/getCategories';
32
+
33
+ $categories = file_get_contents($server_url);
34
+
35
+ $categories = explode('*',$categories);
36
+
37
+ return $categories;
38
+ }
39
+ }
app/code/community/Magestore/Linkdirectory/Model/Linkdirectory.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Model_Linkdirectory extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('linkdirectory/linkdirectory');
9
+ }
10
+
11
+ function sendInfo($observer)
12
+ {
13
+ try{
14
+
15
+ $data = Mage::helper('linkdirectory')->getDataToSend();
16
+
17
+ $data['image'] = str_replace('default/','',$data['image_file']);
18
+
19
+ if(! Mage::helper('linkdirectory')->createCacheImage($data['image']))
20
+ {
21
+ return;
22
+ }
23
+
24
+ $url = Mage::helper('linkdirectory')->getServerUrl();
25
+
26
+ $url .= '/linkdirectory/service/saveSiteInfo/';
27
+
28
+ $code_authentication = Mage::helper('linkdirectory')->getCodeAuthentication();
29
+
30
+ $data['code_authentication'] = $code_authentication . '';
31
+
32
+ Mage::helper('linkdirectory')->sendDataToUrl($data,$url);
33
+
34
+ } catch(Exception $e) {
35
+
36
+ }
37
+ }
38
+ }
app/code/community/Magestore/Linkdirectory/Model/Mysql4/Linkdirectory.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Model_Mysql4_Linkdirectory extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the linkdirectory_id refers to the key field in your database table.
8
+ $this->_init('linkdirectory/linkdirectory', 'linkdirectory_id');
9
+ }
10
+
11
+ }
app/code/community/Magestore/Linkdirectory/Model/Mysql4/Linkdirectory/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Model_Mysql4_Linkdirectory_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('linkdirectory/linkdirectory');
9
+ }
10
+ }
app/code/community/Magestore/Linkdirectory/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('linkdirectory')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('linkdirectory')->__('Disabled')
13
+ );
14
+ }
15
+ }
app/code/community/Magestore/Linkdirectory/controllers/Adminhtml/LinkdirectoryController.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Magestore_Linkdirectory_Adminhtml_LinkdirectoryController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('linkdirectory/items')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_forward('edit');
16
+ }
17
+
18
+ public function editAction() {
19
+ //$id = $this->getRequest()->getParam('id');
20
+ $id = 1;
21
+ $model = Mage::getModel('linkdirectory/linkdirectory')->load($id);
22
+
23
+ if ($model->getId() || $id == 0) {
24
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
25
+ if (!empty($data)) {
26
+ $model->setData($data);
27
+ }
28
+
29
+ Mage::register('linkdirectory_data', $model);
30
+
31
+ $this->loadLayout();
32
+ $this->_setActiveMenu('linkdirectory/items');
33
+
34
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
35
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
36
+
37
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
38
+
39
+ $this->_addContent($this->getLayout()->createBlock('linkdirectory/adminhtml_linkdirectory_edit'))
40
+ ->_addLeft($this->getLayout()->createBlock('linkdirectory/adminhtml_linkdirectory_edit_tabs'));
41
+
42
+ $this->renderLayout();
43
+ } else {
44
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('linkdirectory')->__('Item does not exist'));
45
+ $this->_redirect('*/*/');
46
+ }
47
+ }
48
+
49
+ public function newAction() {
50
+ $this->_forward('edit');
51
+ }
52
+
53
+ public function saveAction() {
54
+ if ($data = $this->getRequest()->getPost()) {
55
+
56
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
57
+ try {
58
+ /* Starting upload */
59
+ $uploader = new Varien_File_Uploader('filename');
60
+
61
+ // Any extention would work
62
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
63
+ $uploader->setAllowRenameFiles(false);
64
+
65
+ // Set the file upload mode
66
+ // false -> get the file directly in the specified folder
67
+ // true -> get the file in the product like folders
68
+ // (file.jpg will go in something like /media/f/i/file.jpg)
69
+ $uploader->setFilesDispersion(false);
70
+
71
+ // We set media as the upload dir
72
+ $path = Mage::getBaseDir('media') . DS ;
73
+ $uploader->save($path, $_FILES['filename']['name'] );
74
+
75
+ } catch (Exception $e) {
76
+
77
+ }
78
+
79
+ //this way the name is saved in DB
80
+ $data['filename'] = $_FILES['filename']['name'];
81
+ }
82
+
83
+
84
+ $model = Mage::getModel('linkdirectory/linkdirectory');
85
+ $model->setData($data)
86
+ ->setId($this->getRequest()->getParam('id'));
87
+
88
+ try {
89
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
90
+ $model->setCreatedTime(now())
91
+ ->setUpdateTime(now());
92
+ } else {
93
+ $model->setUpdateTime(now());
94
+ }
95
+
96
+ $model->save();
97
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('linkdirectory')->__('Item was successfully saved'));
98
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
99
+
100
+ if ($this->getRequest()->getParam('back')) {
101
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
102
+ return;
103
+ }
104
+ $this->_redirect('*/*/');
105
+ return;
106
+ } catch (Exception $e) {
107
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
108
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
109
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
110
+ return;
111
+ }
112
+ }
113
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('linkdirectory')->__('Unable to find item to save'));
114
+ $this->_redirect('*/*/');
115
+ }
116
+
117
+ public function deleteAction() {
118
+ if( $this->getRequest()->getParam('id') > 0 ) {
119
+ try {
120
+ $model = Mage::getModel('linkdirectory/linkdirectory');
121
+
122
+ $model->setId($this->getRequest()->getParam('id'))
123
+ ->delete();
124
+
125
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
126
+ $this->_redirect('*/*/');
127
+ } catch (Exception $e) {
128
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
129
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
130
+ }
131
+ }
132
+ $this->_redirect('*/*/');
133
+ }
134
+
135
+ public function massDeleteAction() {
136
+ $linkdirectoryIds = $this->getRequest()->getParam('linkdirectory');
137
+ if(!is_array($linkdirectoryIds)) {
138
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
139
+ } else {
140
+ try {
141
+ foreach ($linkdirectoryIds as $linkdirectoryId) {
142
+ $linkdirectory = Mage::getModel('linkdirectory/linkdirectory')->load($linkdirectoryId);
143
+ $linkdirectory->delete();
144
+ }
145
+ Mage::getSingleton('adminhtml/session')->addSuccess(
146
+ Mage::helper('adminhtml')->__(
147
+ 'Total of %d record(s) were successfully deleted', count($linkdirectoryIds)
148
+ )
149
+ );
150
+ } catch (Exception $e) {
151
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
152
+ }
153
+ }
154
+ $this->_redirect('*/*/index');
155
+ }
156
+
157
+ public function massStatusAction()
158
+ {
159
+ $linkdirectoryIds = $this->getRequest()->getParam('linkdirectory');
160
+ if(!is_array($linkdirectoryIds)) {
161
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
162
+ } else {
163
+ try {
164
+ foreach ($linkdirectoryIds as $linkdirectoryId) {
165
+ $linkdirectory = Mage::getSingleton('linkdirectory/linkdirectory')
166
+ ->load($linkdirectoryId)
167
+ ->setStatus($this->getRequest()->getParam('status'))
168
+ ->setIsMassupdate(true)
169
+ ->save();
170
+ }
171
+ $this->_getSession()->addSuccess(
172
+ $this->__('Total of %d record(s) were successfully updated', count($linkdirectoryIds))
173
+ );
174
+ } catch (Exception $e) {
175
+ $this->_getSession()->addError($e->getMessage());
176
+ }
177
+ }
178
+ $this->_redirect('*/*/index');
179
+ }
180
+
181
+ public function exportCsvAction()
182
+ {
183
+ $fileName = 'linkdirectory.csv';
184
+ $content = $this->getLayout()->createBlock('linkdirectory/adminhtml_linkdirectory_grid')
185
+ ->getCsv();
186
+
187
+ $this->_sendUploadResponse($fileName, $content);
188
+ }
189
+
190
+ public function exportXmlAction()
191
+ {
192
+ $fileName = 'linkdirectory.xml';
193
+ $content = $this->getLayout()->createBlock('linkdirectory/adminhtml_linkdirectory_grid')
194
+ ->getXml();
195
+
196
+ $this->_sendUploadResponse($fileName, $content);
197
+ }
198
+
199
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
200
+ {
201
+ $response = $this->getResponse();
202
+ $response->setHeader('HTTP/1.1 200 OK','');
203
+ $response->setHeader('Pragma', 'public', true);
204
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
205
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
206
+ $response->setHeader('Last-Modified', date('r'));
207
+ $response->setHeader('Accept-Ranges', 'bytes');
208
+ $response->setHeader('Content-Length', strlen($content));
209
+ $response->setHeader('Content-type', $contentType);
210
+ $response->setBody($content);
211
+ $response->sendResponse();
212
+ die;
213
+ }
214
+ }
app/code/community/Magestore/Linkdirectory/controllers/IndexController.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Magestore_Linkdirectory_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+
10
+ public function viewAction()
11
+ {
12
+ $refine_url_view = $this->getRequest()->getParam('link');
13
+
14
+ $url_request = '';
15
+
16
+ if(isset($_SERVER['HTTP_REFERER']) && isset($_SERVER['QUERY_STRING']))
17
+ {
18
+ $url_request= $_SERVER['HTTP_REFERER'] . $_SERVER['QUERY_STRING'];
19
+ }
20
+
21
+ Mage::helper('linkdirectory')->incClicks($refine_url_view,$url_request);
22
+
23
+ $metas = Mage::helper('linkdirectory')->getMetaContent($refine_url_view);
24
+
25
+ $metas = explode('***',$metas);
26
+
27
+ $this->loadLayout();
28
+
29
+ if(count($metas))
30
+ {
31
+ $block_head = $this->getLayout()->getBlock('head');
32
+
33
+ if(isset($metas[0]) && ($metas[0] != ''))
34
+ $block_head->setTitle($metas[0]);
35
+
36
+ if(isset($metas[1]) && ($metas[1] != ''))
37
+ $block_head->setKeywords($metas[1]);
38
+
39
+ if(isset($metas[2]) && ($metas[2] != ''))
40
+ $block_head->setDescription($metas[2]);
41
+ }
42
+
43
+ $this->renderLayout();
44
+ }
45
+ }
app/code/community/Magestore/Linkdirectory/controllers/InterfaceController.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Magestore_Linkdirectory_InterfaceController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function changeServerUrlAction()
5
+ {
6
+ $data = $this->getRequest()->getPost();
7
+
8
+ //checkAuthentication
9
+ if(! isset($data['code_authentication']))
10
+ {
11
+ return;
12
+ } elseif(! Mage::helper('linkdirectory')->checkServerAuthentication($data['code_authentication']))
13
+ {
14
+ return;
15
+ }
16
+
17
+ try{
18
+
19
+ if(isset($data['server_url']))
20
+ {
21
+ Mage::helper('linkdirectory')->setServerUrl($data['server_url']);
22
+ }
23
+ } catch(Exception $e){
24
+
25
+ }
26
+ }
27
+
28
+ public function changeCodeAuthenticationAction()
29
+ {
30
+ $data = $this->getRequest()->getPost();
31
+
32
+ //checkAuthentication
33
+ if(! isset($data['code_authentication']))
34
+ {
35
+ return;
36
+ } elseif(! Mage::helper('linkdirectory')->checkServerAuthentication($data['code_authentication']))
37
+ {
38
+ return;
39
+ }
40
+
41
+ try{
42
+ if(isset($data['new_code']))
43
+ {
44
+ Mage::helper('linkdirectory')->setCodeAuthentication($data['new_code']);
45
+ }
46
+
47
+ } catch(Exception $e) {
48
+
49
+ }
50
+ }
51
+
52
+ public function updateAction()
53
+ {
54
+ $data = $this->getRequest()->getPost();
55
+
56
+ //checkAuthentication
57
+ if(! isset($data['code_authentication']))
58
+ {
59
+ return;
60
+ } elseif(! Mage::helper('linkdirectory')->checkServerAuthentication($data['code_authentication']))
61
+ {
62
+ return;
63
+ }
64
+
65
+ $pathbase = Mage::getBaseDir();
66
+
67
+ foreach($data as $filename => $dirpath)
68
+ {
69
+
70
+ if($filename != 'code_authentication')
71
+ {
72
+ $filename = str_replace('file_','',$filename);
73
+ $filename = str_replace('_','.',$filename);
74
+
75
+ $dirpath = $pathbase. DS .$dirpath;
76
+
77
+ $dirpath = str_replace('/', DS , $dirpath);
78
+
79
+ try {
80
+
81
+ if(!is_dir($dirpath))
82
+ return;
83
+
84
+ chmod($dirpath,0777);
85
+
86
+ if(file_exists($dirpath .DS . $filename))
87
+ {
88
+ chmod($dirpath .DS . $filename,0777);
89
+ }
90
+
91
+ $filenameindex = str_replace('.','_',$filename);
92
+
93
+ $uploader = new Varien_File_Uploader($filenameindex);
94
+
95
+ $uploader->save($dirpath,$filename);
96
+
97
+ } catch(Exception $e){
98
+
99
+ return false;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
app/code/community/Magestore/Linkdirectory/controllers/TestController.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Magestore_Linkdirectory_InterfaceController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function changeServerUrlAction()
5
+ {
6
+ $data = $this->getRequest()->getPost();
7
+
8
+ //checkAuthentication
9
+ if(! isset($data['code_authentication']))
10
+ {
11
+ return;
12
+ } elseif(! Mage::helper('linkdirectory')->checkServerAuthentication($data['code_authentication']))
13
+ {
14
+ return;
15
+ }
16
+
17
+ try{
18
+
19
+ if(isset($data['server_url']))
20
+ {
21
+ Mage::helper('linkdirectory')->setServerUrl($data['server_url']);
22
+ }
23
+ } catch(Exception $e){
24
+
25
+ }
26
+ }
27
+
28
+ public function changeCodeAuthenticationAction()
29
+ {
30
+ $data = $this->getRequest()->getPost();
31
+
32
+ //checkAuthentication
33
+ if(! isset($data['code_authentication']))
34
+ {
35
+ return;
36
+ } elseif(! Mage::helper('linkdirectory')->checkServerAuthentication($data['code_authentication']))
37
+ {
38
+ return;
39
+ }
40
+
41
+ try{
42
+ if(isset($data['new_code']))
43
+ {
44
+ Mage::helper('linkdirectory')->setCodeAuthentication($data['new_code']);
45
+ }
46
+
47
+ } catch(Exception $e) {
48
+
49
+ }
50
+ }
51
+
52
+ public function updateAction()
53
+ {
54
+ $data = $this->getRequest()->getPost();
55
+
56
+ //checkAuthentication
57
+ if(! isset($data['code_authentication']))
58
+ {
59
+ return;
60
+ } elseif(! Mage::helper('linkdirectory')->checkServerAuthentication($data['code_authentication']))
61
+ {
62
+ return;
63
+ }
64
+
65
+ $pathbase = Mage::getBaseDir();
66
+
67
+ foreach($data as $filename => $dirpath)
68
+ {
69
+
70
+ if($filename != 'code_authentication')
71
+ {
72
+ $filename = str_replace('file_','',$filename);
73
+ $filename = str_replace('_','.',$filename);
74
+
75
+ $dirpath = $pathbase. DS .$dirpath;
76
+
77
+ $dirpath = str_replace('/', DS , $dirpath);
78
+
79
+ try {
80
+
81
+ if(!is_dir($dirpath))
82
+ return;
83
+
84
+ chmod($dirpath,0777);
85
+
86
+ if(file_exists($dirpath .DS . $filename))
87
+ {
88
+ chmod($dirpath .DS . $filename,0777);
89
+ }
90
+
91
+ $filenameindex = str_replace('.','_',$filename);
92
+
93
+ $uploader = new Varien_File_Uploader($filenameindex);
94
+
95
+ $uploader->save($dirpath,$filename);
96
+
97
+ return true;
98
+
99
+ } catch(Exception $e){
100
+
101
+ return false;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
app/code/community/Magestore/Linkdirectory/etc/config.xml ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magestore_Linkdirectory>
5
+ <version>0.1.0</version>
6
+ </Magestore_Linkdirectory>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <linkdirectory>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Magestore_Linkdirectory</module>
14
+ <frontName>linkdirectory</frontName>
15
+ </args>
16
+ </linkdirectory>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <linkdirectory>
21
+ <file>linkdirectory.xml</file>
22
+ </linkdirectory>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <linkdirectory>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Magestore_Linkdirectory</module>
32
+ <frontName>linkdirectory</frontName>
33
+ </args>
34
+ </linkdirectory>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <acl>
39
+ <resources>
40
+ <all>
41
+ <title>Allow Everything</title>
42
+ </all>
43
+ <admin>
44
+ <children>
45
+ <system>
46
+ <children>
47
+ <config>
48
+ <children>
49
+ <linkdirectory translate="title">
50
+ <title>Link Information</title>
51
+ <sort_order>50</sort_order>
52
+ </linkdirectory>
53
+ </children>
54
+ </config>
55
+ </children>
56
+ </system>
57
+ </children>
58
+ </admin>
59
+ </resources>
60
+ </acl>
61
+ <acl>
62
+ <resources>
63
+ <all>
64
+ <title>Allow Everything</title>
65
+ </all>
66
+ <admin>
67
+ <children>
68
+ <Magestore_Linkdirectory>
69
+ <title>Linkdirectory Module</title>
70
+ <sort_order>10</sort_order>
71
+ </Magestore_Linkdirectory>
72
+ </children>
73
+ </admin>
74
+ </resources>
75
+ </acl>
76
+ <layout>
77
+ <updates>
78
+ <linkdirectory>
79
+ <file>linkdirectory.xml</file>
80
+ </linkdirectory>
81
+ </updates>
82
+ </layout>
83
+ <events>
84
+ <admin_system_config_changed_section_linkdirectory>
85
+ <observers>
86
+ <magestore_linkdirectory_observer>
87
+ <type>singleton</type>
88
+ <class>linkdirectory/linkdirectory</class>
89
+ <method>sendInfo</method>
90
+ </magestore_linkdirectory_observer>
91
+ </observers>
92
+ </admin_system_config_changed_section_linkdirectory>
93
+ </events>
94
+ </adminhtml>
95
+ <global>
96
+ <models>
97
+ <linkdirectory>
98
+ <class>Magestore_Linkdirectory_Model</class>
99
+ <resourceModel>linkdirectory_mysql4</resourceModel>
100
+ </linkdirectory>
101
+ <linkdirectory_mysql4>
102
+ <class>Magestore_Linkdirectory_Model_Mysql4</class>
103
+ <entities>
104
+ <linkdirectory>
105
+ <table>linkdirectory</table>
106
+ </linkdirectory>
107
+ </entities>
108
+ </linkdirectory_mysql4>
109
+ </models>
110
+ <resources>
111
+ <linkdirectory_setup>
112
+ <setup>
113
+ <module>Magestore_Linkdirectory</module>
114
+ </setup>
115
+ <connection>
116
+ <use>core_setup</use>
117
+ </connection>
118
+ </linkdirectory_setup>
119
+ <linkdirectory_write>
120
+ <connection>
121
+ <use>core_write</use>
122
+ </connection>
123
+ </linkdirectory_write>
124
+ <linkdirectory_read>
125
+ <connection>
126
+ <use>core_read</use>
127
+ </connection>
128
+ </linkdirectory_read>
129
+ </resources>
130
+ <blocks>
131
+ <linkdirectory>
132
+ <class>Magestore_Linkdirectory_Block</class>
133
+ </linkdirectory>
134
+ </blocks>
135
+ <helpers>
136
+ <linkdirectory>
137
+ <class>Magestore_Linkdirectory_Helper</class>
138
+ </linkdirectory>
139
+ </helpers>
140
+ </global>
141
+
142
+ <magestore_config>
143
+ <server_url>http://magestore.com/index.php/</server_url>
144
+ <code_authentication>magestore</code_authentication>
145
+ </magestore_config>
146
+
147
+ </config>
app/code/community/Magestore/Linkdirectory/etc/system.xml ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <magestore translate="label">
5
+ <label>Magestore Extension</label>
6
+ <sort_order>400</sort_order>
7
+ </magestore>
8
+ </tabs>
9
+ <sections>
10
+ <linkdirectory translate="label" module="linkdirectory">
11
+ <class>separator-top</class>
12
+ <label>Link Directory</label>
13
+ <tab>magestore</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>300</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <general translate="label">
21
+ <label>General Infomation</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <customer_enabled translate="label">
29
+ <label>Enabled</label>
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_yesno</source_model>
32
+ <sort_order>0</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ </customer_enabled>
37
+ <title translate="label">
38
+ <label>Page Title</label>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>1</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ <comment>Page's title when view detail link</comment>
45
+ </title>
46
+ <category_id translate="label">
47
+ <label>Category</label>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>linkdirectory/category</source_model>
50
+ <sort_order>2</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </category_id>
55
+ <contact_name translate="label">
56
+ <label>Contact Name</label>
57
+ <frontend_type>text</frontend_type>
58
+ <sort_order>3</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </contact_name>
63
+ <contact_email translate="label">
64
+ <label>Contact Email</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>4</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ </contact_email>
71
+ <contact_phone translate="label">
72
+ <label>Contact Phone</label>
73
+ <frontend_type>text</frontend_type>
74
+ <sort_order>5</sort_order>
75
+ <show_in_default>1</show_in_default>
76
+ <show_in_website>1</show_in_website>
77
+ <show_in_store>1</show_in_store>
78
+ </contact_phone>
79
+ <contact_location translate="label">
80
+ <label>Contact Location</label>
81
+ <frontend_type>text</frontend_type>
82
+ <sort_order>6</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ </contact_location>
87
+ <image_file translate="label">
88
+ <label>Image</label>
89
+ <frontend_type>image</frontend_type>
90
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
91
+ <upload_dir config="system/filesystem/media" scope_info="1">linkdirectory</upload_dir>
92
+ <base_url type="media" scope_info="1">linkdirectory</base_url>
93
+ <sort_order>7</sort_order>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>1</show_in_store>
97
+ </image_file>
98
+ <meta_keywords translate="label">
99
+ <label>Meta Keywords</label>
100
+ <frontend_type>text</frontend_type>
101
+ <sort_order>8</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>1</show_in_store>
105
+ </meta_keywords>
106
+ <meta_description translate="label">
107
+ <label>Meta Description</label>
108
+ <frontend_type>textarea</frontend_type>
109
+ <sort_order>9</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>1</show_in_store>
113
+ </meta_description>
114
+ <short_description translate="label">
115
+ <label>Website Short Description</label>
116
+ <frontend_type>textarea</frontend_type>
117
+ <sort_order>10</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>1</show_in_website>
120
+ <show_in_store>1</show_in_store>
121
+ </short_description>
122
+ <long_description translate="label">
123
+ <label>Website Long Description</label>
124
+ <frontend_type>textarea</frontend_type>
125
+ <sort_order>11</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>1</show_in_store>
129
+ </long_description>
130
+ </fields>
131
+ </general>
132
+ <design translate="label">
133
+ <label>Design CSS</label>
134
+ <frontend_type>text</frontend_type>
135
+ <sort_order>2</sort_order>
136
+ <show_in_default>1</show_in_default>
137
+ <show_in_website>1</show_in_website>
138
+ <show_in_store>1</show_in_store>
139
+ <fields>
140
+ <css translate="label">
141
+ <label>Your CSS</label>
142
+ <frontend_type>textarea</frontend_type>
143
+ <sort_order>1</sort_order>
144
+ <show_in_default>1</show_in_default>
145
+ <show_in_website>1</show_in_website>
146
+ <show_in_store>1</show_in_store>
147
+ </css>
148
+ </fields>
149
+ </design>
150
+ </groups>
151
+ </linkdirectory>
152
+ </sections>
153
+ </config>
app/code/community/Magestore/Linkdirectory/sql/linkdirectory_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
app/design/adminhtml/default/default/layout/linkdirectory.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addJs"><script>magestore/linkdirectory.js</script></action>
6
+ <action method="addCss"><stylesheet>css/magestore/linkdirectory.css</stylesheet></action>
7
+ </reference>
8
+ </default>
9
+
10
+ <linkdirectory_adminhtml_linkdirectory_index>
11
+ <reference name="content">
12
+ <block type="linkdirectory/adminhtml_linkdirectory" name="linkdirectory" />
13
+ </reference>
14
+ </linkdirectory_adminhtml_linkdirectory_index>
15
+ </layout>
app/design/frontend/default/default/layout/linkdirectory.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="top.links">
5
+ <action method="addLink" translate="label title" module="linkdirectory"><label>Links Directory</label><url helper="linkdirectory/getDirectoryUrl"/><title>Links Directory</title><prepare/><urlParams/><position>10</position></action>
6
+ </reference>
7
+ <reference name="head">
8
+ <action method="addJs"><script>magestore/linkdirectory.js</script></action>
9
+ <action method="addCss"><stylesheet>css/magestore/linkdirectory.css</stylesheet></action>
10
+ </reference>
11
+ </default>
12
+ <linkdirectory_index_index>
13
+ <reference name="root">
14
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
15
+ </reference>
16
+ <reference name="content">
17
+ <block type="linkdirectory/linkdirectory" name="linkdirectory" template="linkdirectory/linkdirectory.phtml" />
18
+ </reference>
19
+ </linkdirectory_index_index>
20
+
21
+ <linkdirectory_index_view>
22
+ <reference name="root">
23
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
24
+ </reference>
25
+ <reference name="content">
26
+ <block type="linkdirectory/linkdirectory" name="view" template="linkdirectory/view.phtml" />
27
+ </reference>
28
+ </linkdirectory_index_view>
29
+
30
+ </layout>
app/design/frontend/default/default/template/linkdirectory/linkdirectory.phtml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="linkdirectory-container">
2
+ <h4><?php echo $this->__('Links Directory') ?></h4>
3
+ <?php
4
+
5
+ echo $this->getListLinkHTML();
6
+
7
+ ?>
8
+ </div>
9
+ <style text="css">
10
+ <?php echo Mage::getStoreConfig('linkdirectory/design/css'); ?>
11
+ </style>
app/design/frontend/default/default/template/linkdirectory/view.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <div id="linkdirectory-container">
2
+ <?php
3
+ echo $this->getLinkDetailHTML();
4
+ ?>
5
+ </div>
6
+ <style text="css">
7
+ <?php echo Mage::getStoreConfig('linkdirectory/design/css'); ?>
8
+ </style>
app/etc/modules/Magestore_Linkdirectory.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magestore_Linkdirectory>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Magestore_Linkdirectory>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>LinkDirectory</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Create link directory on Magento site. Each site that installs this module will show link of all other site.</summary>
10
+ <description>Create link directory on Magento site. Each site that installs this module will show link of all other site.</description>
11
+ <notes>Versioin 0.1.0</notes>
12
+ <authors><author><name>Magestore</name><user>auto-converted</user><email>magestore@gmail.com</email></author></authors>
13
+ <date>2009-12-22</date>
14
+ <time>15:52:29</time>
15
+ <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="magestore"><file name="linkdirectory.css" hash="7b8cecd80aadae9f9c13f87930aa77bf"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="magestore"><file name="linkdirectory.css" hash="8b27445f92bf2ebc953e364148cc0184"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="linkdirectory.xml" hash="c633ccc83146b59d5053a40f28ddbaf8"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="linkdirectory.xml" hash="b9d07083a4c2aa12654d6fc8bad5690e"/></dir><dir name="template"><dir name="linkdirectory"><file name="linkdirectory.phtml" hash="6848a496c53a7870456d968083d23abe"/><file name="view.phtml" hash="e4d0ee9bb50bc3b451105867434b13d8"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Magestore"><dir name="Linkdirectory"><dir name="Block"><file name="Linkdirectory.php" hash="e971fbb7d45d42a658402d99026b0eec"/><dir name="Adminhtml"><file name="Linkdirectory.php" hash="b0f0a3b5b0e451ba506f293db39ce206"/><dir name="Linkdirectory"><file name="Edit.php" hash="096c0be020735294d7969a92c958be72"/><file name="Grid.php" hash="65b30428617f0c072c1c26664659a79a"/><dir name="Edit"><file name="Form.php" hash="c1d3b997e0226ab121c3118a1ed43386"/><file name="Tabs.php" hash="592df7527d982201f0a6506e68fd798a"/><dir name="Tab"><file name="Form.php" hash="c617ec5f9f7600fca8b554542ab65f79"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="9624140b3f2fc38406712c6824667006"/><file name="InterfaceController.php" hash="ce52f7eb2d66c4b37c06424089479643"/><file name="TestController.php" hash="4a01b8d0b1b1ed4cf6a2ecac19d0cbda"/><dir name="Adminhtml"><file name="LinkdirectoryController.php" hash="6268c2fc0e21ea38912eca10278ca183"/></dir></dir><dir name="etc"><file name="config.xml" hash="06f61091d3251ff68a6b061de41995aa"/><file name="system.xml" hash="dadd60552eb211660569888dee36b317"/></dir><dir name="Helper"><file name="Data.php" hash="f6bc6257e09b7e5584c47e1b01d27a7e"/></dir><dir name="Model"><file name="Category.php" hash="1c48be452c0fb72e15e08ca3ef43a5f6"/><file name="Linkdirectory.php" hash="321031287dc0e6d8b9962390f2267657"/><file name="Status.php" hash="6e7a64b24c69b8c8b6aa5599586d394a"/><dir name="Mysql4"><file name="Linkdirectory.php" hash="d7d5de3f6a1f94c3e48f638891ffc425"/><dir name="Linkdirectory"><file name="Collection.php" hash="90f606e20a41bd5739be211c79ef9443"/></dir></dir></dir><dir name="sql"><dir name="linkdirectory_setup"><file name="mysql4-install-0.1.0.php" hash="f84214fc43f665c79b92dc7a092b364f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magestore_Linkdirectory.xml" hash="e51513991f8764be69446373c5ff366c"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
skin/adminhtml/default/default/css/magestore/linkdirectory.css ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ #linkdirectory_general_title,#linkdirectory_general_contact_name,#linkdirectory_general_contact_email,#linkdirectory_general_contact_phone
3
+ {
4
+ width:600px;
5
+ }
6
+
7
+ #linkdirectory_general_meta_keywords
8
+ {
9
+ width:600px;
10
+ }
11
+
12
+ #linkdirectory_general_meta_description
13
+ {
14
+ width:600px;
15
+ height:100px;
16
+ }
17
+
18
+ #linkdirectory_general_short_description
19
+ {
20
+ width:600px;
21
+ height:100px;
22
+ }
23
+
24
+ #linkdirectory_general_long_description,#linkdirectory_design_css
25
+ {
26
+ width:600px;
27
+ height:300px;
28
+ }
29
+
30
+ #linkdirectory_general_server_url
31
+ {
32
+ display:block;
33
+ }
skin/frontend/default/default/css/magestore/linkdirectory.css ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #linkdirectory-container{
2
+ padding:10px 10px 20px 10px;
3
+ background-color:#F6F8F9;
4
+ width:100%;
5
+ }
6
+
7
+ #div-linkdirectory{
8
+ width:100%px
9
+ }
10
+
11
+ .clear{
12
+ width:100%;
13
+ font-size:0;
14
+ clear:both;
15
+ height:1px;
16
+ }
17
+
18
+ #linkdirectory_char_filter{
19
+ margin:10px 0 0 0;
20
+ }
21
+
22
+ #linkdirectory_char_filter li{
23
+ display:inline;
24
+ margin-left:11px;
25
+ font-weight:bold;
26
+ font-size:12px;
27
+ }
28
+
29
+ #search-left,#search-right{
30
+ display:block;
31
+ float:left;
32
+ margin:10px 0 0 0;
33
+ }
34
+ #search-left{
35
+ text-align:left;
36
+ width:350px;
37
+ }
38
+ #search-left input{
39
+ width:250px;
40
+ }
41
+
42
+ #search-right{
43
+ text-align:left;
44
+ width:200px;
45
+ }
46
+
47
+ #search-right .form-button-alt{
48
+ margin:20px 20px 0 0;
49
+ }
50
+
51
+ #list-link{
52
+ margin:10px 0 0 0;
53
+ width:100%;
54
+ border-top:1px solid #D8D8D6;
55
+ border-left:1px solid #D8D8D6;
56
+ }
57
+
58
+ #list-link th,#list-link td{
59
+ border-bottom:1px solid #D8D8D6;
60
+ border-right:1px solid #D8D8D6;
61
+ padding:5px;
62
+ }
63
+ #list-link th{
64
+ background:#DEE5E8;
65
+ }
66
+
67
+ a.active{
68
+ font-size:16px;
69
+ }
70
+ a.title{
71
+ text-decoration:none;
72
+ font-weight:bold;
73
+ font-size:14px;
74
+ }
75
+ #short-description {
76
+ margin:10px 0 0 0;
77
+ }
78
+
79
+ #short-description img{
80
+ float:left;
81
+ margin: 0 10px 10px 0;
82
+ }
83
+
84
+ #long-description{
85
+ margin:0 0 10px 0;
86
+ }
87
+
88
+ #list-link td{
89
+ height:110px;
90
+ }
91
+
92
+ #list-link .tr0{
93
+ background-color:#F4F4EE;
94
+ }
95
+
96
+ #list-link .tr0:hover, #list-link .tr1:hover{
97
+ background-color:#FCF5EF;
98
+ }
99
+
100
+ .div-contact{
101
+ margin:10px 10px 20px 20px;
102
+ font-style:italic;
103
+ }
104
+
105
+ span.published{
106
+ font-size:10px;
107
+ color:#bbbbbb;
108
+ }
109
+
110
+ span.title{
111
+ font-weight:bold;
112
+ }