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()
#############################################################################