Pages

Showing posts with label plugin. Show all posts
Showing posts with label plugin. Show all posts

Sunday, May 5, 2013

Social Engine 4 - Adding a Menu Item to a Menu Specified under Module(create a menu plugin)

First things first

1. Create/Add a menu item to respective menu from admin

Layout=>Menu Editor

2. Now in table "engine4_core_menuitems" set the following attributes

name="credit_main_network" //we will use this later in code avoid spaces
module=Credit(your module name)
label=Network(label of your menu item)
plugin=Credit_Plugin_Menus
{"route" : "credit_general","action":network}


3. Next route will be defined in your "modulename/settings/manifest.php"

for example

'credit_general'=>array(
'route'=>'credits/:action/*',
'defaults'=>array(
      'module'=>'credit',
      'controller'=>'index',
      'action'=>'index'
      ),
'menu'=>'credit_main' //(from table engine4_core_menus)
'submenu'=> if any
'enabled'=>1,
'order'=>3
)

4. Now in plugin under your module create a file "Menus.php"(if not there)

and template it as follows

for example for me file was /module/credit/Plugin/menus.php

class Credit_Plugin_Menus
{
     // see name of menu from table we have used after underscore

    public function onMenuInitialize_CreditMainNetwork($row)
   {
           If(!Engine_Api::_()->user()->getViewers()->getIdentity())
           {
               return false;
           }
           return true;
   }
}

That's it you have successfully configured menu for your Module in Social Engine 4

Wednesday, November 28, 2012

Configure Eclipse for Android Dev/Tools not found Error

Just started up with my first development with Android here is the link to how to setup Android ADT Package in Eclipse...
 
http://developer.android.com/sdk/eclipse-adt.html#installing
 
Here is the link for complete guide.
 
http://developer.android.com/sdk/installing.html#Installing
 
And if you are still getting an error like tools not found in android sdk in Eclipse
  
Run Android SDK Manager from start menu 
 
On the top you will see SDK Path

copy that path(you won't be able to copy it practically.I meant just take a note of that path)

run eclipse 
 
it will show an error that tools not found in a given directory

click on window menu select preferences

select Android from the list on left hand side 
 
on the right hand side you will find "SDK Location". Copy that path next to that and Bingo issue resolved 

Thursday, November 8, 2012

Wordpress plugins posting form or data to another Page in plugin

Wordpress plugins posting form or data to another Page in plugin

 <form id="mikex-settings" action="<?php echo plugins_url('update.php', __FILE__) ?>">  
   <label>Search Text:</label> <input name="search" value="<?php echo $options['search'] ?>" type="text" /><br />  
   <label>Replace Text:</label> <input name="replace" value="<?php echo $options['replace'] ?>" type="text" /><br />  
   <label>Replace Color</label> <input name="replace-color" value="<?php echo $options['replace-color'] ?>" type="text" /><br />  
   <label>Toggle Color:</label> <input name="toggle" value="<?php echo $options['toggle'] ?>" type="text" /><br />  
   <input type="submit" value="Update" /><span class="update-status"></span>  
 </form>  


In this way we an call another page to show up completely of a plugin in case of searchboxes etc