<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Giga Promoters Blog</title>
	<link>http://www.gigapromoters.com/blog</link>
	<description>News, Developments and Best practices for programming</description>
	<pubDate>Sat, 10 May 2008 01:42:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Captcha Validation with 2 lines in CakePHP</title>
		<link>http://www.gigapromoters.com/blog/2008/05/09/captcha-validation-with-2-lines-in-cakephp/</link>
		<comments>http://www.gigapromoters.com/blog/2008/05/09/captcha-validation-with-2-lines-in-cakephp/#comments</comments>
		<pubDate>Sat, 10 May 2008 01:39:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Best Practices]]></category>

		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/05/09/captcha-validation-with-2-lines-in-cakephp/</guid>
		<description><![CDATA[Just wrote a captcha validator tool - behavior &#038; a helper to implement captcha quite fast. Here's what you'll do to add captcha verification:

In your controller, lets say I need captcha in registration form.

users_controller.php

PLAIN TEXT
PHP:




Function register&#40;&#41;


&#123;


&#160; &#160; &#160; &#160; $this-&#62;pageTitle ='User Registration';


&#160; &#160; &#160; &#160; // goes on…


&#160; &#160; &#160; &#160; $this-&#62;User-&#62;enableCaptcha&#40;&#41;;&#160; // this function [...]]]></description>
			<content:encoded><![CDATA[<p>Just wrote a captcha validator tool - behavior &#038; a helper to implement captcha quite fast. Here's what you'll do to add captcha verification:
</p>
<p>In your controller, lets say I need captcha in registration form.
</p>
<p>users_controller.php
</p>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">Function</span> register<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">pageTitle</span> =<span style="color:#FF0000;">'User Registration'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// goes on…</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">User</span>-&gt;<span style="color:#006600;">enableCaptcha</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">// this function will initialize the captcha code </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In the view, register.ctp
</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$form</span>-&gt;<span style="color:#006600;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'User'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'action'</span>=&gt;<span style="color:#FF0000;">'register'</span>, <span style="color:#FF0000;">'enctype'</span> =&gt; <span style="color:#FF0000;">'multipart/form-data'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$form</span>-&gt;<span style="color:#006600;">input</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'first_name'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$form</span>-&gt;<span style="color:#006600;">input</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'last_name'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;<span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$form</span>-&gt;<span style="color:#006600;">input</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'email'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$form</span>-&gt;<span style="color:#006600;">input</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'password'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'type'</span> =&gt; <span style="color:#FF0000;">'password'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?</span> <span style="color:#FF9933; font-style:italic;">// line below will generate the image and the input field as well ?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$captcha</span>-&gt;<span style="color:#006600;">show</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$form</span>-&gt;<span style="color:#006600;">submit</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Register'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;?&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/form&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>After data is posted through the form, it goes to beforeSave() of my behavior which takes care of the validating and showing up the error in case.
</p>
<p>This is the part of my UserContent behavior which will have some more cool shortcuts. Will post them in a while..
</p>
<p>- Abhimanyu Grover</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/05/09/captcha-validation-with-2-lines-in-cakephp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Experimental Searchable Behavior in CakePHP</title>
		<link>http://www.gigapromoters.com/blog/2008/05/07/experimental-searchable-behavior-in-cakephp/</link>
		<comments>http://www.gigapromoters.com/blog/2008/05/07/experimental-searchable-behavior-in-cakephp/#comments</comments>
		<pubDate>Thu, 08 May 2008 01:06:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Best Practices]]></category>

		<category><![CDATA[CakePHP]]></category>

		<category><![CDATA[behavior]]></category>

		<category><![CDATA[relevant search]]></category>

		<category><![CDATA[searchable]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/05/07/experimental-searchable-behavior-in-cakephp/</guid>
		<description><![CDATA[I always have bad time writing code for search in any new project. So, I decided to write a quick Searchable behavior in CakePHP so as to avoid doing it again and again in any project.

Please note: This only handles text based searches, and it's a very basic version, written in less than two hours.

Here's [...]]]></description>
			<content:encoded><![CDATA[<p>I always have bad time writing code for search in any new project. So, I decided to write a quick <strong>Searchable behavior</strong> in CakePHP so as to avoid doing it again and again in any project.
</p>
<p>Please note: This only handles text based searches, and it's a very basic version, written in less than two hours.
</p>
<p>Here's how it works:
</p>
<ol>
<li>
<div>In the model which you want to be searchable, just add:
</div>
<p>
<div class="igBar"><span id="lphp-7"><a href="#" onclick="javascript:showPlainTxt('php-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-7">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$actsAs</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Searchable'</span> =&gt; <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
</li>
<li>
<div>Now in controller you can use function called Model::stringSearch()
</div>
<p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// here your $keyword can be something like ‘nicole scherzinger’</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$videos</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">Video</span>-&gt;<span style="color:#006600;">stringSearch</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$keywords</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'title'</span>, <span style="color:#FF0000;">'description'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
</li>
</ol>
<p>Algorithm behind its functioning (inside Model::stringSearch()):
</p>
<ol>
<li>
<div>Search procedure 1: Consider $keywords as phrase, and fetch ids based on this phrase from the passed fields. So if you have passed on :
</div>
<p>$keywords = 'nicole scherzinger';
</p>
<p>$videos = $this-&gt;Video-&gt;stringSearch($keywords, array('title', 'description'));
</p>
<p>It will be treated as "nicole scherzinger", the results returned here will be marked as highest relevant results.
</p>
</li>
<li>Search Procedure 2: Find 'nicole' and 'scherzinger' together in given fields. Relevancy --
</li>
<li>Search Procedure 3: Find 'nicole' or 'scherzinger'. Relevancy decreased again.
</li>
<li>Now it combines all the ids returned from all 3 types of searches, in the same order of their relevancy. Then fetches records using findAllbyId() and returns them to caller.
</li>
</ol>
<p>Download it <a href="http://www.gigapromoters.com/blog/wp-content/uploads/searchable.phps">here</a>. Hope you people like it.
</p>
<p>P.S. My girlfriend will be angry when she will see  Nicole scherzinger here… So, if you're reading it, I'm sorry I was just working on this MP3 and Videos project, you know?? hehe <img src='http://www.gigapromoters.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
	</p>
<p>- Abhimanyu Grover</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/05/07/experimental-searchable-behavior-in-cakephp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing for Reusability: Taking advantage of Plugins in CakePHP</title>
		<link>http://www.gigapromoters.com/blog/2008/04/15/designing-for-reusability-taking-advantage-of-plugins-in-cakephp/</link>
		<comments>http://www.gigapromoters.com/blog/2008/04/15/designing-for-reusability-taking-advantage-of-plugins-in-cakephp/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 00:03:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Best Practices]]></category>

		<category><![CDATA[CakePHP]]></category>

		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[cakephp admin panel]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[reusability]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/04/15/designing-for-reusability-taking-advantage-of-plugins-in-cakephp/</guid>
		<description><![CDATA[Do you ever wanted to accomplish a better reusable CMS which helps you do things faster? If yes, you definitely need to know more about CakePHP Plugins. This manual about plugins is not just enough, there are many cool things you can do with them.

In this post, I will explain you, how to create a [...]]]></description>
			<content:encoded><![CDATA[<p>Do you ever wanted to accomplish a better reusable CMS which helps you do things faster? If yes, you definitely need to know more about CakePHP Plugins. This <a href="http://manual.cakephp.org/chapter/plugins">manual</a> about plugins is not just enough, there are many cool things you can do with them.
</p>
<p>In this post, I will explain you, how to create a reusable Backend Plugin, which can easily fit in with any of your project. Although, I've written a tutorial before on <a href="http://www.gigapromoters.com/blog/2007/12/14/cakephp-tutorial-how-to-create-an-administrator-panel-in-cakephp/">how to create an administrator panel</a>, but that is not so RAD approach.
</p>
<p>Creating necessary files for plugin:
</p>
<p>/app/plugins/backend
</p>
</p>
<p>Ok, now comes interesting part:
</p>
<p><span style="font-size:14pt"><strong>Telling Plugin about our Admin Links<br />
</strong></span></p>
<p>We will need our other controllers to tell Admin plugin about all the admin URLs/function. For this, we will create two new class variables called $admin_links and $admin_menu_order in all our controllers.
</p>
<div class="igBar"><span id="lphp-14"><a href="#" onclick="javascript:showPlainTxt('php-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-14">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">Class</span> ClientsController extends AppController</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">Var</span> <span style="color:#0000FF;">$name</span> = ‘Clients’;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$adminLinks</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'add'</span> =&gt; <span style="color:#FF0000;">'Add New Client, '</span>index<span style="color:#FF0000;">' =&gt; '</span>Show all clients<span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// add points to admin_add() and ‘Add New Client’ corresponds to the anchor of link.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$adminOrder</span> = <span style="color:#CC66CC;color:#800000;">1</span>;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// Ordering inside admin panel</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// functions etc goes here..</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Add these variables in all necessary controller files.
</p>
<p><span style="font-size:14pt"><strong>Plugin Connectivity to the rest of system<br />
</strong></span></p>
<p>Since our plugin needs to look each and every controller present in system. I decided to create BackendController::cacheAdminLinks(),this function will get all admin links as specified in controllers, then store it to a temporary cache file. This way, all controllers need not to be loaded in every call.
</p>
<div class="igBar"><span id="lphp-15"><a href="#" onclick="javascript:showPlainTxt('php-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-15">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> BackendController extends BackendAppController</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$name</span> = <span style="color:#FF0000;">'Backend'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">var</span> <span style="color:#0000FF;">$uses</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> cacheAdminLinks<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$adminLinks</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$ControllersPaths</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">// to store all controller paths</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// collect all controller paths to find backend links from</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$allPaths</span> = paths<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$appControllers</span> = <span style="color:#0000FF;">$allPaths</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Controllers'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// find controllers of other plugins</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$folder</span> =&amp; <span style="color:#000000; font-weight:bold;">new</span> Folder<span style="color:#006600; font-weight:bold;">&#40;</span>APP.<span style="color:#FF0000;">'plugins'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$plugins</span> = <span style="color:#0000FF;">$folder</span>-&gt;<span style="color:#006600;">ls</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$ControllersPaths</span> = am<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ControllersPaths</span>, <span style="color:#0000FF;">$appControllers</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// merge app with all paths</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$plugins</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$plugin</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$pluginControllers</span> = <span style="color:#0000FF;">$allPaths</span><span style="color:#006600; font-weight:bold;">&#91;</span>Inflector::<span style="color:#006600;">camelize</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$plugin</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'Controllers'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$ControllersPaths</span> = am<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ControllersPaths</span>, <span style="color:#0000FF;">$pluginControllers</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">//add plugin controllers path</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controllers</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">// to store all controllers here</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ControllersPaths</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$path</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$folder</span>-&gt;<span style="color:#006600;">cd</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$path</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controllerFiles</span> = <span style="color:#0000FF;">$folder</span>-&gt;<span style="color:#006600;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'.+_controller<span style="color:#000099; font-weight:bold;">\.</span>php$'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controllers</span> = am<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$controllers</span>, <a href="http://www.php.net/array_map"><span style="color:#000066;">array_map</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>&amp;<span style="color:#0000FF;">$this</span>, <span style="color:#FF0000;">'__controllerize'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$controllerFiles</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controllers</span> = <a href="http://www.php.net/array_unique"><span style="color:#000066;">array_unique</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$controllers</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$controllers</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$controller</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; App::<span style="color:#006600;">import</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Controller'</span>, <span style="color:#0000FF;">$controller</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$className</span> = <span style="color:#0000FF;">$controller</span>.<span style="color:#FF0000;">"Controller"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controllerInst</span> = <span style="color:#000000; font-weight:bold;">&amp;new</span> <span style="color:#0000FF;">$className</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/isset"><span style="color:#000066;">isset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$controllerInst</span>-&gt;<span style="color:#006600;">adminLinks</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$adminLinks</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$controllerInst</span>-&gt;<span style="color:#006600;">adminOrder</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'name'</span> =&gt; <span style="color:#0000FF;">$controllerInst</span>-&gt;<span style="color:#006600;">name</span>, <span style="color:#0000FF;">$controllerInst</span>-&gt;<span style="color:#006600;">adminLinks</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// reorder &amp; reform admin links in better form</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$tmp_adminLinks</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$adminLinks</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$adminLink</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$reformedLinks</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$links</span> = <span style="color:#0000FF;">$adminLink</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$adminLink</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$funcName</span> =&gt; <span style="color:#0000FF;">$link</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$tmp_reformedLink</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'url'</span> =&gt; <span style="color:#0000FF;">$this</span>-&gt;_getAdminUrl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$adminLink</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'name'</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#0000FF;">$funcName</span><span style="color:#006600; font-weight:bold;">&#41;</span> , <span style="color:#FF0000;">'title'</span> =&gt; <span style="color:#0000FF;">$link</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$reformedLinks</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> =&nbsp; <span style="color:#0000FF;">$tmp_reformedLink</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$tmp_adminLinks</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$adminLink</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'name'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$reformedLinks</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$adminLinks</span> = <span style="color:#0000FF;">$tmp_adminLinks</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>Configure::<span style="color:#006600;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'debug'</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$cacheExpires</span> = <span style="color:#FF0000;">'+5 seconds'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">elseif</span> <span style="color:#006600; font-weight:bold;">&#40;</span>Configure::<span style="color:#006600;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'debug'</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#CC66CC;color:#800000;">1</span> || Configure::<span style="color:#006600;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'debug'</span><span style="color:#006600; font-weight:bold;">&#41;</span>==<span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$cacheExpires</span> = <span style="color:#FF0000;">'+60 seconds'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$cacheExpires</span> = <span style="color:#FF0000;">'+24 hours'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; cache<span style="color:#006600; font-weight:bold;">&#40;</span>LINKS_CACHE_FILE, <a href="http://www.php.net/serialize"><span style="color:#000066;">serialize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$adminLinks</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$cacheExpires</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> _getAdminUrl<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$singular_name</span>, <span style="color:#0000FF;">$funcName</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#FF0000;">'/'</span>.Configure::<span style="color:#006600;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Routing.admin'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">'/'</span>.low<span style="color:#006600; font-weight:bold;">&#40;</span>Inflector::<span style="color:#006600;">pluralize</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$singular_name</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">'/'</span>.<span style="color:#0000FF;">$funcName</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> __controllerize<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> Inflector::<span style="color:#006600;">camelize</span><span style="color:#006600; font-weight:bold;">&#40;</span>r<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'_controller.php'</span>, <span style="color:#FF0000;">''</span>, <span style="color:#0000FF;">$file</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><span style="font-size:14pt"><strong>Setting up $layout &#038; $admin_links at every admin call<br />
</strong></span></p>
<p>Now, this is a bit tricky part – for every plugin you create in your app, you wouldn't want to add custom hacks anywhere throughout your app for every plugin. This is where you can utilize plugin hooks, as introduced by Felix in <a href="http://www.thinkingphp.org/2006/06/24/welcome-to-the-dark-side-of-plugins-in-cakephp/">this post</a>. I wouldn't go too deep to explain how it works, but it just basically allows you to create a file hooks.php inside your plugin folder. You can attach these hooks with your app, in this case just attach it to AppController::beforeFilter()
</p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> beforeFilter<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; callHooks<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'beforeFilter'</span>, <span style="color:#000000; font-weight:bold;">null</span>, <span style="color:#0000FF;">$this</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// you need to have this function defined somewhere – I guess bootstrap.php in best place </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In our hooks.php, we will create following function:
</p>
<div class="igBar"><span id="lphp-17"><a href="#" onclick="javascript:showPlainTxt('php-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-17">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// this function will be called by AppController::beforeFilter() on every HTTP request</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> BackendbeforeFilterHook<span style="color:#006600; font-weight:bold;">&#40;</span>&amp;<span style="color:#0000FF;">$controller</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// if its the administrator/manager - change the layout</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$pos</span> = <a href="http://www.php.net/strpos"><span style="color:#000066;">strpos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'REQUEST_URI'</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#FF0000;">'admin'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$pos</span> == <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controller</span>-&gt;<span style="color:#006600;">plugin</span>=<span style="color:#FF0000;">'backend'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controller</span>-&gt;<span style="color:#006600;">layout</span>=<span style="color:#FF0000;">'admin'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$adminLinks</span> = <a href="http://www.php.net/unserialize"><span style="color:#000066;">unserialize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>cache<span style="color:#006600; font-weight:bold;">&#40;</span>LINKS_CACHE_FILE, <span style="color:#000000; font-weight:bold;">null</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$controller</span>-&gt;<span style="color:#006600;">set</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'adminLinks'</span>, <span style="color:#0000FF;">$adminLinks</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As you can see, an instance of controller is being passed to this function, and you can modify it as per your needs. So, we just overwritten the layout to admin.ctp inside app/plugins/backend/views/layouts and as also set our admin links to view from cache (saved by BackendController::cacheAdminLinks() )
</p>
<div><span style="font-size:14pt"><strong>Create admin.ctp<br />
</strong></span></div>
</p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showPlainTxt('php-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-18">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;div id=<span style="color:#FF0000;">"content"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;div id=<span style="color:#FF0000;">"menu"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?</span> <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$adminLinks</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$title</span>=&gt;<span style="color:#0000FF;">$adminLink</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div <span style="color:#000000; font-weight:bold;">class</span>=<span style="color:#FF0000;">"admin_box"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?</span>=<span style="color:#0000FF;">$title</span>;?&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ul&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?</span> <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$adminLink</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$link</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=<span style="color:#FF0000;">"&lt;?=$html-&gt;url($link['url']);?&gt;"</span>&gt;&lt;?=<span style="color:#0000FF;">$link</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'title'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;?&gt;&lt;/a&gt;&lt;/li&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/ul&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;div id=<span style="color:#FF0000;">"admin_content"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$session</span>-&gt;<span style="color:#006600;">check</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Message.flash'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$session</span>-&gt;<span style="color:#006600;">flash</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">endif</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$content_for_layout</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/div&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This plugin gives you a nice looking basic backend panel, by just dropping a folder. [except you have to have callHooks() in your bootstrap.php, however this function is not just for this specific plugin, it will be utilized while working with other plugins as well]
</p>
<p>I think the idea of connecting plugins with hooks is amazing, I just realized that it can increase reusability greatly. Just drop folders to your app, and add up a new functionality instantly. There was a project called <a href="http://cakeforge.org/projects/spliceit/">SpliceIt</a> started in Feb 2006 – which was fully based on plugins, but its not active anymore.
</p>
<p>Hope you liked this idea and tutorial. I would like to thank my friend Jacob Mather, he originally inspired me to implement reusability this way.
</p>
<p>- Abhimanyu Grover</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/04/15/designing-for-reusability-taking-advantage-of-plugins-in-cakephp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting into Semantics with Semantic Hacker</title>
		<link>http://www.gigapromoters.com/blog/2008/03/19/getting-into-semantics-with-semantic-hacker/</link>
		<comments>http://www.gigapromoters.com/blog/2008/03/19/getting-into-semantics-with-semantic-hacker/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 03:41:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Ideas]]></category>

		<category><![CDATA[Semantic Web]]></category>

		<category><![CDATA[agents]]></category>

		<category><![CDATA[ai]]></category>

		<category><![CDATA[intellegent]]></category>

		<category><![CDATA[semantics]]></category>

		<category><![CDATA[semanticweb]]></category>

		<category><![CDATA[web]]></category>

		<category><![CDATA[web3.0]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/03/19/getting-into-semantics-with-semantic-hacker/</guid>
		<description><![CDATA[Just came across a different type of API just now… It's the world's first API for semantic discovery. From long time back, I used to dream about the API or some Web service which could easily understand the context and classify information using its special intelligence, today its reality. Yes guys, check out Semantic Hacker [...]]]></description>
			<content:encoded><![CDATA[<p><img align="right" src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/03/032008-0341-gettinginto12.png" alt=""/>Just came across a different type of API just now… It's the world's first API for semantic discovery. From long time back, I used to dream about the API or some Web service which could easily understand the context and classify information using its special intelligence, today its reality. Yes guys, check out <a href="http://www.semantichacker.com/">Semantic Hacker</a> they have released API today itself. This API can return you the context / Semantic Signature of any information you enter.
</p>
<p>See it yourself in action, I just pasted one article from my blog (<a href="http://www.gigapromoters.com/blog/2008/03/11/how-indian-service-providers-can-survive-new-downfall-in-indian-outsourcing-industry/">tips for Indian service providers</a>) [Right now it limits upto 2000 chars only – so that's okay…]
</p>
<p><img src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/03/032008-0341-gettinginto22.png" alt=""/>
	</p>
<p>And press submit
</p>
<p><img src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/03/032008-0341-gettinginto32.png" alt=""/>
	</p>
<p><img align="right" src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/03/032008-0341-gettinginto42.png" alt=""/>You can see how smartly, it has given out the categories to which this topic belongs. Even google search is not capable of doing that as of now, so I can confidently say that something like this is going to change the way of search. No more punishments of using wrong keywords, and no more would web stay as old boring thing – you would actually start interacting with it, like you do with other humans (in future..).
</p>
<p>SemanticHacker offers API free of cost, which can be found <a href="http://www.semantichacker.com/api">here</a>. Some of examples and tools <a href="http://www.semantichacker.com/api/example-tools">here</a>.
</p>
<p>If you like to learn more about semantic web, you could start by this book called <a href="http://www.oreilly.com/catalog/9780596529321/">Programming Collective Intelligence</a> by O'Reilly. I've already purchased a copy a month back but not started yet. I'll post a review whenever I'm done with it. This is really nice book though from what I've seen in first few chapters.
</p>
<p>-Abhimanyu Grover</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/03/19/getting-into-semantics-with-semantic-hacker/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BullsCash.com – India’s First Finance News Aggregator</title>
		<link>http://www.gigapromoters.com/blog/2008/03/19/bullscashcom-%e2%80%93-india%e2%80%99s-first-finance-news-aggregator/</link>
		<comments>http://www.gigapromoters.com/blog/2008/03/19/bullscashcom-%e2%80%93-india%e2%80%99s-first-finance-news-aggregator/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 18:58:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Our Apps]]></category>

		<category><![CDATA[aggregator]]></category>

		<category><![CDATA[finance]]></category>

		<category><![CDATA[india]]></category>

		<category><![CDATA[news]]></category>

		<category><![CDATA[stock market]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/03/19/bullscashcom-%e2%80%93-india%e2%80%99s-first-finance-news-aggregator/</guid>
		<description><![CDATA[We have just launched BullsCash.com, a new finance news portal which collects news from almost 80-100 different sources and aggregates them together. It can be said to be first Indian Finance news portal in its own kind.  It aims to help people in collecting quality information in lesser time. How much time would you [...]]]></description>
			<content:encoded><![CDATA[<p>We have just launched <a href="http://www.bullscash.com/">BullsCash.com</a>, a new finance news portal which collects news from almost 80-100 different sources and aggregates them together. It can be said to be first <a href="http://www.bullscash.com/">Indian Finance news portal</a> in its own kind.  It aims to help people in collecting quality information in lesser time. How much time would you spend daily reading news about shares, Mutual funds, IPOs etc from 100 sources?? And how many of them would be irrelevant or not important for you? BullsCash tries its collective approach to fetch all news from different channels and then estimates it worth…
</p>
<p>How BullsCash helps?
</p>
<ul>
<li><img align="right" src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/03/031908-1858-bullscashco11.jpg" alt=""/><strong>Time Saver: </strong>BullsCash reduces time and effort needed to regularly check websites for updates. People under finance sector in India spend hours in reading irrelevant/unimportant news. It lets you go through important news only – that too in min. time.<strong><br />
			</strong></li>
<li><strong>Web-Based: </strong>No need to run any software or configure anything. You can just start using it as your source of information.<strong><br />
			</strong></li>
<li><strong>Filtering &#038; Ranking:</strong>  BullsCash crawlers checks news links for their popularity and vote them accordingly.<strong><br />
			</strong></li>
</ul>
<p>BullsCash crawls majorly following news portals as of now:
</p>
<ul>
<li>Money Control
</li>
<li>Multiple Channels on Economic Times
</li>
<li>Multiple Channels on Business Line
</li>
</ul>
<p>We are targeting for more advanced and smart crawlers which are capable to cover even more and more sources online and vote automatically based on the popularity of a particular link.
</p>
<p>Features for Future:
</p>
<ul>
<li>More sources to be covered
</li>
<li>Better Algorithms to mark important news
</li>
<li>Personalized approach for different people
</li>
<li>Source suggestion
</li>
</ul>
<p>We hope this application will help people in finance industry. Once this website start gaining members and traffic, we'll soon work out on our plan for its expansion and will also schedule the features.
</p>
</p>
<p>Abhimanyu Grover</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/03/19/bullscashcom-%e2%80%93-india%e2%80%99s-first-finance-news-aggregator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Book Review: Webbots, Spiders, and Screen Scrapers</title>
		<link>http://www.gigapromoters.com/blog/2008/03/13/book-review-webbots-spiders-and-screen-scrapers/</link>
		<comments>http://www.gigapromoters.com/blog/2008/03/13/book-review-webbots-spiders-and-screen-scrapers/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 01:14:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Best Practices]]></category>

		<category><![CDATA[building]]></category>

		<category><![CDATA[intelligent agents]]></category>

		<category><![CDATA[spiders]]></category>

		<category><![CDATA[web scrapers]]></category>

		<category><![CDATA[webbots]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/03/13/book-review-webbots-spiders-and-screen-scrapers/</guid>
		<description><![CDATA[Michael Schrenk demonstrates some nice web bots and spidering techniques in his great book called Webbots, Spiders, and Screen Scrapers. Spidering is a subject which is least discussed on internet and you could not find any good libraries on it easily. A lot of examples and techniques are provided throughout the book. Author has also [...]]]></description>
			<content:encoded><![CDATA[<p><img align="right" src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/03/031408-0114-bookrevieww16.jpg" alt=""/>Michael Schrenk demonstrates some nice web bots and spidering techniques in his great book called <a href="http://www.schrenk.com/nostarch/webbots/">Webbots, Spiders, and Screen Scrapers</a>. Spidering is a subject which is least discussed on internet and you could not find any good libraries on it easily. A lot of examples and techniques are provided throughout the book. Author has also provided some demo libraries using which you can start almost instantly.
</p>
<p>This is a kind of essential book if you're a newbie and looking to get your hands on new fields.
</p>
<ul>
<li>Now in the age of Web2.0, Most of our projects involve building spiders, crawlers and other type of web bots.
</li>
<li>Developing a webbot involved whole new mindset.
</li>
<li>Once you start learning, you will automatically get new ideas for your clients and your own processes.
</li>
<li>Learn from the author's 11 year career of writing webbots and spiders.
</li>
<li>Helps implementing Automation in your life.
</li>
</ul>
<p>This book has certainly lot more to offer than what I wrote…  Highly Recommended!!
</p>
</p>
<p>- Abhimanyu Grover
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/03/13/book-review-webbots-spiders-and-screen-scrapers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Indian service providers can survive new downfall in Indian Outsourcing Industry&#8230;</title>
		<link>http://www.gigapromoters.com/blog/2008/03/11/how-indian-service-providers-can-survive-new-downfall-in-indian-outsourcing-industry/</link>
		<comments>http://www.gigapromoters.com/blog/2008/03/11/how-indian-service-providers-can-survive-new-downfall-in-indian-outsourcing-industry/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 19:42:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Articles]]></category>

		<category><![CDATA[Best Practices]]></category>

		<category><![CDATA[business]]></category>

		<category><![CDATA[india]]></category>

		<category><![CDATA[outsourcing]]></category>

		<category><![CDATA[outsourcing industry]]></category>

		<category><![CDATA[prediction]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/03/11/how-indian-service-providers-can-survive-new-downfall-in-indian-outsourcing-industry/</guid>
		<description><![CDATA[There are number of reports which claim that Indian Outsourcing industry is coming to its end. This might not be the case, but you can expect a great downfall in coming years.
The report analyzed the rolling out of global delivery centres by the UK's 20 largest IT services suppliers – Accenture, Capgemini, IBM and HP [...]]]></description>
			<content:encoded><![CDATA[<p>There are number of reports which claim that Indian Outsourcing industry is coming to its end. This might not be the case, but you can expect a great downfall in coming years.</p>
<blockquote><p>The report analyzed the rolling out of global delivery centres by the UK's 20 largest IT services suppliers – Accenture, Capgemini, IBM and HP among them - and found that of the 21 centres opened since January 2007, just two were in India. Findings that offer further evidence of the threat to India's traditional dominance.</p>
</blockquote>
<p><span style="text-decoration: underline">Source</span>: <a href="http://blog.europeanleaders.net/procurement-blog/2008/3/11/indian-offshoring-dominance-under-threat.html">http://blog.europeanleaders.net/procurement-blog/2008/3/11/indian-offshoring-dominance-under-threat.html</a><br />
At this point, people associated with this industry are likely to have some sufferings. However, you can do something to help your career and minimize the effect of this downfall. Here are seven things which small companies or freelancers should consider:</p>
<ol>
<li><strong>Select an Industry &#038; Business domain to serve</strong>.<br />
Indian Outsourcing was growing since last a few years, and it is pretty matured by now, but there are more countries like China, Morocco and Hungary, which are joining this global market and they might even have lesser prices than where we stand right now. This would result us in failing to compete over price. You can no more expect yourself to serve in multiple business domains or technologies, rather you'll have to check for the market imbalances and then exploit them. A PHP developer might be easily available in other countries, but if you present yourself as an experienced Python developer – and if there is a demand, then you can charge your regular prices.</li>
<li><strong>Public Exposure of your skills</strong>.<br />
This might be obvious; you might not have got time to write or blog about your technical expertise. But now as more competition enters the market, you'll need yourself to differentiate from others in some way. People like to buy from an expert not a follower. You need to show how your expertise can help them or their businesses. If you follow the point above, and target to selected industry only – that might even produce better results.</li>
<li><strong>Develop passion or leave the Industry</strong>.<br />
If you are not passionate about the industry, just quit and search for another Industry. Get yourself involved into an open source and let other people benefit from your passion. In long run, you will be the one who gets more benefits and success.</li>
<li><strong>Stretch your skills to your limit</strong>.<br />
I see a problem with many Indian programmers – they are not willing to learn new things. Many programmers I've worked with are satisfied with their present skill-set and don't want to grow skills. They are happy with the pay-checks and increments they are getting. Some of these increments, if we look into depth are because of the boost in industry, not because a particular guy started working better or effectively. When this boom goes down, you will get lesser than what you are getting now. By continuously growing your technical skill-set you can survive.</li>
<li><strong>Automate Automate Automate.<br />
</strong>In order to work more effectively, we have to work more effectively than ever. To do so, you cannot increase time in a day – but what you can do is take advantage of the automation. Write your own code generators, reusable classes, or focus on automating and task you would do repetitively. If you spend even 1 hour daily on this – chances are you will achieve more for your clients in less time.</li>
<li><strong>Start some side projects.</strong><br />
This might be a difficult one for many teams or individuals, but developing a side project (like a web app) can be turned as your asset – which should provide you not only money but the value to your customers. If you can create success from your own app, then you surely can help them out. Think building your services as a famous brand.</li>
<li><strong>Learn to communicate with your clients in their own words.</strong><br />
Being too technical with clients sometimes helps, but when you learn their businesses and talk in their business terms it makes them more comfortable in dealing with you.</li>
</ol>
<p><span style="font-size: 12pt"><strong>Why you need to do all this?<br />
</strong></span></p>
<ul>
<li>The cost advantage for offshoring to India used to be at least 1:6. Today, it is at best 1:3.<strong><br />
</strong></li>
<li>As the 1:3 cost structure becomes 1:1.5, it will soon become inefficient to use Indian labor.<strong><br />
</strong></li>
<li>Jobs that are low value-added and easily automatable should and will disappear over the next decade.<strong><br />
</strong></li>
<li>The Indians don't do the thinking. The customers do. India executes.<strong><br />
</strong></li>
<li>India's $30 billion IT/ITES services industry, meanwhile, is slowly and surely losing its competitive advantage.<strong><br />
</strong></li>
<li>Assuming a 15% year-to-year salary hike rate, and a 2007 cost advantage of 1:3 in favor of India, if U.S. wages remain constant, India's cost advantage disappears by 2015.<strong><br />
</strong></li>
</ul>
<p><a href="http://www.forbes.com/technology/enterprisetech/2008/02/29/mitra-india-outsourcing-tech-enter-cx_sm_0229outsource.html"><strong>- According to a report by Sramana Mitra</strong></a><strong><br />
</strong></p>
<p><strong>Still need another reason..?</strong></p>
<p>- Abhimanyu Grover</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/03/11/how-indian-service-providers-can-survive-new-downfall-in-indian-outsourcing-industry/feed/</wfw:commentRss>
		</item>
		<item>
		<title>jQuery Issues with IE – “Operation Aborted” errors</title>
		<link>http://www.gigapromoters.com/blog/2008/03/07/jquery-issues-with-ie-%e2%80%93-%e2%80%9coperation-aborted%e2%80%9d-errors/</link>
		<comments>http://www.gigapromoters.com/blog/2008/03/07/jquery-issues-with-ie-%e2%80%93-%e2%80%9coperation-aborted%e2%80%9d-errors/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 09:58:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[issues]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/03/07/jquery-issues-with-ie-%e2%80%93-%e2%80%9coperation-aborted%e2%80%9d-errors/</guid>
		<description><![CDATA[If you have some old applications using jQuery 1.1 or lower versions, you might be loosing visitors who use IE, because of a nagging "Operation Aborted" IE dialog. After wasting 2-3 hours on the same subject, I've been able to fix it quickly after I updated to jQuery 1.2.3

I didn't have time to jump into [...]]]></description>
			<content:encoded><![CDATA[<p>If you have some old applications using jQuery 1.1 or lower versions, you might be loosing visitors who use IE, because of a nagging "Operation Aborted" IE dialog. After wasting 2-3 hours on the same subject, I've been able to fix it quickly after I updated to jQuery 1.2.3
</p>
<p>I didn't have time to jump into the depth of this error, but looks like jQuery did a good job in solving the bug. So, don't forget to update to the <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.3.min.js">latest version here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/03/07/jquery-issues-with-ie-%e2%80%93-%e2%80%9coperation-aborted%e2%80%9d-errors/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DrasticDeals.com – A coupon search engine</title>
		<link>http://www.gigapromoters.com/blog/2008/03/06/drasticdealscom-%e2%80%93-a-coupon-search-engine/</link>
		<comments>http://www.gigapromoters.com/blog/2008/03/06/drasticdealscom-%e2%80%93-a-coupon-search-engine/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 02:04:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Our Apps]]></category>

		<category><![CDATA[coupons]]></category>

		<category><![CDATA[deals]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[search engine]]></category>

		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/blog/2008/03/06/drasticdealscom-%e2%80%93-a-coupon-search-engine/</guid>
		<description><![CDATA[We recently launched a website for our client called DrasticDeals.com. This website is built in CakePHP and includes a data scrapper which looks for coupon codes from multiple places. This is what it makes the application special, at the time of launch, this website had great database of coupons – amazingly 25,000+ coupons. This search [...]]]></description>
			<content:encoded><![CDATA[<p>We recently launched a website for our client called <a href="http://www.drasticdeals.com/">DrasticDeals.com</a>. This website is built in CakePHP and includes a data scrapper which looks for coupon codes from multiple places. This is what it makes the application special, at the time of launch, this website had great database of coupons – amazingly 25,000+ coupons. This search engine has already proved as a great success for our client in very first week. You'll be seeing some more enhancement in this project soon.
</p>
<p><a href="http://www.gigapromoters.com/pages/contact">Contact Us</a> today to get a free quote for your web app.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/03/06/drasticdealscom-%e2%80%93-a-coupon-search-engine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Killer Applications with CakePHP, JQuery and Adobe Air</title>
		<link>http://www.gigapromoters.com/blog/2008/02/28/killer-applications-with-cakephp-jquery-and-adobe-air/</link>
		<comments>http://www.gigapromoters.com/blog/2008/02/28/killer-applications-with-cakephp-jquery-and-adobe-air/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 11:34:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<category><![CDATA[Latest Developments]]></category>

		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[adobe air]]></category>

		<category><![CDATA[connectivity]]></category>

		<category><![CDATA[desktop applications]]></category>

		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://www.gigapromoters.com/newsite/gpo_design/blog/?p=35</guid>
		<description><![CDATA[Have you ever wished to program desktop applications for your own web app? If you are like me, that is, most of the lazy web programmers… you never put your hands on any desktop language. Even though all of us knows what flexibility can be given to a web app if we develop its desktop [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wished to program desktop applications for your own web app? If you are like me, that is, most of the lazy web programmers… you never put your hands on any desktop language. Even though all of us knows what flexibility can be given to a web app if we develop its desktop based client.</p>
<p>I came across a new development framework, <a href="http://www.adobe.com/products/air/">Adobe AIR</a>, which lets you build cool desktop based application simply with web technologies. If you are good at HTML and AJAX you can easily start with this new framework. I was surprised to see that there are <a href="http://www.readwriteweb.com/archives/some_adobe_air_apps_worth_a_look.php">so many applications</a> already using this. After just 3 hrs of experimentation with this, I started loving this new tool. It is very cool. Some advantages which impressed me are:</p>
<ul>
<li><strong>Real Fast</strong>: I built a stock market monitoring tool in just 3 hrs. It didn't look like I had to learn something new, everything went smooth. It was like developing AJAX enabled HTML pages and testing them in browser. Once you're done, you simply create xml configuration files, copy a JS from framework, compile it, and you're done.</li>
<li><strong>Use your favorite JS Library</strong>: This is an amazing feature. My personal favorite is JQuery and I use it in almost every project. Please note: you have to have the latest version of JQuery to get it working with Adobe AIR. They <a href="http://jquery.com/blog/2008/02/08/jquery-123-air-namespacing-and-ui-alpha/">recently patched</a> for Adobe AIR only. I already wasted 30 minutes in solving security issues.</li>
<li><strong>Cool CSS Extensions</strong>: <a href="http://livedocs.adobe.com/air/1/devappshtml/help.html?content=AboutHTMLEnvironment_6.html">Check this out</a>.</li>
<li><strong>Easy Debugging</strong>: Any errors/exceptions appear in command window.</li>
<li><strong>Easy Drag and Drop: </strong>Super-easy functions like dragstart, drag, dragend, dragenter, dragover, dragleave, and drop.<strong><br />
</strong></li>
</ul>
<p>Check out my stock market tool, just a basic version:</p>
<p><img src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/02/022808_1134_KillerAppli13.jpg" /></p>
<p><img src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/02/022808_1134_KillerAppli23.jpg" /></p>
<p>Everything is linked to a backend application which runs on CakePHP. Login function (UsersController::login) returns session_key to the desktop application if login is successful.</p>
<p>
<div class="igBar"><span id="ljavascript-20"><a href="#" onclick="javascript:showPlainTxt('javascript-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-20">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> process_login<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span>&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"#status"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Logging in..."</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">user=$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#user'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'value'</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pass=$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'#pass'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'value'</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"http://localhost/StockBack/users/login/"</span>+user+<span style="color: #3366CC;">"/"</span>+pass, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>session_key<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>session_key==<span style="color: #3366CC;">'false'</span><span style="color: #66cc66;">&#41;</span>&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span>&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"#status"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Unable to login"</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span>&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"#status"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Logged in successfully"</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"#login"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"slow"</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"#panel"</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"slow"</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;&lt;br /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>(Sorry for posting code like this but my code editor in wordpress sucks – if anyone knows a good one, please recommend me)</p>
<p><img src="http://www.gigapromoters.com/blog/wp-content/uploads/2008/02/022808_1134_KillerAppli33.jpg" /></p>
<p><strong>To start learning, some important links are:<br />
</strong></p>
<p><a href="http://www.adobe.com/go/learn_air_html">Developing Adobe AIR Applications with HTML and Ajax</a></p>
<p><a href="http://www.adobe.com/go/learn_air_html_qs">Adobe AIR Quick Starts for HTML</a></p>
<p><a href="http://www.adobe.com/go/learn_air_html_jslr">Adobe AIR Language Reference for HTML Developers</a></p>
<p><strong>The Adobe AIR HTML documentation set (a ZIP file) is available for download here:<br />
</strong></p>
<p><a href="http://www.adobe.com/go/learn_air_html_docs">http://www.adobe.com/go/learn_air_html_docs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gigapromoters.com/blog/2008/02/28/killer-applications-with-cakephp-jquery-and-adobe-air/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
