? easylinks.patch
Index: easylinks.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/easylinks/easylinks.module,v
retrieving revision 1.11
diff -u -r1.11 easylinks.module
--- easylinks.module 31 Oct 2006 08:04:59 -0000 1.11
+++ easylinks.module 1 Dec 2006 10:25:17 -0000
@@ -8,7 +8,7 @@
case 'admin/modules#description':
return t('A simple links management module. Provides a links page with ability for allowed user roles to add links.');
case 'easylinks':
- return t('A list of useful links. If you find that the link is broken, click on
next to the link, in order to report it.');
+ return t('A list of useful links. If you find that the link is broken, click on
next to the link, in order to report it.');
case 'admin/easylinks':
return t('Administer a list of links.');
}
@@ -18,7 +18,7 @@
* Implementation of hook_perm
*/
function easylinks_perm() {
- return array('view easylinks', 'suggest easylinks', 'edit easylinks', 'admin easylinks');
+ return array('view easylinks', 'suggest easylinks', 'administer easylinks');
}
/**
@@ -33,12 +33,12 @@
$items[] = array('path' => 'easylinks/suggest', 'title' => t('suggest a link'),
'callback' => 'easylinks_suggest', 'access' => user_access('suggest easylinks'));
$items[] = array('path' => 'admin/easylinks', 'title' => t('easylinks'),
- 'callback' => 'easylinks_admin', 'access' => user_access('edit easylinks'));
+ 'callback' => 'easylinks_admin', 'access' => user_access('administer easylinks'));
} else {
if (arg(0) == 'easylinks' && is_numeric(arg(1))) {
if(arg(2) == 'edit') {
$items[] = array('path' => 'easylinks/'. arg(1) .'/edit', 'title' => t('link edit'),
- 'callback' => 'easylinks_admin_edit', 'access' => user_access('edit easylinks'),
+ 'callback' => 'easylinks_admin_edit', 'access' => user_access('administer easylinks'),
'type' => MENU_LOCAL_TASK);
}
@@ -424,7 +424,7 @@
'#title' => t('Status'),
'#default_value' => $linkdata->state,
'#options' => $optlst,
- '#description' => t('Select the new status of this link.'),
+ '#description' => t('Current status of this link.'),
);
$form['links_state']['#attributes'] = array('disabled' => 'disabled');
@@ -469,10 +469,11 @@
* Contains the logic around viewing a list of links for administration.
*/
function easylinks_admin() {
+
$header = array(
array('data' => t('ID') , 'field' => 'l.lid' ),
array('data' => t('Status') , 'field' => 'l.state' ),
- array('data' => t('Sugested by') ),
+ array('data' => t('Suggested by') ),
array('data' => t('On') ),
array('data' => t('Site Name') ),
array('data' => t('Site Desc.') , 'field' => 'l.sitedesc' ),
@@ -518,7 +519,7 @@
$destination = drupal_get_destination();
$target = variable_get('easylinks_target', 0) ? '_blank' : '_self';
while ($link = db_fetch_object($result)) {
- $rows[] = array(l('
', url("easylinks/$link->lid/reportbroken"), array(), $destination,NULL,FALSE,TRUE),l($link->sitename, $link->url, array(target => $target)), $link->sitedesc);
+ $rows[] = array(l('
', "easylinks/$link->lid/reportbroken", array(), $destination,NULL,FALSE,TRUE),l($link->sitename, $link->url, array(target => $target)), $link->sitedesc);
}
$pager = theme('pager', NULL, variable_get('links_rows_in_view', 10), 0);
@@ -579,19 +580,19 @@
* Logic for reporting a broken link
*/
function easylinks_report_broken() {
- if($_POST['op'] == t('Report')) {
+ if($_POST['op'] == t('Report broken')) {
$_POST['edit']['links_state'] = 2;
easylinks_update($_POST['edit']);
drupal_set_message(t('Thank you for reporting broken link. The site administrator will investigate the problem.'));
drupal_goto("easylinks");
} else {
- drupal_set_title('report broken link');
+ drupal_set_title('Report broken link');
$result = easylinks_select(1,"lid = " . arg(1));
if (db_num_rows($result)) {
$link = db_fetch_object($result);
$form = easylinks_report_broken_form($link);
- $form['Report'] = array('#type' => 'submit', '#value' => t('Report'));
+ $form['Report broken'] = array('#type' => 'submit', '#value' => t('Report broken'));
$output = drupal_get_form('easylinks_report_broken', $form);
}
}
@@ -630,4 +631,4 @@
$output = theme('item_list', $content);
$output .= '