<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[GlotPress] [465] trunk: Use single leading dash,
instead of leading underscore for special URLs</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>465</dd>
<dt>Author</dt> <dd>nbachiyski</dd>
<dt>Date</dt> <dd>2010-04-08 14:23:31 +0000 (Thu, 08 Apr 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use single leading dash, instead of leading underscore for special URLs</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkgpincludesroutesprojectphp">trunk/gp-includes/routes/project.php</a></li>
<li><a href="#trunkgpincludesroutestranslationsetphp">trunk/gp-includes/routes/translation-set.php</a></li>
<li><a href="#trunkgpincludesroutestranslationphp">trunk/gp-includes/routes/translation.php</a></li>
<li><a href="#trunkgpincludesroutesphp">trunk/gp-includes/routes.php</a></li>
<li><a href="#trunkgpincludestemplatelinksphp">trunk/gp-includes/template-links.php</a></li>
<li><a href="#trunkgptemplatesprojectpermissionsphp">trunk/gp-templates/project-permissions.php</a></li>
<li><a href="#trunkgptemplatesprojectphp">trunk/gp-templates/project.php</a></li>
<li><a href="#trunkgptemplatesprojectsphp">trunk/gp-templates/projects.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkgpincludesroutesprojectphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-includes/routes/project.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-includes/routes/project.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-includes/routes/project.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">                 if ( !$project ) gp_tmpl_404();
</span><span class="cx">                 $this->can_or_redirect( 'write', 'project', $project->id );
</span><span class="cx">                 $updated_project = new GP_Project( gp_post( 'project' ) );
</span><del>-                $this->validate_or_redirect( $updated_project, gp_url_project( $project, '_edit' ) );
</del><ins>+                $this->validate_or_redirect( $updated_project, gp_url_project( $project, '-edit' ) );
</ins><span class="cx">                 // TODO: add id check as a validation rule
</span><span class="cx">                 if ( $project->id == $updated_project->parent_project_id )
</span><span class="cx">                         $this->errors[] = __('The project cannot be parent of itself!');
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">                         $this->errors[] = __('Error in saving project!');
</span><span class="cx">                 $project->reload();
</span><span class="cx">
</span><del>-                gp_redirect( gp_url_project( $project, '_edit' ) );
</del><ins>+                gp_redirect( gp_url_project( $project, '-edit' ) );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function delete_get( $project_path ) {
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx">                         gp_tmpl_load( 'project-new', get_defined_vars() );
</span><span class="cx">                 } else {
</span><span class="cx">                         $this->notices[] = __('The project was created!');
</span><del>-                        gp_redirect( gp_url_project( $project, '_edit' ) );
</del><ins>+                        gp_redirect( gp_url_project( $project, '-edit' ) );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -195,6 +195,6 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         $this->errors[] = __('Permission wasn&#8217;t found!');
</span><span class="cx">                 }
</span><del>-                gp_redirect( gp_url_project( $project, array( '_permissions' ) ) );
-        }        
</del><ins>+                gp_redirect( gp_url_project( $project, array( '-permissions' ) ) );
+        }
</ins><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkgpincludesroutestranslationsetphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-includes/routes/translation-set.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-includes/routes/translation-set.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-includes/routes/translation-set.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -19,12 +19,12 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         $this->can_or_redirect( 'write', 'project', null, gp_url_project( '' ) );
</span><span class="cx">                 }
</span><del>-                $this->validate_or_redirect( $new_set, gp_url( '/sets/_new', array( 'project_id' => $new_set->project_id ) ) );
</del><ins>+                $this->validate_or_redirect( $new_set, gp_url( '/sets/-new', array( 'project_id' => $new_set->project_id ) ) );
</ins><span class="cx">                 $set = GP::$translation_set->create_and_select( $new_set );
</span><span class="cx">                 if ( $set ) $project = GP::$project->get( $set->project_id );
</span><span class="cx">                 if ( !$set ) {
</span><span class="cx">                         $this->errors[] = __('Error in creating translation set!');
</span><del>-                        gp_redirect( gp_url( '/sets/_new', array( 'project_id' => $new_set->project_id ) ) );
</del><ins>+                        gp_redirect( gp_url( '/sets/-new', array( 'project_id' => $new_set->project_id ) ) );
</ins><span class="cx">                 } else {
</span><span class="cx">                         $this->notices[] = __('The translation set was created!');
</span><span class="cx">                         gp_redirect( gp_url_project_locale( $project, $set->locale, $set->slug ) );
</span></span></pre></div>
<a id="trunkgpincludesroutestranslationphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-includes/routes/translation.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-includes/routes/translation.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-includes/routes/translation.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -70,8 +70,8 @@
</span><span class="cx">                 $can_approve = $this->can( 'approve', 'translation-set', $translation_set->id );
</span><span class="cx">                 $url = gp_url_project( $project, gp_url_join( $locale->slug, $translation_set->slug ) );
</span><span class="cx">                 $set_priority_url = gp_url( '/originals/%original-id%/set_priority');
</span><del>-                $discard_warning_url = gp_url_project( $project, gp_url_join( $locale->slug, $translation_set->slug, '_discard-warning' ) );
-                $bulk_action = gp_url_join( $url, '_bulk' );
</del><ins>+                $discard_warning_url = gp_url_project( $project, gp_url_join( $locale->slug, $translation_set->slug, '-discard-warning' ) );
+                $bulk_action = gp_url_join( $url, '-bulk' );
</ins><span class="cx">                 $this->tmpl( 'translations', get_defined_vars() );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkgpincludesroutesphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-includes/routes.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-includes/routes.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-includes/routes.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -46,36 +46,35 @@
</span><span class="cx">                         "get:/$project/import-originals" => array('GP_Route_Project', 'import_originals_get'),
</span><span class="cx">                         "post:/$project/import-originals" => array('GP_Route_Project', 'import_originals_post'),
</span><span class="cx">
</span><del>-                        "get:/$project/_edit" => array('GP_Route_Project', 'edit_get'),
-                        "post:/$project/_edit" => array('GP_Route_Project', 'edit_post'),
</del><ins>+                        "get:/$project/-edit" => array('GP_Route_Project', 'edit_get'),
+                        "post:/$project/-edit" => array('GP_Route_Project', 'edit_post'),
</ins><span class="cx">
</span><del>-                        "get:/$project/_delete" => array('GP_Route_Project', 'delete_get'),
-                        "post:/$project/_delete" => array('GP_Route_Project', 'delete_post'),
</del><ins>+                        "get:/$project/-delete" => array('GP_Route_Project', 'delete_get'),
+                        "post:/$project/-delete" => array('GP_Route_Project', 'delete_post'),
</ins><span class="cx">
</span><del>-                        "post:/$project/_personal" => array('GP_Route_Project', 'personal_options_post'),
</del><ins>+                        "post:/$project/-personal" => array('GP_Route_Project', 'personal_options_post'),
</ins><span class="cx">                         
</span><del>-                        "get:/$project/_permissions" => array('GP_Route_Project', 'permissions_get'),
-                        "post:/$project/_permissions" => array('GP_Route_Project', 'permissions_post'),
-                        "get:/$project/_permissions/_delete/$dir" => array('GP_Route_Project', 'permissions_delete'),
</del><ins>+                        "get:/$project/-permissions" => array('GP_Route_Project', 'permissions_get'),
+                        "post:/$project/-permissions" => array('GP_Route_Project', 'permissions_post'),
+                        "get:/$project/-permissions/-delete/$dir" => array('GP_Route_Project', 'permissions_delete'),
</ins><span class="cx">                         
</span><span class="cx">
</span><span class="cx">                         "get:/$projects" => array('GP_Route_Project', 'index'),
</span><del>-                        "get:/$projects/_new" => array('GP_Route_Project', 'new_get'),
-                        "get:/$projects/_new" => array('GP_Route_Project', 'new_get'),
-                        "post:/$projects/_new" => array('GP_Route_Project', 'new_post'),
</del><ins>+                        "get:/$projects/-new" => array('GP_Route_Project', 'new_get'),
+                        "post:/$projects/-new" => array('GP_Route_Project', 'new_post'),
</ins><span class="cx">
</span><del>-                        "post:/$project/$locale/$dir/_bulk" => array('GP_Route_Translation', 'bulk_post'),
</del><ins>+                        "post:/$project/$locale/$dir/-bulk" => array('GP_Route_Translation', 'bulk_post'),
</ins><span class="cx">                         "get:/$project/$locale/$dir" => array('GP_Route_Translation', 'translations_get'),
</span><span class="cx">                         "post:/$project/$locale/$dir" => array('GP_Route_Translation', 'translations_post'),
</span><span class="cx">                         "get:/$project/$locale/$dir/import-translations" => array('GP_Route_Translation', 'import_translations_get'),
</span><span class="cx">                         "post:/$project/$locale/$dir/import-translations" => array('GP_Route_Translation', 'import_translations_post'),
</span><del>-                        "post:/$project/$locale/$dir/_discard-warning" => array('GP_Route_Translation', 'discard_warning'),
</del><ins>+                        "post:/$project/$locale/$dir/-discard-warning" => array('GP_Route_Translation', 'discard_warning'),
</ins><span class="cx">                         "/$project/$locale/$dir/export-translations" => array('GP_Route_Translation', 'export_translations_get'),
</span><span class="cx">                         // keep this one at the bottom of the project, because it will catch anything starting with project
</span><span class="cx">                         "/$project" => array('GP_Route_Project', 'single'),
</span><span class="cx">
</span><del>-                        "get:/sets/_new" => array('GP_Route_Translation_Set', 'new_get'),
-                        "post:/sets/_new" => array('GP_Route_Translation_Set', 'new_post'),
</del><ins>+                        "get:/sets/-new" => array('GP_Route_Translation_Set', 'new_get'),
+                        "post:/sets/-new" => array('GP_Route_Translation_Set', 'new_post'),
</ins><span class="cx">                         
</span><span class="cx">                         "post:/originals/$id/set_priority" => array('GP_Route_Original', 'set_priority'),
</span><span class="cx">                 ) );
</span></span></pre></div>
<a id="trunkgpincludestemplatelinksphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-includes/template-links.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-includes/template-links.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-includes/template-links.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">                 return '';
</span><span class="cx">         }
</span><span class="cx">         $text = $text? $text : __( 'Edit' );
</span><del>-        return gp_link_get( gp_url_project( $project, '_edit' ), $text, gp_attrs_add_class( $attrs, 'action edit' ) );
</del><ins>+        return gp_link_get( gp_url_project( $project, '-edit' ), $text, gp_attrs_add_class( $attrs, 'action edit' ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function gp_link_project_edit() {
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">                 return '';
</span><span class="cx">         }
</span><span class="cx">         $text = $text? $text : __( 'Delete' );
</span><del>-        return gp_link_get( gp_url_project( $project, '_delete' ), $text, gp_attrs_add_class( $attrs, 'action delete' ) );
</del><ins>+        return gp_link_get( gp_url_project( $project, '-delete' ), $text, gp_attrs_add_class( $attrs, 'action delete' ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function gp_link_project_delete() {
</span></span></pre></div>
<a id="trunkgptemplatesprojectpermissionsphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-templates/project-permissions.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-templates/project-permissions.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-templates/project-permissions.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx">                         <span class="user"><?php echo esc_html( $permission->locale_slug ); ?></span>
</span><span class="cx">                         <span class="permission-action">and slug</span>
</span><span class="cx">                         <span class="user"><?php echo esc_html( $permission->set_slug ); ?></span>
</span><del>-                        <a href="<?php echo gp_url_join( gp_url_current(), '_delete/'.$permission->id ); ?>" class="action delete"><?php _e('Remove'); ?></a>
</del><ins>+                        <a href="<?php echo gp_url_join( gp_url_current(), '-delete/'.$permission->id ); ?>" class="action delete"><?php _e('Remove'); ?></a>
</ins><span class="cx">                 </li>
</span><span class="cx">         <? endforeach; ?>
</span><span class="cx"> </ul>        
</span></span></pre></div>
<a id="trunkgptemplatesprojectphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-templates/project.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-templates/project.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-templates/project.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">         <div class="secondary actionlist">
</span><span class="cx">         <a href="#" class="personal-options" id="personal-options-toggle"><?php _e('Personal project options &darr;'); ?></a>
</span><span class="cx">         <div class="personal-options">
</span><del>-                <form action="<?php echo gp_url_project( $project, '_personal' ); ?>" method="post">
</del><ins>+                <form action="<?php echo gp_url_project( $project, '-personal' ); ?>" method="post">
</ins><span class="cx">                 <dl>
</span><span class="cx">                         <dt><label for="source-url-template"><?php _e('Source file URL'); ?></label></dt>
</span><span class="cx">                         <dd>
</span><span class="lines">@@ -74,9 +74,9 @@
</span><span class="cx"> <?php if ( $can_write ): ?>
</span><span class="cx">         <p class="secondary actionlist">
</span><span class="cx">                 <?php gp_link( gp_url_project( $project, 'import-originals' ), __( 'Import originals' ) ); ?> &bull;
</span><del>-                <?php gp_link( gp_url_project( $project, array( '_permissions' ) ), __('Permissions') ); ?> &bull;
-                <?php gp_link( gp_url_project( '', '_new', array('parent_project_id' => $project->id) ), __('Create a New Sub-Project') ); ?> &bull;
-                <?php gp_link( gp_url( '/sets/_new', array( 'project_id' => $project->id ) ), __('Create a New Translation Set') ); ?>
</del><ins>+                <?php gp_link( gp_url_project( $project, array( '-permissions' ) ), __('Permissions') ); ?> &bull;
+                <?php gp_link( gp_url_project( '', '-new', array('parent_project_id' => $project->id) ), __('Create a New Sub-Project') ); ?> &bull;
+                <?php gp_link( gp_url( '/sets/-new', array( 'project_id' => $project->id ) ), __('Create a New Translation Set') ); ?>
</ins><span class="cx">         </p>
</span><span class="cx"> <?php endif; ?>
</span><span class="cx"> <script type="text/javascript" charset="utf-8">
</span></span></pre></div>
<a id="trunkgptemplatesprojectsphp"></a>
<div class="modfile"><h4>Modified: trunk/gp-templates/projects.php (464 => 465)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/gp-templates/projects.php        2010-04-08 11:06:43 UTC (rev 464)
+++ trunk/gp-templates/projects.php        2010-04-08 14:23:31 UTC (rev 465)
</span><span class="lines">@@ -10,6 +10,6 @@
</span><span class="cx"> <?php endforeach; ?>
</span><span class="cx"> </ul>
</span><span class="cx"> <?php if ( GP::$user->current()->can( 'write', 'project' ) ): ?>
</span><del>-        <p class="actionlist secondary"><?php gp_link( gp_url_project( '_new' ), __('Create a New Project') ); ?></p>
</del><ins>+        <p class="actionlist secondary"><?php gp_link( gp_url_project( '-new' ), __('Create a New Project') ); ?></p>
</ins><span class="cx"> <?php endif; ?>
</span><span class="cx"> <?php gp_tmpl_footer(); ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>