| 1 |
<?php // $Id: Exp $ |
<?php // $Id: wghtml.module,v 1.1 2005/10/09 15:59:51 djnz Exp $ |
| 2 |
/** |
/** |
| 3 |
* @file wghtml.module |
* @file wghtml.module |
| 4 |
* |
* |
| 15 |
require_once dirname(__FILE__).'/wghtml_module_module.php'; |
require_once dirname(__FILE__).'/wghtml_module_module.php'; |
| 16 |
} |
} |
| 17 |
|
|
| 18 |
|
/** |
| 19 |
|
* Admin settings callback. |
| 20 |
|
*/ |
| 21 |
|
function wghtml_admin_settings() { |
| 22 |
|
/* |
| 23 |
|
$form['wghtml_updated'] = array('#type' => 'hidden', '#value' => time()); |
| 24 |
|
|
| 25 |
|
$form['paths'] = array('#type' => 'fieldset', '#title' => t('File paths')); |
| 26 |
|
$form['paths']['image_default_path'] = array('#type' => 'textfield', '#title' => t('Default image path'), '#default_value' => variable_get('image_default_path', 'images'), '#description' => t('Subdirectory in the directory "%dir" where pictures will be stored. Do not include trailing slash.', array('%dir' => variable_get('file_directory_path', 'files')))); |
| 27 |
|
|
| 28 |
|
$form['sizes'] = array('#type' => 'fieldset', '#title' => t('Image sizes')); |
| 29 |
|
$form['sizes']['image_sizes'] = image_settings_sizes_form(); |
| 30 |
|
|
| 31 |
|
return system_settings_form($form); |
| 32 |
|
*/ |
| 33 |
|
return 'The administration for wgHTML has note been done yet.'; |
| 34 |
|
} |
| 35 |
|
|
| 36 |
function &_wghtml_get_object() { |
function &_wghtml_get_object() { |
| 37 |
static $wghtml; |
static $wghtml; |
| 38 |
if ( !isset($wghtml) ) { |
if ( !isset($wghtml) ) { |
| 39 |
require_once dirname(__FILE__).'/wghtml/class_wghtml.php'; |
require_once dirname(__FILE__).'/wghtml/class_wghtml.php'; |
| 40 |
require_once dirname(__FILE__).'/wghtml/implement_'.$GLOBALS['wghtml_config']['implementation'].'.php'; |
require_once dirname(__FILE__).'/wghtml/implement_'.$GLOBALS['wghtml_config']['implementation'].'.php'; |
| 41 |
$wghtml =& new wghtml_implementation; |
$wghtml = new wghtml_implementation; |
| 42 |
} |
} |
| 43 |
return $wghtml; |
return $wghtml; |
| 44 |
} |
} |
| 48 |
// Drupal hooks --------------------------------------------------------------- |
// Drupal hooks --------------------------------------------------------------- |
| 49 |
|
|
| 50 |
|
|
|
|
|
|
/** |
|
|
* A custom theme function. |
|
|
*/ |
|
|
function theme_wghtml_not_used() { |
|
|
$output = '<div class="wghtml_order_info">'; |
|
|
$output .= t('The order is for %quantity %color items.', array('%quantity' => $node->quantity, '%color' => $node->color)); |
|
|
$output .= '</div>'; |
|
|
return $output; |
|
|
} |
|
|
|
|
| 51 |
/** |
/** |
| 52 |
* Implementation of hook_menu(). |
* Implementation of hook_menu(). |
| 53 |
*/ |
*/ |
| 68 |
// example code follows |
// example code follows |
| 69 |
if ($may_cache) { |
if ($may_cache) { |
| 70 |
$items[] = array('path' => 'node/add/wghtml', 'title' => t('wghtml node'), |
$items[] = array('path' => 'node/add/wghtml', 'title' => t('wghtml node'), |
| 71 |
'access' => user_access('create wghtml node')); |
'access' => user_access('edit wgHTML nodes')); |
| 72 |
} |
} |
| 73 |
|
|
| 74 |
return $items; |
return $items; |