Common subdirectories: /home/sugree/work/cvs/drupal/full/4.7/contributions/modules/interwiki/CVS and ./CVS diff -uN /home/sugree/work/cvs/drupal/full/4.7/contributions/modules/interwiki/interwiki.info ./interwiki.info --- /home/sugree/work/cvs/drupal/full/4.7/contributions/modules/interwiki/interwiki.info 1970-01-01 07:00:00.000000000 +0700 +++ ./interwiki.info 2007-01-04 11:14:46.000000000 +0700 @@ -0,0 +1,3 @@ +; $Id$ +name = interwiki +description = Easily link to wikis and other websites. diff -uN /home/sugree/work/cvs/drupal/full/4.7/contributions/modules/interwiki/interwiki.install ./interwiki.install --- /home/sugree/work/cvs/drupal/full/4.7/contributions/modules/interwiki/interwiki.install 1970-01-01 07:00:00.000000000 +0700 +++ ./interwiki.install 2007-01-04 11:53:45.000000000 +0700 @@ -0,0 +1,36 @@ + TRUE, 'callback' => 'interwiki_list', 'type' => MENU_CALLBACK); - $items[] = array('path' => 'admin/interwiki', + $items[] = array('path' => 'admin/settings/interwiki', 'title' => t('interwiki'), + 'description' => t('Manage interwiki.'), 'access' => user_access('administer interwiki'), 'callback' => 'interwiki_admin'); - $items[] = array('path' => 'admin/interwiki/list', + $items[] = array('path' => 'admin/settings/interwiki/list', 'title' => t('list'), 'access' => user_access('administer interwiki'), 'callback' => 'interwiki_admin', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10 ); - $items[] = array('path' => 'admin/interwiki/add', + $items[] = array('path' => 'admin/settings/interwiki/add', 'title' => t('add'), 'access' => user_access('administer interwiki'), 'callback' => 'interwiki_admin', @@ -168,15 +169,15 @@ '%piped' => $piped, '%trans' => $trans_result )); - $result = db_query("SELECT iw_prefix, iw_url from {interwiki}"); - $header = array(t('Prefix'), t('Translates to')); + $result = db_query("SELECT iw_prefix, iw_url, iw_rel from {interwiki}"); + $header = array(t('Prefix'), t('rel'), t('Translates to')); while ($record = db_fetch_object($result)) { // Strip out $1, $2, $3 and $4 from interwiki tables ... $url = preg_replace(array('/\$1/', '/\$2/', '/\$3/', '/\$4/'), '', $record->iw_url); if ($url == '') { $url = t('a local path on this website'); } - $rows[] = array ($record->iw_prefix . ":", $url); + $rows[] = array ($record->iw_prefix . ":", $record->iw_rel, $url); } $output .= t('Available prefixes are:') . '

'; $output .= theme('table',$header,$rows); @@ -195,11 +196,12 @@ return t('Easily link to wikis and other reference websites'); case 'process': - $result = db_query("SELECT iw_prefix, iw_url, iw_local from {interwiki}"); + $result = db_query("SELECT iw_prefix, iw_url, iw_local, iw_rel from {interwiki}"); $targets = array(); while ($record = db_fetch_object($result)) { $matcha[$record->iw_prefix] = $record->iw_url; $targets[$record->iw_prefix] = $record->iw_local ? '_self' : '_blank'; + $rels[$record->iw_prefix] = $record->iw_rel; } $syntax = variable_get("interwiki_syntax_$format", array('single')); if (!(array_search('double', $syntax) === FALSE)) { @@ -222,6 +224,7 @@ $url_terminator = '|'; } $target = $targets[$match[1][$index]]; + $rel = $rels[$match[1][$index]]; $term = trim($match[2][$index]); $term_array = explode($url_terminator, $term, 2); $display_term = $term_array[1] ? $term_array[1] : $display_prefix . $term; @@ -241,7 +244,7 @@ $url = preg_replace(array('/\$1/','/\$2/', '/\$3/', '/\$4/'), array($url_term1, $url_term2, $url_term3, $url_term4), $matcha[$match[1][$index]]); // If it's an external path, don't use the l() function if (preg_match("/^(http|https|mailto|ftp):/i", $url)) { - $html = ''. $display_term .''; + $html = ''. $display_term .''; } else { $html = l($display_term, $url, array('title' => "reference on $display_term", 'target' => $target)); } @@ -269,6 +272,7 @@ $url_terminator = '|'; } $target = $targets[$match_default]; + $rel = $rels[$match_default]; $term = trim($match[1][$index]); $term_array = explode($url_terminator, $term, 2); $display_term = $term_array[1] ? $term_array[1] : $display_prefix . $term; @@ -287,7 +291,7 @@ $url = preg_replace(array('/\$1/','/\$2/', '/\$3/', '/\$4/'), array($url_term1, $url_term2, $url_term3, $url_term4), $matcha[$match_default]); // If it's an external path, don't use the l() function if (preg_match("/^(http|https|mailto|ftp):/i", $url)) { - $html = ''. $display_term .''; + $html = ''. $display_term .''; } else { $html = l($display_term, $url, array('title' => "reference on $display_term", 'target' => $target)); } @@ -388,12 +392,20 @@ '#maxlength' => 32, '#description' => t("The prefix goes before a colon when users edit content, e.g., \"[prefix:some text].\""), ); + $form["iw_rel"] = array( + '#type' => 'textfield', + '#title' => t("rel"), + '#default_value' => $edit["iw_rel"], + '#size' => 32, + '#maxlength' => 32, + '#description' => t('The rel= parameter, if any, required in this link. This may be blank.'), + ); $form["iw_url"] = array( '#type' => 'textfield', '#title' => t("URL"), '#default_value' => $edit["iw_url"], '#size' => 50, - '#maxlength' => 128, + '#maxlength' => 255, '#description' => t('The URL to be created. The phrase "some_text" will replace the string "$1" in the translated hyperlink, "some+text" will replace "$2", "some%20text" will replace "$3", and "some-text" will replace "$4".'), ); $form["iw_local"] = array( @@ -414,7 +426,7 @@ '#value' => t("Delete"), ); } - return drupal_get_form('interwiki_add', $form); + return drupal_get_form('interwiki', $form); } /** @@ -424,7 +436,7 @@ function interwiki_save($edit) { db_query("DELETE FROM {interwiki} WHERE iw_prefix = '%s'", $edit["iw_prefix"]); if ($edit["action"] != 'delete') { - db_query("INSERT INTO {interwiki} (iw_prefix, iw_url, iw_local) VALUES ('%s', '%s', '%d')", $edit["iw_prefix"], $edit["iw_url"], $edit["iw_local"]); + db_query("INSERT INTO {interwiki} (iw_prefix, iw_url, iw_rel, iw_local) VALUES ('%s', '%s', '%s', '%d')", $edit["iw_prefix"], $edit["iw_url"], $edit["iw_rel"], $edit["iw_local"]); } } @@ -451,10 +463,10 @@ function interwiki_display() { $output = '

' . t("The interwiki table lets website users easily link to terms in wikis and various other websites using a simplified markup syntax. For example, \"[prefix:some term]\" creates a hyperlink to the ". "\"some term\" article on the website specified by \"prefix.\" Available prefixes and the paths to which they point are:") . '

'; - $result = db_query("SELECT iw_prefix, iw_url, iw_local from {interwiki}"); - $header = array(t('Prefix'), t('Translates to'), t('Local?'), array("data" => t("operations"), "colspan" => 2)); + $result = db_query("SELECT iw_prefix, iw_url, iw_rel, iw_local from {interwiki}"); + $header = array(t('Prefix'), t('rel'), t('Translates to'), t('Local?'), array("data" => t("operations"), "colspan" => 2)); while ($record = db_fetch_object($result)) { - $rows[] = array ($record->iw_prefix . ":", $record->iw_url, ($record->iw_local ? 'Yes' : 'No'), l(t("edit"), "admin/interwiki/edit/$record->iw_prefix"), l(t("delete"), "admin/interwiki/delete/$record->iw_prefix")); + $rows[] = array ($record->iw_prefix . ":", $record->iw_rel, $record->iw_url, ($record->iw_local ? 'Yes' : 'No'), l(t("edit"), "admin/interwiki/edit/$record->iw_prefix"), l(t("delete"), "admin/interwiki/delete/$record->iw_prefix")); } $output .= theme('table',$header,$rows); $output .= '

' . t('The paths in the "translates to" row above use placeholder strings to specify how the space character should be ' .