Add POD to more Macros.
Document that using the CanEditText Macro outside of an Asset will have unpredictable results.
This commit is contained in:
parent
7c619a1ecd
commit
80c3f027f2
3 changed files with 38 additions and 5 deletions
|
|
@ -13,6 +13,18 @@ package WebGUI::Macro::At_username;
|
|||
use strict;
|
||||
use WebGUI::Session;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::At_username
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying the current User's username.
|
||||
|
||||
=head2 process
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
return $session{user}{username};
|
||||
|
|
|
|||
|
|
@ -13,6 +13,25 @@ package WebGUI::Macro::CanEditText;
|
|||
use strict;
|
||||
use WebGUI::Session;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::CanEditText
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Macro for displaying a message to a User who can edit the Asset
|
||||
containing the Macro. This macro should not be used outside
|
||||
of an Asset as it will yield unpredictable results.
|
||||
|
||||
=head2 process ( text )
|
||||
|
||||
=head3 text
|
||||
|
||||
The text that will be shown to the user. If the user cannot edit
|
||||
this asset, an empty string will be returned.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my @param = @_;
|
||||
|
|
|
|||
|
|
@ -16,14 +16,16 @@ our $I18N = {
|
|||
message => q|
|
||||
|
||||
<b>^CanEditText(<i>text message</i>);</b><br>
|
||||
Display a message to a user that can edit the current page. The message can be
|
||||
HTML or WebGUI Macros.
|
||||
Display a message to a user that can edit the current Asset.
|
||||
<p>
|
||||
<i>Example:</i> ^CanEditText(^AdminToggle;);
|
||||
<i>Example:</i><br>
|
||||
^CanEditText("You may edit this Asset");<br>
|
||||
^CanEditText(^AdminToggle;);
|
||||
<p>
|
||||
|
||||
Do not use this Macro outside of an Asset as it will have unpredictable
|
||||
results.
|
||||
|,
|
||||
lastUpdated => 1112466919,
|
||||
lastUpdated => 1134773763,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue