Added context to internationalization system.

This commit is contained in:
JT Smith 2003-04-16 02:38:53 +00:00
parent 14249b4850
commit ffff7bf4cd
2 changed files with 12 additions and 5 deletions

View file

@ -273,7 +273,7 @@ delete from international where languageId=1 and namespace='WebGUI' and internat
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (606,1,'WebGUI','Think of pages as containers for content. For instance, if you want to write a letter to the editor of your favorite magazine you\'d get out a notepad (or open a word processor) and start filling it with your thoughts. The same is true with WebGUI. Create a page, then add your content to the page.\r\n<p>\r\n\r\n<b>Title</b><br>\r\nThe title of the page is what your users will use to navigate through the site. Titles should be descriptive, but not very long.\r\n<p>\r\n\r\n\r\n<b>Menu Title</b><br>\r\nA shorter or altered title to appear in navigation. If left blank this will default to <i>Title</i>.\r\n<p>\r\n\r\n<b>Page URL</b><br>\r\nWhen you create a page a URL for the page is generated based on the page title. If you are unhappy with the URL that was chosen, you can change it here.\r\n<p>\r\n\r\n<b>Redirect URL</b><br>\r\nWhen this page is visited, the user will be redirected to the URL specified here. \r\n<p>\r\n<b>NOTE:</b> The redirects will be disabled while in admin mode in order to make it easier to edit the properties of the page.\r\n<p>\r\n\r\n\r\n<b>Hide from navigation?</b><br>\r\nSelect yes to hide this page from the navigation.\r\n<p>\r\n<B>NOTE:</b> This will not hide the page from the page tree (Administrative functions... &gt; Manage page tree.), only from navigation macros.\r\n<p>\r\n\r\n<b>Open in new window?</b><br>\r\nSelect yes to open this page in a new window. This is often used in conjunction with the <b>Redirect URL</b> parameter.\r\n<p>\r\n\r\n\r\n\r\n<b>Language</b><br/>\r\nChoose the default language for this page. All WebGUI generated messages will appear in that language and the character set will be changed to the character set for that language.\r\n<p/>\r\n\r\n<b>Template</b><br>\r\nBy default, WebGUI has one big content area to place wobjects. However, by specifying a template other than the default you can sub-divide the content area into several sections.\r\n<p>\r\n\r\n<b>Synopsis</b><br>\r\nA short description of a page. It is used to populate default descriptive meta tags as well as to provide descriptions on Site Maps.\r\n<p>\r\n\r\n<b>Meta Tags</b><br>\r\nMeta tags are used by some search engines to associate key words to a particular page. There is a great site called <a href="http://www.metatagbuilder.com/">Meta Tag Builder</a> that will help you build meta tags if you\'ve never done it before.\r\n<p>\r\n\r\n<i>Advanced Users:</i> If you have other things (like JavaScript) you usually put in the area of your pages, you may put them here as well.\r\n<p>\r\n\r\n<b>Use default meta tags?</b><br>\r\nIf you don\'t wish to specify meta tags yourself, WebGUI can generate meta tags based on the page title and your company\'s name. Check this box to enable the WebGUI-generated meta tags.\r\n<p>\r\n\r\n\r\n<b>Style</b><br>\r\nBy default, when you create a page, it inherits a few traits from its parent. One of those traits is style. Choose from the list of styles if you would like to change the appearance of this page. See <i>Add Style</i> for more details.\r\n<p>\r\n\r\nIf you select "Yes" below the style pull-down menu, all of the pages below this page will take on the style you\'ve chosen for this page.\r\n<p>\r\n\r\n<b>Start Date</b><br>\r\nThe date when users may begin viewing this page. Note that before this date only content managers with the rights to edit this page will see it.\r\n<p>\r\n\r\n<b>End Date</b><br>\r\nThe date when users will stop viewing this page. Note that after this date only content managers with the rights to edit this page will see it.\r\n<p>\r\n\r\n\r\n<b>Owner</b><br>\r\nThe owner of a page is usually the person who created the page. This user always has full edit and viewing rights on the page.\r\n<p>\r\n<b>NOTE:</b> The owner can only be changed by an administrator.\r\n<p>\r\n\r\n\r\n<b>Who can view?</b><br>\r\nChoose which group can view this page. If you want both visitors and registered users to be able to view the page then you should choose the "Everybody" group.\r\n<p>\r\n\r\n<b>Who can edit?</b><br>\r\nChoose the group that can edit this page. The group assigned editing rights can also always view the page.\r\n<p>\r\n\r\nYou can optionally recursively give these privileges to all pages under this page.\r\n<p>\r\n\r\n<b>What next?</b><br/>\r\nIf you leave this on the default setting you\'ll be redirected to the new page after creating it.\r\n<p/>', 1050440606);
delete from international where languageId=1 and namespace='WebGUI' and internationalId=831;
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (831,1,'WebGUI','Collateral Macros', 1050441851);
alter table international add column context text;

View file

@ -90,6 +90,7 @@ sub www_addInternationalMessage {
WebGUI::SQL->buildHashRef("select namespace,namespace from international where languageId=1 order by namespace")
,"Namespace",['WebGUI']);
$f->textarea("message","Message");
$f->textarea("context","Context");
$f->submit;
$output .= $f->print;
return _submenu($output);
@ -102,8 +103,10 @@ sub www_addInternationalMessageSave {
and namespace=".quote($session{form}{namespace}));
$nextId++;
my $namespace = $session{form}{namespace_new} || $session{form}{namespace};
WebGUI::SQL->write("insert into international (languageId, internationalId, namespace, message, lastUpdated) values
(1,$nextId,".quote($namespace).",".quote($session{form}{message}).",".time().")");
WebGUI::SQL->write("insert into international (languageId, internationalId, namespace, message, lastUpdated,
context) values
(1,$nextId,".quote($namespace).",".quote($session{form}{message}).",".time().",
".quote($session{form}{context}).")");
return "<b>Message was added with id $nextId.</b>".www_listInternationalMessages();
}
@ -135,7 +138,7 @@ sub www_deleteLanguageConfirm {
#-------------------------------------------------------------------
sub www_editInternationalMessage {
my ($output, $message, $f, $language);
my ($output, $message, $context, $f, $language);
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
($language) = WebGUI::SQL->quickArray("select language from language where languageId=".$session{form}{lid});
$output = '<h1>'.WebGUI::International::get(597).'</h1>';
@ -151,9 +154,13 @@ sub www_editInternationalMessage {
and namespace='".$session{form}{namespace}."' and languageId=".$session{form}{lid});
$f->textarea("message",$language,$message);
$f->submit;
($message) = WebGUI::SQL->quickArray("select message from international where internationalId=".$session{form}{iid}."
($message, $context) = WebGUI::SQL->quickArray("select message,context from international where internationalId=".$session{form}{iid}."
and namespace='".$session{form}{namespace}."' and languageId=1");
$f->readOnly(WebGUI::Macro::negate($message),"English");
$f->readOnly(
-label=>"Message Context",
-value=>$context
);
$output .= $f->print;
return _submenu($output);
}