[svn:p5ee] r6498 - p5ee/trunk/App-Context/lib/App

[email protected]
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
Author: spadkins
Date: Mon Jun 12 12:43:00 2006
New Revision: 6498

Modified:
   p5ee/trunk/App-Context/lib/App/Context.pm

Log:
add get_user_option()

Modified: p5ee/trunk/App-Context/lib/App/Context.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context.pm	(original)
+++ p5ee/trunk/App-Context/lib/App/Context.pm	Mon Jun 12 12:43:00 2006
@@ -813,6 +813,37 @@
 }
 
 #############################################################################
+# get_user_option()
+#############################################################################
+
+=head2 get_user_option()
+
+    * Signature: $value = $context->get_user_option($var);
+    * Param:  $var             string
+    * Return: $value           string
+    * Throws: <none>
+    * Since:  0.01
+
+    Sample Usage: 
+
+    $theme = $context->get_user_option("theme");
+    $lang  = $context->get_user_option("lang");
+
+The get_user_option() returns the value of a user option variable.
+This is simply the $var attribute of the "default" session object
+(if it exists) or the $var attribute from the global options file.
+
+=cut
+
+sub get_user_option {
+    &App::sub_entry if ($App::trace);
+    my ($self, $var) = @_;
+    my $value = $self->so_get($var) || $self->{options}{$var};
+    &App::sub_exit($value) if ($App::trace);
+    return($value);
+}
+
+#############################################################################
 # so_get()
 #############################################################################
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.