Pages

Tuesday, February 15, 2011

Module Of Me

This is the info file: me.info
name = Me Module
package = Indonesia
description = This module provide explanation of me
core = 7.x
version = 1.0

This is the module file: me.module
<?php

/**
 * A module implements hook_menu()
 *
 * @name    : Module Of Me
 * @author  : irfanudin ridho
 * @email   : irfan.ub@gmail.com
 * @version : 1.0
 * @date    : Pebruary 15, 2010
 */
 
/**
 * Implements hook_menu()
 */
 
function me_menu(){
    $items = array();
   
    $items['indonesia/main'] = array(
        'type' => MENU_NORMAL_ITEM,
        'title' => 'Module Of Me',
        'page callback' => 'intro',
        'access callback' => TRUE,
    );   
   
    $items['indonesia/main/default'] = array(
        'type' => MENU_DEFAULT_LOCAL_TASK,
        'title' => 'Hacking',
        'page callback' => 'hacking',
        'access callback' => TRUE,   
        'weight' => 1,
    );
   
    $items['indonesia/main/business'] = array(
        'type' => MENU_LOCAL_TASK,
        'title' => 'Business',
        'page callback' => 'business',
        'access callback' => TRUE,
        'weight' => 2,
    );
   
    $items['indonesia/main/funding'] = array(
        'type' => MENU_LOCAL_TASK,
        'title' => 'Funding',
        'page callback' => 'funding',
        'access callback' => TRUE,
        'weight' => 3,
    );
   
    return $items;
}

function intro(){
    return hacking();
}

function hacking(){
    $hack = '<div><h1>Web</h1>';
    $hack .= '<ol><li>jQuery</li>';
    $hack .= '<li>Drupal</li>';
    $hack .= '<li>CodeIgniter</li>';
    $hack .= '</ol></div>';
   
    return $hack;
}

function business(){
    $business = '<div><h1>Technology</h1>';
    $business .= '<ol><li>Software</li>';
    $business .= '<li>HealthCare</li>';
    $business .= '<li>Material</li>';
    $business .= '<li>Energy</li>';
    $business .= '</ol></div>';
   
    return $business;
}

function funding(){
    $fund = '<div><h1>Sponsors</h1>';
    $fund .= '<ol><li>Wikipedia</li>';
    $fund .= '<li>Linux Kernel</li>';
    $fund .= '<li>Arema Indonesia</li>';
    $fund .= '</ol></div>';
   
    return $fund;
}

No comments:

Post a Comment