Version Notes
This is first stable version form Helios Solutions.
Download this release
Release Info
Developer | Helios |
Extension | Helios_Videogallery |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/community/Helios/Videogallery/Block/About.php +26 -0
- app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery.php +17 -0
- app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit.php +44 -0
- app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit/Form.php +17 -0
- app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit/Tab/Form.php +27 -0
- app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit/Tabs.php +21 -0
- app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Grid.php +86 -0
- app/code/community/Helios/Videogallery/Block/Index.php +3 -0
- app/code/community/Helios/Videogallery/Block/Left.php +8 -0
- app/code/community/Helios/Videogallery/Block/Renderer/Image.php +12 -0
- app/code/community/Helios/Videogallery/Helper/Data.php +25 -0
- app/code/community/Helios/Videogallery/Model/Mysql4/Videogallery.php +8 -0
- app/code/community/Helios/Videogallery/Model/Mysql4/Videogallery/Collection.php +12 -0
- app/code/community/Helios/Videogallery/Model/Videogallery.php +12 -0
- app/code/community/Helios/Videogallery/controllers/Adminhtml/Rss/RssController.php +37 -0
- app/code/community/Helios/Videogallery/controllers/Adminhtml/VideogalleryController.php +165 -0
- app/code/community/Helios/Videogallery/controllers/IndexController.php +22 -0
- app/code/community/Helios/Videogallery/etc/adminhtml.xml +23 -0
- app/code/community/Helios/Videogallery/etc/config.xml +141 -0
- app/code/community/Helios/Videogallery/etc/system.xml +102 -0
- app/code/community/Helios/Videogallery/sql/videogallery_setup/mysql4-install-0.1.0.php +17 -0
- app/design/adminhtml/default/default/layout/videogallery.xml +8 -0
- app/design/frontend/default/default/layout/videogallery.xml +17 -0
- app/design/frontend/default/default/template/videogallery/videogallery.phtml +61 -0
- app/etc/modules/Helios_Videogallery.xml +10 -0
- package.xml +19 -0
- skin/adminhtml/default/default/images/Helios/favicon.ico +0 -0
app/code/community/Helios/Videogallery/Block/About.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Helios_Videogallery_Block_About
|
4 |
+
extends Mage_Adminhtml_Block_Abstract
|
5 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Render fieldset html
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return string
|
13 |
+
*/
|
14 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
15 |
+
{
|
16 |
+
$html = <<<HTML
|
17 |
+
<div>
|
18 |
+
<a href="http://www.heliossolutions.in/" target="_blank"><img src="http://www.heliossolutions.in/wp-content/themes/helios/newimages/logo.png"></a>
|
19 |
+
<p><a href="http://www.heliossolutions.in/about-helios/"><span class="wpmega-link-title">About Helios</span></a><div class="wpmega-nonlink uberClearfix"><p>Helios Solutions is an Indian IT sourcing company which sees your relationship with us as equally vital to the success of our outsourcing partnership as our development skills. We focus exclusively on the European market and employ native European Project Managers to bridge the cultural and communication gap and ensure your outsourcing experience to India is the same as if you were working with a European partner. When working with us you will always have a Project Manager from your own country here in India. You can communicate comfortably in your own language and avoid any cultural misunderstandings that might otherwise arise when working across national borders.</p>
|
20 |
+
<p><a href="#"><span class="wpmega-link-title">Address</span></a><div class="wpmega-nonlink wpmega-widgetarea ss-colgroup-1 uberClearfix"><ul id="wpmega-ubermenu-widget-area-2"><li id="custom_post_widget-7" class="widget widget_custom_post_widget"><div class="clearfix"></p>
|
21 |
+
<div style="float: left; clear: both; padding-top: 5px;"><b>Email:</b> info@heliossolutions.in, support@heliossolutions.in</div>
|
22 |
+
</div>
|
23 |
+
HTML;
|
24 |
+
return $html;
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class Helios_Videogallery_Block_Adminhtml_Videogallery extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
|
9 |
+
$this->_controller = "adminhtml_videogallery";
|
10 |
+
$this->_blockGroup = "videogallery";
|
11 |
+
$this->_headerText = Mage::helper("videogallery")->__("Videogallery Manager");
|
12 |
+
$this->_addButtonLabel = Mage::helper("videogallery")->__("Add New Item");
|
13 |
+
parent::__construct();
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Helios_Videogallery_Block_Adminhtml_Videogallery_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
|
8 |
+
parent::__construct();
|
9 |
+
$this->_objectId = "videogallery_id";
|
10 |
+
$this->_blockGroup = "videogallery";
|
11 |
+
$this->_controller = "adminhtml_videogallery";
|
12 |
+
$this->_updateButton("save", "label", Mage::helper("videogallery")->__("Save Item"));
|
13 |
+
$this->_updateButton("delete", "label", Mage::helper("videogallery")->__("Delete Item"));
|
14 |
+
|
15 |
+
$this->_addButton("saveandcontinue", array(
|
16 |
+
"label" => Mage::helper("videogallery")->__("Save And Continue Edit"),
|
17 |
+
"onclick" => "saveAndContinueEdit()",
|
18 |
+
"class" => "save",
|
19 |
+
), -100);
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
$this->_formScripts[] = "
|
24 |
+
|
25 |
+
function saveAndContinueEdit(){
|
26 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
27 |
+
}
|
28 |
+
";
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getHeaderText()
|
32 |
+
{
|
33 |
+
if( Mage::registry("videogallery_data") && Mage::registry("videogallery_data")->getId() ){
|
34 |
+
|
35 |
+
return Mage::helper("videogallery")->__("Edit Item '%s'", $this->htmlEscape(Mage::registry("videogallery_data")->getId()));
|
36 |
+
|
37 |
+
}
|
38 |
+
else{
|
39 |
+
|
40 |
+
return Mage::helper("videogallery")->__("Add Item");
|
41 |
+
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit/Form.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Block_Adminhtml_Videogallery_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
protected function _prepareForm()
|
5 |
+
{
|
6 |
+
$form = new Varien_Data_Form(array(
|
7 |
+
"id" => "edit_form",
|
8 |
+
"action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
|
9 |
+
"method" => "post",
|
10 |
+
"enctype" =>"multipart/form-data",
|
11 |
+
)
|
12 |
+
);
|
13 |
+
$form->setUseContainer(true);
|
14 |
+
$this->setForm($form);
|
15 |
+
return parent::_prepareForm();
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Block_Adminhtml_Videogallery_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
protected function _prepareForm()
|
5 |
+
{
|
6 |
+
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset("videogallery_form", array("legend"=>Mage::helper("videogallery")->__("Video Gallery Information")));
|
10 |
+
$fieldset->addField("videogallery_url", "text", array(
|
11 |
+
"label" => Mage::helper("videogallery")->__("Enter Youtube Url"),
|
12 |
+
"class" => "required-entry",
|
13 |
+
"required" => true,
|
14 |
+
"name" => "videogallery_url",
|
15 |
+
));
|
16 |
+
|
17 |
+
if (Mage::getSingleton("adminhtml/session")->getVideogalleryData())
|
18 |
+
{
|
19 |
+
$form->setValues(Mage::getSingleton("adminhtml/session")->getVideogalleryData());
|
20 |
+
Mage::getSingleton("adminhtml/session")->setVideogalleryData(null);
|
21 |
+
}
|
22 |
+
elseif(Mage::registry("videogallery_data")) {
|
23 |
+
$form->setValues(Mage::registry("videogallery_data")->getData());
|
24 |
+
}
|
25 |
+
return parent::_prepareForm();
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Edit/Tabs.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Block_Adminhtml_Videogallery_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setId("videogallery_tabs");
|
8 |
+
$this->setDestElementId("edit_form");
|
9 |
+
$this->setTitle(Mage::helper("videogallery")->__("Video Gallery Section"));
|
10 |
+
}
|
11 |
+
protected function _beforeToHtml()
|
12 |
+
{
|
13 |
+
$this->addTab("form_section", array(
|
14 |
+
"label" => Mage::helper("videogallery")->__("Video Gallery"),
|
15 |
+
"title" => Mage::helper("videogallery")->__("Video Gallery"),
|
16 |
+
"content" => $this->getLayout()->createBlock("videogallery/adminhtml_videogallery_edit_tab_form")->toHtml(),
|
17 |
+
));
|
18 |
+
return parent::_beforeToHtml();
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
app/code/community/Helios/Videogallery/Block/Adminhtml/Videogallery/Grid.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Helios_Videogallery_Block_Adminhtml_Videogallery_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId("videogalleryGrid");
|
10 |
+
$this->setDefaultSort("videogallery_id");
|
11 |
+
$this->setDefaultDir("ASC");
|
12 |
+
$this->setSaveParametersInSession(true);
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _prepareCollection()
|
16 |
+
{
|
17 |
+
$collection = Mage::getModel("videogallery/videogallery")->getCollection();
|
18 |
+
$this->setCollection($collection);
|
19 |
+
return parent::_prepareCollection();
|
20 |
+
}
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn("videogallery_id", array(
|
24 |
+
"header" => Mage::helper("videogallery")->__("ID"),
|
25 |
+
"align" =>"center",
|
26 |
+
"type" => "number",
|
27 |
+
"index" => "videogallery_id",
|
28 |
+
));
|
29 |
+
$this->addColumn("videogallery_url", array(
|
30 |
+
"header" => Mage::helper("videogallery")->__("Youtube Url"),
|
31 |
+
"index" => "videogallery_url",
|
32 |
+
"align" =>"center",
|
33 |
+
"width" => "220px",
|
34 |
+
'renderer' => 'videogallery/renderer_image',
|
35 |
+
));
|
36 |
+
|
37 |
+
$this->addColumn("name", array(
|
38 |
+
"header" => Mage::helper("videogallery")->__("name"),
|
39 |
+
"index" => "name",
|
40 |
+
));
|
41 |
+
$this->addColumn('action',
|
42 |
+
array(
|
43 |
+
'header' => Mage::helper('videogallery')->__('Action'),
|
44 |
+
'width' => '100',
|
45 |
+
'type' => 'action',
|
46 |
+
'getter' => 'getId',
|
47 |
+
'actions' => array(
|
48 |
+
array(
|
49 |
+
'caption' => Mage::helper('videogallery')->__('Delete'),
|
50 |
+
'url' => array('base'=> '*/*/delete'),
|
51 |
+
'field' => 'videogallery_id',
|
52 |
+
'confirm' => Mage::helper('videogallery')->__('Are you sure?')
|
53 |
+
)
|
54 |
+
),
|
55 |
+
'filter' => false,
|
56 |
+
'sortable' => false,
|
57 |
+
'index' => 'stores',
|
58 |
+
'is_system' => true,
|
59 |
+
));
|
60 |
+
$this->addRssList('videogallery/adminhtml_rss_rss/videogallery', Mage::helper('videogallery')->__('RSS'));
|
61 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
|
62 |
+
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
|
63 |
+
|
64 |
+
return parent::_prepareColumns();
|
65 |
+
}
|
66 |
+
|
67 |
+
public function getRowUrl($row)
|
68 |
+
{
|
69 |
+
return $this->getUrl("*/*/edit", array("id" => $row->getId()));
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
protected function _prepareMassaction()
|
75 |
+
{
|
76 |
+
$this->setMassactionIdField('videogallery_id');
|
77 |
+
$this->getMassactionBlock()->setFormFieldName('videogallery_ids');
|
78 |
+
$this->getMassactionBlock()->setUseSelectAll(true);
|
79 |
+
$this->getMassactionBlock()->addItem('remove_videogallery', array(
|
80 |
+
'label'=> Mage::helper('videogallery')->__('Remove From Videogallery'),
|
81 |
+
'url' => $this->getUrl('*/adminhtml_videogallery/massRemove'),
|
82 |
+
'confirm' => Mage::helper('videogallery')->__('Are you sure?')
|
83 |
+
));
|
84 |
+
return $this;
|
85 |
+
}
|
86 |
+
}
|
app/code/community/Helios/Videogallery/Block/Index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Block_Index extends Mage_Core_Block_Template{
|
3 |
+
}
|
app/code/community/Helios/Videogallery/Block/Left.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Block_Left extends Mage_Core_Block_Template{
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
}
|
app/code/community/Helios/Videogallery/Block/Renderer/Image.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Block_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
|
3 |
+
|
4 |
+
public function render(Varien_Object $row) {
|
5 |
+
if (empty($row['videogallery_url'])) return '';
|
6 |
+
|
7 |
+
$url = $row['videogallery_url'];
|
8 |
+
$checkurl = explode('?v=',$url);
|
9 |
+
return '<img width="200px" height="150px" src="http://img.youtube.com/vi/'.$checkurl[1].'/0.jpg" />';
|
10 |
+
}
|
11 |
+
|
12 |
+
}
|
app/code/community/Helios/Videogallery/Helper/Data.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
public function checkEnableDisable(){
|
5 |
+
return Mage::getStoreConfig('gallerysetting/heliossetting/enabled');
|
6 |
+
}
|
7 |
+
public function getAllData(){
|
8 |
+
$videoData=Mage::getSingleton('videogallery/videogallery')->getCollection();
|
9 |
+
$allData=$videoData->getData();
|
10 |
+
return $allData;
|
11 |
+
}
|
12 |
+
public function getTitle(){
|
13 |
+
return '<u><h1 style="text-align: left">'.Mage::getStoreConfig('gallerysetting/heliossetting/videotitle').'</h1></u>';
|
14 |
+
}
|
15 |
+
public function getDescription(){
|
16 |
+
return '<p style="text-align: left">'.Mage::getStoreConfig('gallerysetting/heliossetting/videodesc').'</p>';
|
17 |
+
}
|
18 |
+
public function getWidth(){
|
19 |
+
return Mage::getStoreConfig('gallerysetting/heliossetting/videowidth');
|
20 |
+
}
|
21 |
+
public function getHeight(){
|
22 |
+
return Mage::getStoreConfig('gallerysetting/heliossetting/videoheight');
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
app/code/community/Helios/Videogallery/Model/Mysql4/Videogallery.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Model_Mysql4_Videogallery extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init("videogallery/videogallery", "videogallery_id");
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Helios/Videogallery/Model/Mysql4/Videogallery/Collection.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_Model_Mysql4_Videogallery_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
public function _construct(){
|
6 |
+
$this->_init("videogallery/videogallery");
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/Helios/Videogallery/Model/Videogallery.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Helios_Videogallery_Model_Videogallery extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct(){
|
6 |
+
|
7 |
+
$this->_init("videogallery/videogallery");
|
8 |
+
|
9 |
+
}
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/Helios/Videogallery/controllers/Adminhtml/Rss/RssController.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Helios_Videogallery_Adminhtml_Rss_RssController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
|
6 |
+
public function videogalleryAction()
|
7 |
+
{
|
8 |
+
|
9 |
+
//DEMO RSS CONTENT
|
10 |
+
//app\design\frontend\base\default\layout\rss.xml
|
11 |
+
/*
|
12 |
+
<rss_order_new>
|
13 |
+
<block type="rss/order_new" output="toHtml" name="rss.order.new"/>
|
14 |
+
</rss_order_new>
|
15 |
+
*/
|
16 |
+
//app\code\core\Mage\Rss\Block\Order\New.php
|
17 |
+
//DEMO RSS CONTENT
|
18 |
+
|
19 |
+
|
20 |
+
$this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');
|
21 |
+
$this->loadLayout(false);
|
22 |
+
$this->renderLayout();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function preDispatch()
|
26 |
+
{
|
27 |
+
|
28 |
+
if ($this->getRequest()->getActionName() == 'videogallery') {
|
29 |
+
$this->_currentArea = 'adminhtml';
|
30 |
+
Mage::helper('rss')->authAdmin('helios/videogallery');
|
31 |
+
}
|
32 |
+
|
33 |
+
return parent::preDispatch();
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
|
app/code/community/Helios/Videogallery/controllers/Adminhtml/VideogalleryController.php
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Helios_Videogallery_Adminhtml_VideogalleryController extends Mage_Adminhtml_Controller_Action
|
4 |
+
{
|
5 |
+
protected function _initAction()
|
6 |
+
{
|
7 |
+
$this->loadLayout()->_setActiveMenu("videogallery/videogallery")->_addBreadcrumb(Mage::helper("adminhtml")->__("Videogallery Manager"),Mage::helper("adminhtml")->__("Videogallery Manager"));
|
8 |
+
return $this;
|
9 |
+
}
|
10 |
+
public function indexAction()
|
11 |
+
{
|
12 |
+
$this->_title($this->__("Videogallery"));
|
13 |
+
$this->_title($this->__("Manager Videogallery"));
|
14 |
+
$this->_initAction();
|
15 |
+
$this->renderLayout();
|
16 |
+
}
|
17 |
+
public function editAction()
|
18 |
+
{
|
19 |
+
$this->_title($this->__("Videogallery"));
|
20 |
+
$this->_title($this->__("Videogallery"));
|
21 |
+
$this->_title($this->__("Edit Item"));
|
22 |
+
|
23 |
+
$id = $this->getRequest()->getParam("id");
|
24 |
+
$model = Mage::getModel("videogallery/videogallery")->load($id);
|
25 |
+
if ($model->getId()) {
|
26 |
+
Mage::register("videogallery_data", $model);
|
27 |
+
$this->loadLayout();
|
28 |
+
$this->_setActiveMenu("videogallery/videogallery");
|
29 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Videogallery Manager"), Mage::helper("adminhtml")->__("Videogallery Manager"));
|
30 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Videogallery Description"), Mage::helper("adminhtml")->__("Videogallery Description"));
|
31 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
32 |
+
$this->_addContent($this->getLayout()->createBlock("videogallery/adminhtml_videogallery_edit"))->_addLeft($this->getLayout()->createBlock("videogallery/adminhtml_videogallery_edit_tabs"));
|
33 |
+
$this->renderLayout();
|
34 |
+
}
|
35 |
+
else {
|
36 |
+
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("videogallery")->__("Item does not exist."));
|
37 |
+
$this->_redirect("*/*/");
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
public function newAction()
|
42 |
+
{
|
43 |
+
|
44 |
+
$this->_title($this->__("Videogallery"));
|
45 |
+
$this->_title($this->__("Videogallery"));
|
46 |
+
$this->_title($this->__("New Item"));
|
47 |
+
|
48 |
+
$id = $this->getRequest()->getParam("id");
|
49 |
+
$model = Mage::getModel("videogallery/videogallery")->load($id);
|
50 |
+
|
51 |
+
$data = Mage::getSingleton("adminhtml/session")->getFormData(true);
|
52 |
+
if (!empty($data)) {
|
53 |
+
$model->setData($data);
|
54 |
+
}
|
55 |
+
|
56 |
+
Mage::register("videogallery_data", $model);
|
57 |
+
|
58 |
+
$this->loadLayout();
|
59 |
+
$this->_setActiveMenu("videogallery/videogallery");
|
60 |
+
|
61 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
62 |
+
|
63 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Videogallery Manager"), Mage::helper("adminhtml")->__("Videogallery Manager"));
|
64 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Videogallery Description"), Mage::helper("adminhtml")->__("Videogallery Description"));
|
65 |
+
|
66 |
+
|
67 |
+
$this->_addContent($this->getLayout()->createBlock("videogallery/adminhtml_videogallery_edit"))->_addLeft($this->getLayout()->createBlock("videogallery/adminhtml_videogallery_edit_tabs"));
|
68 |
+
|
69 |
+
$this->renderLayout();
|
70 |
+
|
71 |
+
}
|
72 |
+
public function saveAction()
|
73 |
+
{
|
74 |
+
|
75 |
+
$post_data=$this->getRequest()->getPost();
|
76 |
+
if ($post_data) {
|
77 |
+
$url_key = $post_data['videogallery_url'];
|
78 |
+
$url_key = explode('?v=',$url_key);
|
79 |
+
$content = file_get_contents("http://youtube.com/get_video_info?video_id=".$url_key[1]);
|
80 |
+
parse_str($content, $name);
|
81 |
+
$videoname = $name['title'];
|
82 |
+
echo $videoname;
|
83 |
+
try {
|
84 |
+
$model = Mage::getModel("videogallery/videogallery")
|
85 |
+
->addData($post_data)
|
86 |
+
->setId($this->getRequest()->getParam("id"))
|
87 |
+
->setName($videoname)
|
88 |
+
->save();
|
89 |
+
|
90 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Videogallery was successfully saved"));
|
91 |
+
Mage::getSingleton("adminhtml/session")->setVideogalleryData(false);
|
92 |
+
|
93 |
+
if ($this->getRequest()->getParam("back")) {
|
94 |
+
$this->_redirect("*/*/edit", array("id" => $model->getId()));
|
95 |
+
return;
|
96 |
+
}
|
97 |
+
$this->_redirect("*/*/");
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
catch (Exception $e) {
|
101 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
102 |
+
Mage::getSingleton("adminhtml/session")->setVideogalleryData($this->getRequest()->getPost());
|
103 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
|
107 |
+
}
|
108 |
+
$this->_redirect("*/*/");
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
public function deleteAction()
|
114 |
+
{
|
115 |
+
if( $this->getRequest()->getParam("id") > 0 ) {
|
116 |
+
try {
|
117 |
+
$model = Mage::getModel("videogallery/videogallery");
|
118 |
+
$model->setId($this->getRequest()->getParam("id"))->delete();
|
119 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
|
120 |
+
$this->_redirect("*/*/");
|
121 |
+
}
|
122 |
+
catch (Exception $e) {
|
123 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
124 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
125 |
+
}
|
126 |
+
}
|
127 |
+
$this->_redirect("*/*/");
|
128 |
+
}
|
129 |
+
|
130 |
+
|
131 |
+
public function massRemoveAction()
|
132 |
+
{
|
133 |
+
try {
|
134 |
+
$ids = $this->getRequest()->getPost('videogallery_ids', array());
|
135 |
+
foreach ($ids as $id) {
|
136 |
+
$model = Mage::getModel("videogallery/videogallery");
|
137 |
+
$model->setId($id)->delete();
|
138 |
+
}
|
139 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
|
140 |
+
}
|
141 |
+
catch (Exception $e) {
|
142 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
143 |
+
}
|
144 |
+
$this->_redirect('*/*/');
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Export order grid to CSV format
|
149 |
+
*/
|
150 |
+
public function exportCsvAction()
|
151 |
+
{
|
152 |
+
$fileName = 'videogallery.csv';
|
153 |
+
$grid = $this->getLayout()->createBlock('videogallery/adminhtml_videogallery_grid');
|
154 |
+
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
|
155 |
+
}
|
156 |
+
/**
|
157 |
+
* Export order grid to Excel XML format
|
158 |
+
*/
|
159 |
+
public function exportExcelAction()
|
160 |
+
{
|
161 |
+
$fileName = 'videogallery.xml';
|
162 |
+
$grid = $this->getLayout()->createBlock('videogallery/adminhtml_videogallery_grid');
|
163 |
+
$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
|
164 |
+
}
|
165 |
+
}
|
app/code/community/Helios/Videogallery/controllers/IndexController.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Helios_Videogallery_IndexController extends Mage_Core_Controller_Front_Action{
|
3 |
+
public function IndexAction() {
|
4 |
+
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->getLayout()->getBlock("head")->setTitle($this->__("Video Gallery"));
|
7 |
+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
8 |
+
$breadcrumbs->addCrumb("home", array(
|
9 |
+
"label" => $this->__("Home Page"),
|
10 |
+
"title" => $this->__("Home Page"),
|
11 |
+
"link" => Mage::getBaseUrl()
|
12 |
+
));
|
13 |
+
|
14 |
+
$breadcrumbs->addCrumb("video gallery", array(
|
15 |
+
"label" => $this->__("Video Gallery"),
|
16 |
+
"title" => $this->__("Video Gallery")
|
17 |
+
));
|
18 |
+
|
19 |
+
$this->renderLayout();
|
20 |
+
|
21 |
+
}
|
22 |
+
}
|
app/code/community/Helios/Videogallery/etc/adminhtml.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<gallerysetting translate="title" module="videogallery">
|
12 |
+
<title>Video Gallery Setting Section</title>
|
13 |
+
<sort_order>0</sort_order>
|
14 |
+
</gallerysetting>
|
15 |
+
</children>
|
16 |
+
</config>
|
17 |
+
</children>
|
18 |
+
</system>
|
19 |
+
</children>
|
20 |
+
</admin>
|
21 |
+
</resources>
|
22 |
+
</acl>
|
23 |
+
</config>
|
app/code/community/Helios/Videogallery/etc/config.xml
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<default>
|
4 |
+
<gallerysetting>
|
5 |
+
<heliossetting>
|
6 |
+
<videowidth>655</videowidth>
|
7 |
+
</heliossetting>
|
8 |
+
<heliossetting>
|
9 |
+
<videoheight>311</videoheight>
|
10 |
+
</heliossetting>
|
11 |
+
</gallerysetting>
|
12 |
+
</default>
|
13 |
+
<modules>
|
14 |
+
<Helios_Videogallery>
|
15 |
+
<version>0.1.0</version>
|
16 |
+
</Helios_Videogallery>
|
17 |
+
</modules>
|
18 |
+
<frontend>
|
19 |
+
<routers>
|
20 |
+
<videogallery>
|
21 |
+
<use>standard</use>
|
22 |
+
<args>
|
23 |
+
<module>Helios_Videogallery</module>
|
24 |
+
<frontName>videogallery</frontName>
|
25 |
+
</args>
|
26 |
+
</videogallery>
|
27 |
+
</routers>
|
28 |
+
<layout>
|
29 |
+
<updates>
|
30 |
+
<videogallery>
|
31 |
+
<file>videogallery.xml</file>
|
32 |
+
</videogallery>
|
33 |
+
</updates>
|
34 |
+
</layout>
|
35 |
+
</frontend>
|
36 |
+
<global>
|
37 |
+
<helpers>
|
38 |
+
<videogallery>
|
39 |
+
<class>Helios_Videogallery_Helper</class>
|
40 |
+
</videogallery>
|
41 |
+
</helpers>
|
42 |
+
<blocks>
|
43 |
+
<videogallery>
|
44 |
+
<class>Helios_Videogallery_Block</class>
|
45 |
+
</videogallery>
|
46 |
+
</blocks>
|
47 |
+
<models>
|
48 |
+
<videogallery>
|
49 |
+
<class>Helios_Videogallery_Model</class>
|
50 |
+
<resourceModel>videogallery_mysql4</resourceModel>
|
51 |
+
</videogallery>
|
52 |
+
<videogallery_mysql4>
|
53 |
+
<class>Helios_Videogallery_Model_Mysql4</class>
|
54 |
+
<entities>
|
55 |
+
<videogallery>
|
56 |
+
<table>videogallery</table>
|
57 |
+
</videogallery>
|
58 |
+
</entities>
|
59 |
+
</videogallery_mysql4>
|
60 |
+
</models>
|
61 |
+
<resources>
|
62 |
+
<videogallery_setup>
|
63 |
+
<setup>
|
64 |
+
<module>Helios_Videogallery</module>
|
65 |
+
</setup>
|
66 |
+
<connection>
|
67 |
+
<use>core_setup</use>
|
68 |
+
</connection>
|
69 |
+
</videogallery_setup>
|
70 |
+
<videogallery_write>
|
71 |
+
<connection>
|
72 |
+
<use>core_write</use>
|
73 |
+
</connection>
|
74 |
+
</videogallery_write>
|
75 |
+
<videogallery_read>
|
76 |
+
<connection>
|
77 |
+
<use>core_read</use>
|
78 |
+
</connection>
|
79 |
+
</videogallery_read>
|
80 |
+
</resources>
|
81 |
+
</global>
|
82 |
+
<admin>
|
83 |
+
<routers>
|
84 |
+
<videogallery>
|
85 |
+
<use>admin</use>
|
86 |
+
<args>
|
87 |
+
<module>Helios_Videogallery</module>
|
88 |
+
<frontName>videogallery</frontName>
|
89 |
+
</args>
|
90 |
+
</videogallery>
|
91 |
+
</routers>
|
92 |
+
</admin>
|
93 |
+
<adminhtml>
|
94 |
+
<menu>
|
95 |
+
<videogallery module="videogallery">
|
96 |
+
<title>Video Gallery</title>
|
97 |
+
<sort_order>80</sort_order>
|
98 |
+
<children>
|
99 |
+
<videogallery module="videogallery">
|
100 |
+
<title>Manage Video Gallery</title>
|
101 |
+
<sort_order>0</sort_order>
|
102 |
+
<action>videogallery/adminhtml_videogallery</action>
|
103 |
+
</videogallery>
|
104 |
+
<videogallerysetting module="videogallery">
|
105 |
+
<title>Video Gallery Settings</title>
|
106 |
+
<sort_order>1</sort_order>
|
107 |
+
<action>adminhtml/system_config/edit/section/gallerysetting</action>
|
108 |
+
</videogallerysetting>
|
109 |
+
</children>
|
110 |
+
</videogallery>
|
111 |
+
</menu>
|
112 |
+
<acl>
|
113 |
+
<resources>
|
114 |
+
<all>
|
115 |
+
<title>Allow Everything</title>
|
116 |
+
</all>
|
117 |
+
<admin>
|
118 |
+
<children>
|
119 |
+
<videogallery translate="title" module="videogallery">
|
120 |
+
<title>Video Gallery</title>
|
121 |
+
<sort_order>1000</sort_order>
|
122 |
+
<children>
|
123 |
+
<videogallery translate="title">
|
124 |
+
<title>Manage Videogallery</title>
|
125 |
+
<sort_order>0</sort_order>
|
126 |
+
</videogallery>
|
127 |
+
</children>
|
128 |
+
</videogallery>
|
129 |
+
</children>
|
130 |
+
</admin>
|
131 |
+
</resources>
|
132 |
+
</acl>
|
133 |
+
<layout>
|
134 |
+
<updates>
|
135 |
+
<videogallery>
|
136 |
+
<file>videogallery.xml</file>
|
137 |
+
</videogallery>
|
138 |
+
</updates>
|
139 |
+
</layout>
|
140 |
+
</adminhtml>
|
141 |
+
</config>
|
app/code/community/Helios/Videogallery/etc/system.xml
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<videogallery translate="label" module="videogallery">
|
5 |
+
<label>Video Gallery</label>
|
6 |
+
<label>
|
7 |
+
<![CDATA[<div style="position: absolute;"><img id="amasty_block" src="" alt="" border="0" style="padding-right:5px;"/>Video Gallery</div> <script>
|
8 |
+
var n = SKIN_URL.indexOf("adminhtml");
|
9 |
+
$('amasty_block').src = SKIN_URL.substring(0, n) + "adminhtml/default/default/images/Helios/favicon.ico";
|
10 |
+
</script>]]>
|
11 |
+
</label>
|
12 |
+
<sort_order>0</sort_order>
|
13 |
+
</videogallery>
|
14 |
+
</tabs>
|
15 |
+
<sections>
|
16 |
+
<gallerysetting translate="label" module="videogallery">
|
17 |
+
<label>Video Gallery Setting</label>
|
18 |
+
<tab>videogallery</tab>
|
19 |
+
<frontend_type>text</frontend_type>
|
20 |
+
<sort_order>0</sort_order>
|
21 |
+
<show_in_default>1</show_in_default>
|
22 |
+
<show_in_website>1</show_in_website>
|
23 |
+
<show_in_store>1</show_in_store>
|
24 |
+
<groups>
|
25 |
+
<aboutus translate="label">
|
26 |
+
<label>About Us</label>
|
27 |
+
<frontend_type>text</frontend_type>
|
28 |
+
<sort_order>0</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
<fields>
|
33 |
+
<info>
|
34 |
+
<frontend_model>videogallery/about</frontend_model>
|
35 |
+
<sort_order>10</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 |
+
</info>
|
40 |
+
</fields>
|
41 |
+
</aboutus>
|
42 |
+
<heliossetting translate="label">
|
43 |
+
<label>Set Video Gallery</label>
|
44 |
+
<frontend_type>text</frontend_type>
|
45 |
+
<sort_order>0</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
+
<fields>
|
50 |
+
<enabled translate="label">
|
51 |
+
<label>Enable Video Gallery</label>
|
52 |
+
<frontend_type>select</frontend_type>
|
53 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
54 |
+
<sort_order>0</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<comment>Enable/Disable your Module</comment>
|
59 |
+
</enabled>
|
60 |
+
<videotitle translate="label">
|
61 |
+
<label>Video Gallery Title</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<validate>validate-alphanum-with-spaces</validate>
|
64 |
+
<sort_order>1</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
<comment>Video Gallery title which will displayed at frontend side.</comment>
|
69 |
+
</videotitle>
|
70 |
+
<videodesc translate="label">
|
71 |
+
<label>Video Gallery Description</label>
|
72 |
+
<frontend_type>textarea</frontend_type>
|
73 |
+
<sort_order>2</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
<comment>Video Gallery description which will displayed at frontend side.</comment>
|
78 |
+
</videodesc>
|
79 |
+
<videowidth translate="label">
|
80 |
+
<label>Default Video Width</label>
|
81 |
+
<frontend_type>text</frontend_type>
|
82 |
+
<validate>validate-number</validate>
|
83 |
+
<sort_order>3</sort_order>
|
84 |
+
<show_in_default>1</show_in_default>
|
85 |
+
<show_in_website>1</show_in_website>
|
86 |
+
<show_in_store>1</show_in_store>
|
87 |
+
</videowidth>
|
88 |
+
<videoheight translate="label">
|
89 |
+
<label>Default Video Height</label>
|
90 |
+
<frontend_type>text</frontend_type>
|
91 |
+
<validate>validate-number</validate>
|
92 |
+
<sort_order>4</sort_order>
|
93 |
+
<show_in_default>1</show_in_default>
|
94 |
+
<show_in_website>1</show_in_website>
|
95 |
+
<show_in_store>1</show_in_store>
|
96 |
+
</videoheight>
|
97 |
+
</fields>
|
98 |
+
</heliossetting>
|
99 |
+
</groups>
|
100 |
+
</gallerysetting>
|
101 |
+
</sections>
|
102 |
+
</config>
|
app/code/community/Helios/Videogallery/sql/videogallery_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$sql=<<<SQLTEXT
|
5 |
+
create table videogallery(
|
6 |
+
`videogallery_id` int not null auto_increment,
|
7 |
+
`videogallery_url` varchar(500) NOT NULL default '',
|
8 |
+
`name` varchar(255) NOT NULL default '',
|
9 |
+
primary key(`videogallery_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
10 |
+
SQLTEXT;
|
11 |
+
|
12 |
+
$installer->run($sql);
|
13 |
+
//demo
|
14 |
+
//Mage::getModel('core/url_rewrite')->setId(null);
|
15 |
+
//demo
|
16 |
+
$installer->endSetup();
|
17 |
+
|
app/design/adminhtml/default/default/layout/videogallery.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<videogallery_adminhtml_videogallery_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="videogallery/adminhtml_videogallery" name="videogallery" />
|
6 |
+
</reference>
|
7 |
+
</videogallery_adminhtml_videogallery_index>
|
8 |
+
</layout>
|
app/design/frontend/default/default/layout/videogallery.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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="videogallery"><label>Video Gallery</label><url>videogallery/</url><title>Video Gallery</title><prepare>ture</prepare><urlParams/><position>1000</position></action>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
<videogallery_index_index>
|
9 |
+
<reference name="root">
|
10 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
11 |
+
</reference>
|
12 |
+
<reference name="content">
|
13 |
+
<block type="videogallery/index" name="videogallery_index" template="videogallery/videogallery.phtml"/>
|
14 |
+
</reference>
|
15 |
+
</videogallery_index_index>
|
16 |
+
</layout>
|
17 |
+
|
app/design/frontend/default/default/template/videogallery/videogallery.phtml
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(Mage::helper('videogallery')->checkEnableDisable()){
|
3 |
+
$data = Mage::helper('videogallery')->getAllData();
|
4 |
+
?>
|
5 |
+
<div style="text-align: center">
|
6 |
+
<?php echo Mage::helper('videogallery')->getTitle(); echo Mage::helper('videogallery')->getDescription(); ?>
|
7 |
+
<?php
|
8 |
+
if(count($data )==0){
|
9 |
+
echo " <h2><b>Please Upload the Video.<b></h2>";
|
10 |
+
}
|
11 |
+
else{
|
12 |
+
foreach($data as $key=>$result){
|
13 |
+
$url_key = explode('?v=',$result['videogallery_url']);
|
14 |
+
if($key==0){
|
15 |
+
?>
|
16 |
+
<div id="main_div_video_frame">
|
17 |
+
<iframe id="videoframe" width="<?php echo Mage::helper('videogallery')->getWidth();?>" height="<?php echo Mage::helper('videogallery')->getHeight();?>" src="http://www.youtube-nocookie.com/embed/<?php echo $url_key[1]; ?>?wmode=opaque&rel=0&autohide=1&showinfo=0&autoplay=0" frameborder="0" allowfullscreen></iframe>
|
18 |
+
</div>
|
19 |
+
<?php
|
20 |
+
}
|
21 |
+
?>
|
22 |
+
<div style="float: left;margin: 5px 10px 5px 5px;width: 285px;position: relative;">
|
23 |
+
<a style="text-decoration:none;" href="#" onclick="selectvideo('<?php echo $url_key[1]; ?>');"> <img src="http://tafelzeil.heliossolutions.in/skin/frontend/default/tafelzeil/images/youtube.png" alt="" style="position: absolute;top: 100px;left: 125px;"><img src="http://img.youtube.com/vi/<?php echo $url_key[1] ?>/0.jpg" width="285px">
|
24 |
+
<p style="text-align: justify;margin-top: 5px; "> <?php echo $result['name'];?></p></a>
|
25 |
+
</div>
|
26 |
+
<?php
|
27 |
+
}
|
28 |
+
}
|
29 |
+
?>
|
30 |
+
</div>
|
31 |
+
<?php }
|
32 |
+
else{
|
33 |
+
?>
|
34 |
+
<h2 style="border: 2px solid #000"><?php echo $this->__('This Extension is Currently Disable so, It will be redirected to our homepage in 5 seconds.') ?></h2>
|
35 |
+
<script type="text/javascript">
|
36 |
+
//<![CDATA[
|
37 |
+
setTimeout(function(){ location.href = '<?php echo $this->getUrl('') ?>'},5000);
|
38 |
+
//]]>
|
39 |
+
</script>
|
40 |
+
<?php
|
41 |
+
}?>
|
42 |
+
<script type="text/javascript" charset="utf-8">
|
43 |
+
function scrollToElement(pageElement) {
|
44 |
+
var positionX = 0,
|
45 |
+
positionY = 0;
|
46 |
+
|
47 |
+
while(pageElement != null){
|
48 |
+
positionX += pageElement.offsetLeft;
|
49 |
+
positionY += pageElement.offsetTop;
|
50 |
+
pageElement = pageElement.offsetParent;
|
51 |
+
window.scrollTo(positionX, positionY);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
function selectvideo(id) {
|
56 |
+
var main_image = document.getElementById("videoframe");
|
57 |
+
main_image.src = 'http://www.youtube-nocookie.com/embed/'+id+'?wmode=opaque&rel=0&autohide=1&showinfo=0&autoplay=1';
|
58 |
+
var video_frame_cont = document.getElementById("main_div_video_frame");
|
59 |
+
scrollToElement(main_div_video_frame);
|
60 |
+
};
|
61 |
+
</script>
|
app/etc/modules/Helios_Videogallery.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Helios_Videogallery>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>0.1.0</version>
|
8 |
+
</Helios_Videogallery>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Helios_Videogallery</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This extension provide you youtube video gallery.</summary>
|
10 |
+
<description>This extension provide you youtube video gallery.&#xD;
|
11 |
+
you have to only youtube line from back end, based on that link it will get the name of the video using youtube api and also fetch the thumbnail form the youtube server.</description>
|
12 |
+
<notes>This is first stable version form Helios Solutions.</notes>
|
13 |
+
<authors><author><name>Helios</name><user>Solutions</user><email>support@heliossolutions.in</email></author><author><name>Keyul</name><user>Shah</user><email>keyul.shah.hs@gmail.com</email></author></authors>
|
14 |
+
<date>2013-11-06</date>
|
15 |
+
<time>11:24:11</time>
|
16 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Helios_Videogallery.xml" hash="8780a89b4a0e959b7c1e6b5f8fcdc69e"/></dir></target><target name="magecommunity"><dir name="Helios"><dir name="Videogallery"><dir name="Block"><file name="About.php" hash="cc6d81ebfc0c2600055c44c28466a02f"/><dir name="Adminhtml"><dir name="Videogallery"><dir name="Edit"><file name="Form.php" hash="c55e017394301c7e2b37e7f8db306914"/><dir name="Tab"><file name="Form.php" hash="0953ea210f4e22cdb2bc4b72045aa550"/></dir><file name="Tabs.php" hash="57151e73f379ef98669efd41b0f0c5f2"/></dir><file name="Edit.php" hash="63fb8da1ebfa9f28a05839433c5cb479"/><file name="Grid.php" hash="9b598404417336c459c523d77bb57657"/></dir><file name="Videogallery.php" hash="4d97fe91a4baee7472e9851145f25abe"/></dir><file name="Index.php" hash="a056aa197851a22ca4bf7f0f54fc9ebb"/><file name="Left.php" hash="5a452e5893ea932580fa7c983d1a2942"/><dir name="Renderer"><file name="Image.php" hash="e745734d416655371521b8e68c7642b1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="0b1613ae7d72f5809e471ec5d7ebfae1"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Videogallery"><file name="Collection.php" hash="9d795c076e9ff500d91ccffffc14c5eb"/></dir><file name="Videogallery.php" hash="f65dcef7727d94c6240741eede134129"/></dir><file name="Videogallery.php" hash="5e3730f86bcc09ca3d6dcb8b9a1873ec"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Rss"><file name="RssController.php" hash="32abe90055b7c9a19a16c6c45b0331e9"/></dir><file name="VideogalleryController.php" hash="fd36cab902b84c68286795f8eea3e5f2"/></dir><file name="IndexController.php" hash="dfdb1a11c5bc9f98c014bddf015824e3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="249145214c920aa4196f0b4b1a417669"/><file name="config.xml" hash="c4876c67a4894dc3e9496672c256f026"/><file name="system.xml" hash="64e1ff69d5fab13b9e50b38793b4cf75"/></dir><dir name="sql"><dir name="videogallery_setup"><file name="mysql4-install-0.1.0.php" hash="5f924fbdace2a4f09db68c2320f206c4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="videogallery.xml" hash="dea590a0a8a0629b4e8b14edcdf29aba"/></dir><dir name="template"><dir name="videogallery"><file name="videogallery.phtml" hash="f52ecd35a6c65428e30413fb2e553be0"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="videogallery.xml" hash="2fdece5e3734ae31517a5d3a19fbe06e"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="Helios"><file name="favicon.ico" hash="4b97fae574b5202973c8c032affd0049"/></dir></dir></dir></dir></dir></target></contents>
|
17 |
+
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
+
</package>
|
skin/adminhtml/default/default/images/Helios/favicon.ico
ADDED
Binary file
|