Skip to content
Browse files

Совсем вчера об этом забыл. Нельзя считать логи, пока нету рыцарей. И…

… опечатка в url. Потратил минут 5-10.
  • Loading branch information...
1 parent 03c9a0e commit c34f578718ec499094db91709b6c7e72c768817b @JLarky committed Sep 3, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 sites/all/modules/kingdom/kingdom.module
View
10 sites/all/modules/kingdom/kingdom.module
@@ -90,8 +90,8 @@ function kingdom_menu() {
'access arguments' => array('rule kingdom'),
);
// knight's page
- $items['kingdom/knigths'] = array(
- 'title' => 'Knigths manage page',
+ $items['kingdom/knights'] = array(
+ 'title' => 'Knights manage page',
'page callback' => 'page_kingdom_knight',
'access arguments' => array('rule kingdom'),
);
@@ -166,6 +166,12 @@ function timetravel_form($form_state) {
}
function timetravel_form_validate($form, &$form_state) {
+ global $knights;
+ get_all_knights();
+ if (! count($knights)) {
+ form_set_error('', "Нельзя считать урожай и собирать налоги, пока в стране нет рыцарей. Добавьте рыцарей на ".l('этой страничке', 'kingdom/knights').".");
+ }
+
$form_state['values']['days']=intval($form_state['values']['days']);
$days=$form_state['values']['days'];
if (! $days)

0 comments on commit c34f578

Please sign in to comment.
Something went wrong with that request. Please try again.