fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-10-25 10:48 am

[dw-free] proposed new subdirectory: cgi-bin/LJ/Global

[commit: http://hg.dwscoalition.org/dw-free/rev/7b150ebe0121]

http://bugs.dwscoalition.org/show_bug.cgi?id=3974

crumbs.pl / crumbs-local.pl -> LJ/Global/Crumbs; LJ/Local/Crumbs

Patch by [personal profile] kareila.

Files modified:
  • bin/upgrading/texttool.pl
  • cgi-bin/LJ/Global/Crumbs.pm
  • cgi-bin/crumbs.pl
  • cgi-bin/weblib.pl
  • doc/raw/ljp.book/int/crumbs.xml
--------------------------------------------------------------------------------
diff -r 4a7c38495a66 -r 7b150ebe0121 bin/upgrading/texttool.pl
--- a/bin/upgrading/texttool.pl	Tue Oct 25 18:40:31 2011 +0800
+++ b/bin/upgrading/texttool.pl	Tue Oct 25 18:48:29 2011 +0800
@@ -51,7 +51,7 @@
                ($LJ::DEFAULT_LANG or $LJ::LANGS[0]), but existing text files
                will be appended, not overwritten.
     copyfaq    If site is translating FAQ, copy FAQ data into trans area
-    loadcrumbs Load crumbs from crumbs.pl and crumbs-local.pl.
+    loadcrumbs Load crumbs from LJ/Global/Crumbs.pm and LJ/Local/Crumbs.pm.
     makeusable Setup internal indexes necessary after loading text
   dumptext     Dump lang text based on text[-local].dat information
                Optionally:
diff -r 4a7c38495a66 -r 7b150ebe0121 cgi-bin/LJ/Global/Crumbs.pm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cgi-bin/LJ/Global/Crumbs.pm	Tue Oct 25 18:48:29 2011 +0800
@@ -0,0 +1,110 @@
+#!/usr/bin/perl
+# This code was forked from the LiveJournal project owned and operated
+# by Live Journal, Inc. The code has been modified and expanded by
+# Dreamwidth Studios, LLC. These files were originally licensed under
+# the terms of the license supplied by Live Journal, Inc, which can
+# currently be found at:
+#
+# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
+#
+# In accordance with the original license, this code and all its
+# modifications are provided under the GNU General Public License.
+# A copy of that license can be found in the LICENSE file included as
+# part of this distribution.
+#
+#
+# Stores all global crumbs and builds the crumbs hash
+
+use strict;
+use Errno qw(ENOENT);
+
+%LJ::CRUMBS = (
+    'acctstatus' => ['Account Status', '/accountstatus', 'manage'],
+    'addfriend' => ['Add Friend', '', 'friends'],
+    'advcustomize' => ['Customize Advanced S2 Settings', '/customize/advanced/', 'manage'],
+    'advsearch' => ['Advanced Search', '/directorysearch', 'search'],
+    'birthdays' => ['Birthdays', '/birthdays', 'friends'],
+    'changeemail' => ['Change Email Address', '/changeemail', 'editprofile'],
+    'changepass' => ['Change Password', '/changepassword', 'manage'],
+    'comminvites' => ['Community Invitations', '/manage/invites', 'manage'],
+    'commmembers' => ['Community Membership', '', 'managecommunity'],
+    'commpending' => ['Pending Memberships', '', 'managecommunity'],
+    'commsearch' => ['Community Search', '/community/search', 'community'],
+    'commsentinvites' => ['Sent Invitations', '/community/sentinvites', 'managecommunity'],
+    'commsettings' => ['Community Settings', '/community/settings', 'managecommunity'],
+    'community' => ['Community Center', '/community/', 'home'],
+    'createcommunity' => ['Create Community', '/community/create', 'managecommunity'],
+    'createjournal_1' => ['Create Your Account', '/create', 'home'],
+    'createstyle' => ['Create Style', '/styles/create', 'modify'],
+    'customize' => ['Customize S2 Settings', '/customize/', 'manage'],
+    'customizelayer' => ['Individual Customizations', '/customize/layer', 'customize'],
+    'domain' => ['Domain Aliasing', '/manage/domain', 'manage'],
+    'delcomment' => ['Delete Comment', '/delcomment', 'home'],
+    'editentries' => ['Edit Entries', '/editjournal', 'manage'],
+    'editinfo' => ['Personal Info', '/manage/profile/', 'manage'],
+    'editprofile' => ['Edit Profile', '/manage/profile/', 'manage'],
+    'editsettings' => ['Viewing Options', '/manage/profile/', 'manage'],
+    'editstyle' => ['Edit Style', '/styles/edit', 'modify'],
+    'emailmanage' => ['Email Management', '/tools/emailmanage', 'manage'],
+    'export' => ['Export Journal', '/export', 'home'],
+    'faq' => ['Frequently Asked Questions', '/support/faq', 'support'],
+    'feedstersearch' => ['Search a Journal', '/tools/search', 'home'],
+    'filterfriends' => ['Filter Reading Page', '/manage/circle/filter', 'friends'],
+    'friends' => ['Circle Tools', '/manage/circle/', 'manage'],
+    'home' => ['Home', '/', ''],
+    'invitefriend' => ['Invite a Friend', '/manage/circle/invite', 'friends'],
+    'joincomm' => ['Join Community', '', 'community'],
+    'latestposts' => ['Latest Posts', '/stats/latest', 'stats'],
+    'layerbrowse' => ['Public Layer Browser', '/customize/advanced/layerbrowse', 'advcustomize'],
+    'leavecomm' => ['Leave Community', '', 'community'],
+    'login' => ['Login', '/login', 'home'],
+    'logout' => ['Logout', '/logout', 'home'],
+    'lostinfo' => ['Lost Info', '/lostinfo', 'manage'],
+    'manage' => ['Manage Accounts', '/manage/', 'home'],
+    'managecomments' => ['Manage Comments', '/tools/recent_comments', 'manage'],
+    'managecommentsettings' => [ 'Manage Comment Settings', '/manage/comments', 'manage'],
+    'managecommunities' => ['Manage Communities', '/community/manage', 'manage'],
+    'managefriends' => ['Manage Circle', '/manage/circle/edit', 'friends'],
+    'managefriendgrps' => ['Manage Filters', '/manage/circle/editfilters', 'friends'],
+    'managetags' => ['Manage Tags', '/manage/tags', 'manage'],
+    'managelogins' => ['Manage Your Login Sessions', '/manage/logins', 'manage'],
+    'manageuserpics' => ['Manage Userpics', '/editicons', 'manage'],
+    'memories' => ['Memorable Posts', '/tools/memories', 'manage'],
+    'mobilepost' => ['Mobile Post Settings', '/manage/emailpost', 'manage'],
+    'moderate' => ['Community Moderation', '/community/moderate', 'community'],
+    'moodeditor' => ['Custom Mood Theme Editor', '/manage/moodthemes', 'manage'],
+    'moodlist' => ['Mood Viewer', '/moodlist', 'manage'],
+    'popfaq' => ['Popular FAQs', '/support/popfaq', 'faq'],
+    'postentry' => ['Post an Entry', '/update', 'home'],
+    'register' => ['Validate Email', '/register', 'home'],
+    'searchinterests' => ['Search By Interest', '/interests', 'search'],
+    'seeoverrides' => ['View User Overrides', '', 'support'],
+    'setpgpkey' => ['Public Key', '/manage/pubkey', 'manage'],
+    'sitestats' => ['Site Statistics', '/stats/site', 'about'],
+    'stats' => ['Statistics', '/stats', 'about'],
+    'styles' => ['Styles', '/styles/', 'modify'],
+    'support' => ['Support', '/support/', 'home'],
+    'supportact' => ['Request Action', '', 'support'],
+    'supportappend' => ['Append to Request', '', 'support'],
+    'supporthelp' => ['Request Board', '/support/help', 'support'],
+    'supportnotify' => ['Notification Settings', '/support/changenotify', 'support'],
+    'supportscores' => ['High Scores', '/support/highscores', 'support'],
+    'supportsubmit' => ['Submit Request', '/support/submit', 'support'],
+    'textmessage' => ['Send Text Message', '/tools/textmessage', 'home'],
+    'translate' => ['Translation Area', '/translate/', 'home'],
+    'translateteams' => ['Translation Teams', '/translate/teams', 'translate'],
+    'unsubscribe' => ['Unsubscribe', '/unsubscribe', 'home'],
+    'utf8convert' => ['UTF-8 Converter', '/utf8convert', 'manage'],
+    'yourlayers' => ['Your Layers', '/customize/advanced/layers', 'advcustomize'],
+    'yourstyles' => ['Your Styles', '/customize/advanced/styles', 'advcustomize'],
+);
+
+# include the local crumbs info
+eval "use LJ::Local::Crumbs;";
+die $@ if $@ && $! != ENOENT;
+
+# if the old local filename is in use, log an error.
+warn "NOTE: Found crumbs-local.pl, please rename to cgi-bin/LJ/Local/Crumbs.pm"
+    if -e "$LJ::HOME/cgi-bin/crumbs-local.pl";
+
+1;
diff -r 4a7c38495a66 -r 7b150ebe0121 cgi-bin/crumbs.pl
--- a/cgi-bin/crumbs.pl	Tue Oct 25 18:40:31 2011 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-#!/usr/bin/perl
-# This code was forked from the LiveJournal project owned and operated
-# by Live Journal, Inc. The code has been modified and expanded by
-# Dreamwidth Studios, LLC. These files were originally licensed under
-# the terms of the license supplied by Live Journal, Inc, which can
-# currently be found at:
-#
-# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
-#
-# In accordance with the original license, this code and all its
-# modifications are provided under the GNU General Public License.
-# A copy of that license can be found in the LICENSE file included as
-# part of this distribution.
-#
-#
-# Stores all global crumbs and builds the crumbs hash
-
-use strict;
-use Errno qw(ENOENT);
-
-%LJ::CRUMBS = (
-    'acctstatus' => ['Account Status', '/accountstatus', 'manage'],
-    'addfriend' => ['Add Friend', '', 'friends'],
-    'advcustomize' => ['Customize Advanced S2 Settings', '/customize/advanced/', 'manage'],
-    'advsearch' => ['Advanced Search', '/directorysearch', 'search'],
-    'birthdays' => ['Birthdays', '/birthdays', 'friends'],
-    'changeemail' => ['Change Email Address', '/changeemail', 'editprofile'],
-    'changepass' => ['Change Password', '/changepassword', 'manage'],
-    'comminvites' => ['Community Invitations', '/manage/invites', 'manage'],
-    'commmembers' => ['Community Membership', '', 'managecommunity'],
-    'commpending' => ['Pending Memberships', '', 'managecommunity'],
-    'commsearch' => ['Community Search', '/community/search', 'community'],
-    'commsentinvites' => ['Sent Invitations', '/community/sentinvites', 'managecommunity'],
-    'commsettings' => ['Community Settings', '/community/settings', 'managecommunity'],
-    'community' => ['Community Center', '/community/', 'home'],
-    'createcommunity' => ['Create Community', '/community/create', 'managecommunity'],
-    'createjournal_1' => ['Create Your Account', '/create', 'home'],
-    'createstyle' => ['Create Style', '/styles/create', 'modify'],
-    'customize' => ['Customize S2 Settings', '/customize/', 'manage'],
-    'customizelayer' => ['Individual Customizations', '/customize/layer', 'customize'],
-    'domain' => ['Domain Aliasing', '/manage/domain', 'manage'],
-    'delcomment' => ['Delete Comment', '/delcomment', 'home'],
-    'editentries' => ['Edit Entries', '/editjournal', 'manage'],
-    'editinfo' => ['Personal Info', '/manage/profile/', 'manage'],
-    'editprofile' => ['Edit Profile', '/manage/profile/', 'manage'],
-    'editsettings' => ['Viewing Options', '/manage/profile/', 'manage'],
-    'editstyle' => ['Edit Style', '/styles/edit', 'modify'],
-    'emailmanage' => ['Email Management', '/tools/emailmanage', 'manage'],
-    'export' => ['Export Journal', '/export', 'home'],
-    'faq' => ['Frequently Asked Questions', '/support/faq', 'support'],
-    'feedstersearch' => ['Search a Journal', '/tools/search', 'home'],
-    'filterfriends' => ['Filter Reading Page', '/manage/circle/filter', 'friends'],
-    'friends' => ['Circle Tools', '/manage/circle/', 'manage'],
-    'home' => ['Home', '/', ''],
-    'invitefriend' => ['Invite a Friend', '/manage/circle/invite', 'friends'],
-    'joincomm' => ['Join Community', '', 'community'],
-    'latestposts' => ['Latest Posts', '/stats/latest', 'stats'],
-    'layerbrowse' => ['Public Layer Browser', '/customize/advanced/layerbrowse', 'advcustomize'],
-    'leavecomm' => ['Leave Community', '', 'community'],
-    'login' => ['Login', '/login', 'home'],
-    'logout' => ['Logout', '/logout', 'home'],
-    'lostinfo' => ['Lost Info', '/lostinfo', 'manage'],
-    'manage' => ['Manage Accounts', '/manage/', 'home'],
-    'managecomments' => ['Manage Comments', '/tools/recent_comments', 'manage'],
-    'managecommentsettings' => [ 'Manage Comment Settings', '/manage/comments', 'manage'],
-    'managecommunities' => ['Manage Communities', '/community/manage', 'manage'],
-    'managefriends' => ['Manage Circle', '/manage/circle/edit', 'friends'],
-    'managefriendgrps' => ['Manage Filters', '/manage/circle/editfilters', 'friends'],
-    'managetags' => ['Manage Tags', '/manage/tags', 'manage'],
-    'managelogins' => ['Manage Your Login Sessions', '/manage/logins', 'manage'],
-    'manageuserpics' => ['Manage Userpics', '/editicons', 'manage'],
-    'memories' => ['Memorable Posts', '/tools/memories', 'manage'],
-    'mobilepost' => ['Mobile Post Settings', '/manage/emailpost', 'manage'],
-    'moderate' => ['Community Moderation', '/community/moderate', 'community'],
-    'moodeditor' => ['Custom Mood Theme Editor', '/manage/moodthemes', 'manage'],
-    'moodlist' => ['Mood Viewer', '/moodlist', 'manage'],
-    'popfaq' => ['Popular FAQs', '/support/popfaq', 'faq'],
-    'postentry' => ['Post an Entry', '/update', 'home'],
-    'register' => ['Validate Email', '/register', 'home'],
-    'searchinterests' => ['Search By Interest', '/interests', 'search'],
-    'seeoverrides' => ['View User Overrides', '', 'support'],
-    'setpgpkey' => ['Public Key', '/manage/pubkey', 'manage'],
-    'sitestats' => ['Site Statistics', '/stats/site', 'about'],
-    'stats' => ['Statistics', '/stats', 'about'],
-    'styles' => ['Styles', '/styles/', 'modify'],
-    'support' => ['Support', '/support/', 'home'],
-    'supportact' => ['Request Action', '', 'support'],
-    'supportappend' => ['Append to Request', '', 'support'],
-    'supporthelp' => ['Request Board', '/support/help', 'support'],
-    'supportnotify' => ['Notification Settings', '/support/changenotify', 'support'],
-    'supportscores' => ['High Scores', '/support/highscores', 'support'],
-    'supportsubmit' => ['Submit Request', '/support/submit', 'support'],
-    'textmessage' => ['Send Text Message', '/tools/textmessage', 'home'],
-    'translate' => ['Translation Area', '/translate/', 'home'],
-    'translateteams' => ['Translation Teams', '/translate/teams', 'translate'],
-    'unsubscribe' => ['Unsubscribe', '/unsubscribe', 'home'],
-    'utf8convert' => ['UTF-8 Converter', '/utf8convert', 'manage'],
-    'yourlayers' => ['Your Layers', '/customize/advanced/layers', 'advcustomize'],
-    'yourstyles' => ['Your Styles', '/customize/advanced/styles', 'advcustomize'],
-);
-
-# include the local crumbs info
-eval { require "crumbs-local.pl" };
-die $@ if $@ && $! != ENOENT;
-
-1;
diff -r 4a7c38495a66 -r 7b150ebe0121 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Tue Oct 25 18:40:31 2011 +0800
+++ b/cgi-bin/weblib.pl	Tue Oct 25 18:48:29 2011 +0800
@@ -20,7 +20,7 @@
 use lib "$LJ::HOME/cgi-bin";
 
 # load the bread crumb hash
-require "crumbs.pl";
+use LJ::Global::Crumbs;
 
 use Carp;
 use DW::External::Site;
diff -r 4a7c38495a66 -r 7b150ebe0121 doc/raw/ljp.book/int/crumbs.xml
--- a/doc/raw/ljp.book/int/crumbs.xml	Tue Oct 25 18:40:31 2011 +0800
+++ b/doc/raw/ljp.book/int/crumbs.xml	Tue Oct 25 18:48:29 2011 +0800
@@ -16,12 +16,13 @@
 default English title and a link to its page.</para></formalpara>
 
 <formalpara><title>Adding crumbs.</title><para>
-In the relevant crumbs definition files (<filename>cgi-bin/crumbs.pl</filename> and <filename>crumbs-local.pl</filename>) you
-will find the hashes that define the crumbs. If you want to add a new crumb, you
-need to add it to one of these files. Note that crumbs in <filename>crumbs-local.pl</filename> override
-crumbs in <filename>crumbs.pl</filename>. Site-specific files, like those from
-<literal>ljcom</literal>, <emphasis role="strong">need</emphasis> to have their
-crumbs put into <filename>crumbs-local.pl</filename>.</para></formalpara>
+In the relevant crumbs definition files (<filename>cgi-bin/LJ/Global/Crumbs.pm</filename>
+and <filename>cgi-bin/LJ/Local/Crumbs.pm</filename>) you will find the hashes
+that define the crumbs. If you want to add a new crumb, you need to add it to
+one of these files. Note that crumbs in <filename>cgi-bin/LJ/Local/Crumbs.pm</filename>
+override crumbs in <filename>cgi-bin/LJ/Global/Crumbs.pm</filename>.
+Site-specific files <emphasis role="strong">need</emphasis> to have their
+crumbs put into <filename>cgi-bin/LJ/Local/Crumbs.pm</filename>.</para></formalpara>
 
 <formalpara><title><literal>%LJ::CRUMBS(_LOCAL)</literal> Hash format.</title><para>
 <programlisting>&apos;<literal>unique_key</literal>&apos; =&gt; [ &apos;<replaceable>Title of Crumb</replaceable>&apos;, &apos;<replaceable>/some/page.bml</replaceable>&apos;, &apos;<replaceable>my_parent</replaceable>&apos; ]</programlisting></para></formalpara>
@@ -43,7 +44,7 @@
      return <literal>LJ::set_active_crumb</literal>(&apos;<replaceable>unique_key</replaceable>&apos;);
 _code?&gt;</programlisting></para>
 
-<formalpara><title>Example site-specific crumb definition file (<filename>cgi-bin/crumbs-local.pl</filename>)</title><para>
+<formalpara><title>Example site-specific crumb definition file (<filename>cgi-bin/LJ/Local/Crumbs.pm</filename>)</title><para>
 <informalexample><programlisting>#!/usr/bin/perl
 #
 # Stores all local crumbs and adds to the global <literal>%LJ::CRUMBS</literal> hash
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org