This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<Inchoo_Phonebook> | |
<active>true</active> | |
<codePool>local</codePool> | |
<depends> | |
<Mage_Core /> | |
<Mage_Eav /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<config> | |
<modules> | |
<Inchoo_Phonebook> | |
<version>1.0.0.0</version> | |
</Inchoo_Phonebook> | |
</modules> | |
<global> | |
<models> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Inchoo_Phonebook_Model_User extends Mage_Core_Model_Abstract | |
{ | |
/** | |
* Maps to the array key from Setup.php::getDefaultEntities() | |
*/ | |
const ENTITY = 'inchoo_phonebook_user'; | |
protected $_eventPrefix = 'inchoo_phonebook'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Inchoo_Phonebook_Model_Resource_User extends Mage_Eav_Model_Entity_Abstract | |
{ | |
public function __construct() | |
{ | |
$resource = Mage::getSingleton('core/resource'); | |
$this->setType(Inchoo_Phonebook_Model_User::ENTITY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Inchoo_Phonebook_Model_Resource_User_Collection extends Mage_Eav_Model_Entity_Collection_Abstract | |
{ | |
protected function _construct() | |
{ | |
$this->_init('inchoo_phonebook/user'); | |
} | |
protected function _initSelect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Inchoo_Phonebook_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup { | |
public function getDefaultEntities() { | |
return array( | |
Inchoo_Phonebook_Model_User::ENTITY => array( | |
'entity_model' => 'inchoo_phonebook/user', | |
'table' => 'inchoo_phonebook/user', /* Maps to the config.xml > global > models > inchoo_phonebook_resource > entities > user */ | |
'attributes' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* @var $installer Inchoo_Phonebook_Model_Resource_Setup */ | |
$installer = $this; | |
$installer->startSetup(); | |
/* Create table 'inchoo_phonebook/user' */ | |
$table = $installer->getConnection() | |
->newTable($installer->getTable('inchoo_phonebook/user')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$phonebookUser = Mage::getModel('inchoo_phonebook/user'); | |
$phonebookUser->setFristname('John'); | |
$phonebookUser->setLastname('Doe'); | |
$phonebookUser->setEmail('john.doe@magento.com'); | |
$phonebookUser->setAddress('Sample address line here'); | |
$phonebookUser->setIsActive(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Branko Ajzele <ajzele@gmail.com> | |
*/ | |
class Inchoo_Extension_Helper_Gmap extends Mage_Core_Helper_Abstract | |
{ | |
const GOOGLE_MAPS_HOST = 'maps.google.com'; | |
const CONFIG_PATH_GOOGLE_MAPS_API_KEY = 'inchoo_google/maps/api_key'; | |
public function getGoogleMapsApiKey() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Branko Ajzele <ajzele@gmail.com> | |
*/ | |
if (version_compare(phpversion(), '5.2.0', '<')===true) { | |
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>'; | |
exit; | |
} |
OlderNewer