Guest User

Untitled

a guest
Jan 24th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.95 KB | None | 0 0
  1. <?php
  2. // $Id: customsite.module
  3.  
  4. /**
  5. * @file
  6. * Custom functions for this site.
  7. */
  8.  
  9.  
  10. /**
  11. * Display help and module information
  12. * @param path which path of the site we're displaying help
  13. * @param arg array that holds the current path as would be returned from arg() function
  14. * @return help text for the path
  15. */
  16. function customsite_help($path, $arg) {
  17.   $output = '';  //declare your output variable
  18.   switch ($path) {
  19.     case "admin/help#customsite":
  20.       $output = '<p>'.  t("My custom test module") .'</p>';
  21.       break;
  22.   }
  23.   return $output;
  24. } // function customsite_help
  25.  
  26.  
  27.  
  28. function customsite_perm()
  29. {
  30.   return array('create customsite', 'edit customsite', 'access customsite');
  31.  
  32. }
  33.  
  34. function customsite_access($op, $node, $account) {
  35.   return NULL;
  36.  
  37. }
  38.  
  39.  
  40. function customsite_admin() {
  41.   $form = array();
  42.  
  43.   $form['customsite_maxdisp'] = array(
  44.     '#type' => 'textfield',
  45.     '#title' => t('Maximum number of links'),
  46.     '#default_value' => variable_get('customsite_maxdisp', 3),
  47.     '#size' => 2,
  48.     '#maxlength' => 2,
  49.     '#description' => t("The maximum number of links to display in the this customsite module."),
  50.     '#required' => TRUE,
  51.   );
  52.  
  53.   return system_settings_form($form);
  54. }
  55.  
  56. function customsite_menu() {
  57.   $items = array();
  58.  
  59.   $items['admin/settings/customsite'] = array(
  60.     'title' => t('customsite settings'),
  61.     'description' => 'Description for this module',
  62.     'page_callback' => 'drupal_get_form',
  63.     'page_arguments' => array('customsite_admin'),
  64.     'access_arguments' => array('access administration pages'),
  65.     'type' => MENU_NORMAL_ITEM,
  66.    );
  67.  
  68.   $items['customsite'] = array(
  69.     'title' => 'Customsite',
  70.     'page_callback' => 'customsite_all',
  71.     'access_arguments' => array('access customsite content'),
  72.     'type' => MENU_CALLBACK
  73.   );
  74.  
  75.   return $items;
  76. }
  77.  
  78. function customsite_all()
  79. {
  80.  
  81.   $page_content = '<p>blablablablabla test test test page content<br /></p>';
  82.  
  83. }
Add Comment
Please, Sign In to add comment