r4087 renderChapterEditor(): justify INPUT size across table rows
authorDenis Ovsienko <infrastation@yandex.ru>
Sun, 9 Jan 2011 11:58:17 +0000 (11:58 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Sun, 9 Jan 2011 11:58:17 +0000 (11:58 +0000)
supplementDictionary(): dismiss in favour of tableHandler()
commitSupplementDictionary(): idem

inc/database.php
inc/interface.php
inc/navigation.php
inc/ophandlers.php

index c460b95..b451079 100644 (file)
@@ -2160,19 +2160,6 @@ function commitUpdateDictionary ($chapter_no = 0, $dict_key = 0, $dict_value = '
        );
 }
 
-function commitSupplementDictionary ($chapter_no = 0, $dict_value = '')
-{
-       if ($chapter_no <= 0)
-               throw new InvalidArgException ('$chapter_no', $chapter_no);
-       if (!strlen ($dict_value))
-               throw new InvalidArgException ('$dict_value', $dict_value);
-       return usePreparedInsertBlade
-       (
-               'Dictionary',
-               array ('chapter_id' => $chapter_no, 'dict_value' => $dict_value)
-       );
-}
-
 // Technically dict_key is enough to delete, but including chapter_id into
 // WHERE clause makes sure, that the action actually happends for the same
 // chapter, which authorization was granted for.
index 0a9b2a0..5f29fea 100644 (file)
@@ -4311,7 +4311,7 @@ function renderChapterEditor ($tgt_chapter_no)
                echo '<tr><td>&nbsp;</td><td>';
                printImageHREF ('add', 'Add new', TRUE);
                echo "</td>";
-               echo "<td class=tdleft><input type=text name=dict_value size=32 tabindex=100></td><td>";
+               echo "<td class=tdleft><input type=text name=dict_value size=64 tabindex=100></td><td>";
                printImageHREF ('add', 'Add new', TRUE, 101);
                echo '</td></tr></form>';
        }
index 2238f8d..197b937 100644 (file)
@@ -483,7 +483,16 @@ $tabhandler['chapter']['default'] = 'renderChapter';
 $tabhandler['chapter']['edit'] = 'renderChapterEditor';
 $ophandler['chapter']['edit']['del'] = 'reduceDictionary';
 $ophandler['chapter']['edit']['upd'] = 'updateDictionary';
-$ophandler['chapter']['edit']['add'] = 'supplementDictionary';
+$ophandler['chapter']['edit']['add'] = array
+(
+       'table' => 'Dictionary',
+       'action' => 'INSERT',
+       'arglist' => array
+       (
+               array ('url_argname' => 'chapter_no', 'table_colname' => 'chapter_id', 'assertion' => 'uint'),
+               array ('url_argname' => 'dict_value', 'assertion' => 'string'),
+       ),
+);
 
 $page['ui']['title'] = 'User interface';
 $page['ui']['parent'] = 'config';
index 6a85db6..9a4503b 100644 (file)
@@ -671,18 +671,6 @@ function updateDictionary ()
                return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
-$msgcode['supplementDictionary']['OK'] = 52;
-$msgcode['supplementDictionary']['ERR'] = 110;
-function supplementDictionary ()
-{
-       assertUIntArg ('chapter_no');
-       assertStringArg ('dict_value');
-       if (commitSupplementDictionary ($_REQUEST['chapter_no'], $_REQUEST['dict_value']) === TRUE)
-               return buildRedirectURL (__FUNCTION__, 'OK');
-       else
-               return buildRedirectURL (__FUNCTION__, 'ERR');
-}
-
 $msgcode['reduceDictionary']['OK'] = 50;
 $msgcode['reduceDictionary']['ERR'] = 111;
 function reduceDictionary ()