/[drupal]/contributions/modules/metrics/metrics.module
ViewVC logotype

Diff of /contributions/modules/metrics/metrics.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3, Mon Aug 20 18:39:09 2007 UTC revision 1.4, Mon Aug 20 18:52:19 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: metrics.module,v 1.2 2007/08/02 20:46:11 drewish Exp $  // $Id: metrics.module,v 1.3 2007/08/20 18:39:09 drewish Exp $
3    
4  /**  /**
5   * Implementation of hook_help().   * Implementation of hook_help().
# Line 90  function metrics_menu($may_cache) { Line 90  function metrics_menu($may_cache) {
90            'type' => MENU_LOCAL_TASK,            'type' => MENU_LOCAL_TASK,
91          );          );
92          $items[] = array(          $items[] = array(
93            'path' => 'admin/content/metrics/'. $property_id .'/ranking',            'path' => 'admin/content/metrics/'. $property_id .'/rankings',
94            'title' => t('Ranking'),            'title' => t('Rankings'),
95            'callback' => 'drupal_get_form',            'callback' => 'drupal_get_form',
96            'callback arguments' => array('metrics_rankings_form', $property),            'callback arguments' => array('metrics_rankings_form', $property),
97            'type' => MENU_LOCAL_TASK,            'type' => MENU_LOCAL_TASK,
# Line 335  function metrics_compute_property($prope Line 335  function metrics_compute_property($prope
335    
336  /**  /**
337   * Return an array of the metrics computation functions.   * Return an array of the metrics computation functions.
338     *
339     * @param $refresh
340     *   Boolean indicating if the list should be fully recomputed.
341     * @return
342     *   An array of function names.
343   */   */
344  function _metrics_get_metrics_functions($refresh = FALSE) {  function _metrics_get_metrics_functions($refresh = FALSE) {
345    static $_functions;    static $_functions;
# Line 390  function metrics_call_metric($metric, $o Line 395  function metrics_call_metric($metric, $o
395    return FALSE;    return FALSE;
396  }  }
397    
398    /**
399     * Module settings form.
400     */
401  function metrics_settings_form() {  function metrics_settings_form() {
402    $times = array(6048000, 5443200, 4838400, 4233600, 3628800, 3024000, 2419200, 1814400, 1209600, 604800, 518400, 432000, 345600, 259200, 172800, 86400);    $times = array(6048000, 5443200, 4838400, 4233600, 3628800, 3024000, 2419200, 1814400, 1209600, 604800, 518400, 432000, 345600, 259200, 172800, 86400);
403    $ageoptions = drupal_map_assoc($times, 'format_interval');    $ageoptions = drupal_map_assoc($times, 'format_interval');
# Line 529  function metrics_property_edit($property Line 536  function metrics_property_edit($property
536  }  }
537    
538  /**  /**
539   * Property form.   * Property edit form.
540   */   */
541  function metrics_property_form($edit = array()) {  function metrics_property_form($edit = array()) {
542      if (isset($edit['name'])) {
543        drupal_set_title(check_plain($edit['name']));
544      }
545    
546    $form['name'] = array(    $form['name'] = array(
547      '#type' => 'textfield',      '#type' => 'textfield',
548      '#title' => t('Property name'),      '#title' => t('Property name'),
# Line 639  function metrics_metric_delete($property Line 650  function metrics_metric_delete($property
650    
651    
652  /**  /**
653   * Metrics metric settings.   * Property metrics form.
654   */   */
655  function metrics_metrics_form($edit = array()) {  function metrics_metrics_form($edit = array()) {
656      if (isset($edit['name'])) {
657        drupal_set_title(check_plain($edit['name']));
658      }
659    
660    $function_options = array(0 => '<Select One>');    $function_options = array(0 => '<Select One>');
661    foreach (_metrics_get_metrics_functions() as $function) {    foreach (_metrics_get_metrics_functions() as $function) {
662      $info = $function('info');      $info = $function('info');
# Line 768  function metrics_metrics_form_submit($fo Line 783  function metrics_metrics_form_submit($fo
783    
784    
785  /**  /**
786   * Metrics metric settings.   * Property ranking form.
787   */   */
788  function metrics_rankings_form($edit = array()) {  function metrics_rankings_form($edit = array()) {
789      if (isset($edit['name'])) {
790        drupal_set_title(check_plain($edit['name']));
791      }
792    
793    $form['property_id'] = array(    $form['property_id'] = array(
794      '#type' => 'value',      '#type' => 'value',
795      '#value' => $edit['property_id'],      '#value' => $edit['property_id'],

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.2