<?php


$installer = $this;
$installer->startSetup();
$installer->endSetup();

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('catalog_product', 'magikfeatured', array(
        'group'             => 'General',
        'type'              => 'int',
        'backend'           => '',
        'frontend'          => '',
        'label'             => 'Featured Product On Home',
        'input'             => 'boolean',
        'class'             => '',
        'source'            => '',
        'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'visible'           => true,
        'required'          => false,
        'user_defined'      => true,
        'default'           => '0',
        'searchable'        => false,
        'filterable'        => false,
        'comparable'        => false,
        'visible_on_front'  => false,
        'unique'            => false,
        'apply_to'          => 'simple,configurable,virtual,bundle,downloadable',
        'is_configurable'   => false
    ));

try {
//create pages and blocks programmatically

//Custom Tab1
$staticBlock = array(
    'title' => 'Custom Tab1',
    'identifier' => 'rolta_custom_tab1',
    'content' => "<p><strong>Lorem Ipsum</strong><span>&nbsp;is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span></p>",
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

//Custom Tab2
$staticBlock = array(
    'title' => 'Custom Tab2',
    'identifier' => 'rolta_custom_tab2',
    'content' => "<p><strong>Lorem Ipsum</strong><span>&nbsp;is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span></p>",
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

//Empty Category
$staticBlock = array(
    'title' => 'Empty Category',
    'identifier' => 'rolta_empty_category',
    'content' => "<p>There are no products matching the selection.<br/> This is a static CMS block displayed if category is empty. You can put your own content here.</p>",
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

//Rolta Logo Brand block
 $staticBlock = array(
     'title' => 'Rolta Logo Brand block',
     'identifier' => 'rolta_logo_brand_block',
     'content' => '<div class="brand-logo">
<div class="product-title"><span>Our Brands</span></div>
<div class="jcarousel-skin-tango2">
<div id="mycarousel2" class="jcarousel-container jcarousel-container-horizontal" style="position: relative; display: block;">
<div class="jcarousel-clip jcarousel-clip-horizontal" style="overflow: hidden; position: relative;">
<ul class="jcarousel-list jcarousel-list-horizontal" style="overflow: hidden; position: relative; top: 0px; margin: 0px; padding: 0px; left: 0px; width: 2920px;">
<li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-1 jcarousel-item-1-horizontal" style="float: left; list-style: none outside none;"><img src="{{skin url="images/b-logo1.png"}}" alt="brand-logo" /></li>
<li><img src="{{skin url="images/b-logo2.png"}}" alt="brand-logo" /></li>
<li><img src="{{skin url="images/b-logo3.png"}}" alt="brand-logo" /></li>
<li><img src="{{skin url="images/b-logo4.png"}}" alt="brand-logo" /></li>
<li><img src="{{skin url="images/b-logo5.png"}}" alt="brand-logo" /></li>
<li><img src="{{skin url="images/b-logo6.png"}}" alt="brand-logo" /></li>
</ul>
</div>
<div class="jcarousel-prev jcarousel-prev-horizontal" style="display: block;">&nbsp;</div>
<div class="jcarousel-next jcarousel-next-horizontal" style="display: block;">&nbsp;</div>
</div>
</div>
</div>',
     'is_active' => 1,
     'stores' => array(0)
 );
 Mage::getModel('cms/block')->setData($staticBlock)->save();

//Rolta Store Logo
$staticBlock = array(
    'title' => 'Rolta Store Logo',
    'identifier' => 'rolta_logo',
    'content' => '<img src="{{skin url="images/logo.png"}}" alt="Rolta Store" />',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();


// Shpo footer payment block
$staticBlock = array(
    'title' => 'Rolta Footer Payment Block',
    'identifier' => 'rolta_footer_payment_block',
    'content' => '<div class="payment-accept"><img src="{{skin url="images/payment-option.png"}}" alt="" align="absmiddle" /></div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();


//Rolta Footer Contacts
$staticBlock = array(
    'title' => 'Rolta Footer Contacts',
    'identifier' => 'rolta_footer_contacts',
    'content' => '<h3 class="title">Contacts</h3>
<p>Magik Rolta<br /> 123 Main street, anytown,<br /> CA 123, USA.</p>
<p><em class="icon-phone"></em> +1 800 123 1234</p>
<div><em class="icon-envelope"></em><a href="#"> support@magikcommerce.com</a></div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();


// rolta navigation block
$staticBlock = array(
    'title' => 'Custom Block',
    'identifier' => 'rolta_navigation_block',
    'content' => '<div class="grid12-3"><a href="#"> <img class="fade-on-hover" src="{{skin url="images/custom-banner1.jpg"}}" alt="Magento CMS blocks" /> </a>
<h4 class="heading">Multi Layered Customization</h4>
<p>Etiam dapibus mattis sapien, blandit molestie nunc venenatis ut. Phasellus imperdiet lacinia est, nec convallis dolor aliquet ac.</p>
</div>
<div class="grid12-3"><a href="#"> <img class="fade-on-hover" src="{{skin url="images/custom-banner2.jpg"}}" alt="Magento theme documentation" /> </a>
<h4 class="heading">Fast and Light Weight</h4>
<p>Duis a dignissim nulla. Phasellus lacinia aliquam lorem, a consequat erat interdum nec. Aenean ut leo sem, id gravida tortor.</p>
</div>
<div class="grid12-3"><a href="#"> <img class="fade-on-hover" src="{{skin url="images/custom-banner3.jpg"}}" alt="Create Magento sub-themes" /> </a>
<h4 class="heading">Dedicated Support</h4>
<p>Pellentesque ut libero in nibh aliquet pretium eget elementum felis. Integer dapibus auctor tincidunt. Suspendisse potenti.</p>
</div>
<div class="clearer">&nbsp;</div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

// rolta navigation block
$staticBlock = array(
    'title' => 'Custom Block',
    'identifier' => 'rolta_left_navigation_block',
    'content' => '<div class="row">
<div class="mega-col col-sm-8 " data-widgets="wid-1" data-colwidth="8">
<div class="mega-col-inner">
<div id="wid-1" class="magik-widget">
<div class="widget-inner">
<div class="product-block">
<div class="image"><a href="#"><img src="{{skin url="images/custom-banner1.jpg"}}" alt="Fauxwaii Shirt - Oldss" width="240" /></a></div>
<h4 class="heading">Multi Layered Customization</h4>
<p>Etiam dapibus mattis sapien, blandit molestie nunc venenatis ut. Phasellus imperdiet lacinia est, nec convallis dolor aliquet ac.</p>
</div>
</div>
</div>
</div>
</div>
<div class="mega-col col-sm-8 " data-widgets="wid-2" data-colwidth="8">
<div class="mega-col-inner">
<div id="wid-2" class="magik-widget">
<div class="widget-product">
<div class="widget-inner">
<div class="product-block">
<div class="image"><a href="#"><img src="{{skin url="images/custom-banner2.jpg"}}" alt="Framed-Sleeve Mid" width="240" /></a></div>
<h4 class="heading">FAST AND LIGHT WEIGHT</h4>
<p>Duis a dignissim nulla. Phasellus lacinia aliquam lorem, a consequat erat interdum nec. Aenean ut leo sem, id gravida tortor.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mega-col col-sm-8 " data-widgets="wid-1" data-colwidth="8">
<div class="mega-col-inner">
<div id="wid-1" class="magik-widget">
<div class="widget-inner">
<div class="product-block">
<div class="image"><a href="#"><img src="{{skin url="images/custom-banner3.jpg"}}" alt="Fauxwaii Shirt - Oldss" width="240" /></a></div>
<h4 class="heading">DEDICATED SUPPORT</h4>
<p>Pellentesque ut libero in nibh aliquet pretium eget elementum felis. Integer dapibus auctor tincidunt. Suspendisse potenti.</p>
</div>
</div>
</div>
</div>
</div>
</div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();


//Rolta Home Banner Block
$staticBlock = array(
    'title' => 'Rolta Home Banner Block',
    'identifier' => 'rolta_home_banner_block',
    'content' => '<ul>
<li>
<div class="shipping-box">
<div class="icon-tablet">&nbsp;</div>
<div>RESPONSIVE <span>Magento Theme</span></div>
</div>
</li>
<li>
<div class="offer-box">
<div class="icon-smile">&nbsp;</div>
<div>Winter Sale <span>Save up to 30%</span></div>
</div>
</li>
<li class="last">
<div class="custom-box">
<div class="icon-thumbs-up">&nbsp;</div>
<div>Clean Design <span>Buy This Theme</span></div>
</div>
</li>
</ul>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

//Rolta Home Banner Block
$staticBlock = array(
    'title' => 'Rolta Home RHS Banner Block',
    'identifier' => 'rolta_home_rhs_banner_block',
    'content' => '<div class="RHS-banner"><img src="{{skin url="images/RHS-banner1.png"}}" alt="RHS banner1" align="absbottom" /> <img src="{{skin url="images/RHS-banner2.png"}}" alt="RHS banner2" align="texttop" /></div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

//Rolta Footer Information Links Block
$staticBlock = array(
    'title' => 'Rolta Footer Information Links Block',
    'identifier' => 'rolta_footer_information_links_block',
    'content' => '<div class="footer-column-1">
<h3 class="title">Shopping Guide</h3>
<ul class="links">
<li class="first"><a title="About Us" href="{{store_url=about-us/}}"><span>&rsaquo;</span>About Us</a></li>
<li><a title="FAQs" href="#"><span>&rsaquo;</span>FAQs</a></li>
<li><a title="Payment" href="#"><span>&rsaquo;</span>Payment</a></li>
<li><a title="Shipment" href="#"><span>&rsaquo;</span>Shipment</a></li>
<li><a title="Where is my order?" href="#"><span>&rsaquo;</span>Where is my order?</a></li>
<li class="last"><a title="Return policy" href="#"><span>&rsaquo;</span>Return policy</a></li>
</ul>
</div>
<div class="footer-column-2">
<h3 class="title">Style Advisor</h3>
<ul class="links">
<li class="first"><a title="Your Account" href="{{store_url=customer/account/}}"><span>&rsaquo;</span>Your Account</a></li>
<li><a title="Information" href="#"><span>&rsaquo;</span>Information</a></li>
<li><a title="Addresses" href="#"><span>&rsaquo;</span>Addresses</a></li>
<li><a title="Addresses" href="#"><span>&rsaquo;</span>Discount</a></li>
<li><a title="Orders History" href="#"><span>&rsaquo;</span>Orders History</a></li>
<li class="last"><a title=" Additional Information" href="#"><span>&rsaquo;</span> Additional Information</a></li>
</ul>
</div>
<div class="footer-column-3">
<h3 class="title">Information</h3>
<ul class="links">
<li class="first"><a title="Site Map" href="{{store_url=catalog/seo_sitemap/category/}}"><span>&rsaquo;</span>Site Map</a></li>
<li><a title="Search Terms" href="{{store_url=catalogsearch/term/popular/}}"><span>&rsaquo;</span>Search Terms</a></li>
<li><a title="Advanced Search" href="{{store_url=catalogsearch/advanced/}}"><span>&rsaquo;</span>Advanced Search</a></li>
<li><a title="Contact Us" href="{{store_url=contacts}} "><span>&rsaquo;</span>Contact Us</a></li>
<li><a title="Suppliers" href="#"><span>&rsaquo;</span>Suppliers</a></li>
<li class=" last"><a class="link-rss" title="Our stores" href="#"><span>&rsaquo;</span>Our stores</a></li>
</ul>
</div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();


//Rolta Header Free Shipping Block
$staticBlock = array(
    'title' => 'Rolta Header Free Shipping Block',
    'identifier' => 'rolta_header_free_shipping_block',
    'content' => '<div class="free-shipping"><em class="icon-truck"></em> <span>Free shipping <br /> all order over $99</span></div>
<div class="money-back"><em class="icon-share-alt"></em> <span>Return &amp; Exchange <br /> in 3 working days</span></div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

//Rolta Home Slider Banner Block
$staticBlock = array(
    'title' => 'Rolta Home Slider Banner Block',
    'identifier' => 'rolta_home_slider_banner_block',
    'content' => '<div id="sequence-theme">
<div id="sequence">
<ul class="controls">
<li><a class="sequence-prev" style="display: inline;">Prev</a></li>
<li><a class="sequence-next" style="display: inline;">Next</a></li>
</ul>
<ul class="sequence-canvas">
<li class="animate-in"><a href="#"><img alt="slider image" src="{{skin url="images/slide1.png"}}" /></a></li>
<li class="animate-out"><a href="#"><img alt="slider image" src="{{skin url="images/slide2.png"}}" /></a></li>
<li class="animate-out"><a href="#"><img alt="slider image" src="{{skin url="images/slide3.png"}}" /></a></li>
</ul>
</div>
</div>',
    'is_active' => 1,
    'stores' => array(0)
);
Mage::getModel('cms/block')->setData($staticBlock)->save();

}
catch (Exception $e) {
    Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('An error occurred while installing Rolta theme pages and cms blocks.'));
}