update the job plugin
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 8 Dec 2015 18:39:31 +0000 (13:39 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 8 Dec 2015 18:39:31 +0000 (13:39 -0500)
use defines for the two taxonomies

glm-employment.php
models/job.php
views/front/jobDetail.php
views/front/jobList.php
views/front/jobSearch.php

index 6ff7f54..1cfa662 100644 (file)
@@ -17,7 +17,11 @@ define('STAFFORDS_EMP_VERSION', '0.2.1');
 define('STAFFORDS_EMP_VRS_OPTION_NAME', 'staffords_jobs_db_version');
 define('STAFFORDS_EMP_POST_TYPE', 'staffords_jobs');
 define('STAFFORDS_EMP_TAX_CATEGORIES', 'staffords_jobscategory');
+define('STAFFORDS_EMP_CATEGORY_SINGLE', 'Category');
+define('STAFFORDS_EMP_CATEGORY_PLURAL', 'Categories');
 define('STAFFORDS_EMP_TAX_DEPARTMENTS', 'staffords_jobsdepartment');
+define('STAFFORDS_EMP_DEPARTMENT_SINGLE', 'Property');
+define('STAFFORDS_EMP_DEPARTMENT_PLURAL', 'Properties');
 define('STAFFORDS_EMP_APPLICATION_TABLE', 'staffords_jobs_application');
 define('STAFFORDS_EMP_FORM_TABLE', 'staffords_jobs_app_form');
 $wp_upload_dir = wp_upload_dir();
index 8f107ec..03140e6 100644 (file)
@@ -404,28 +404,28 @@ class staffords_employment_job
     public function createJobTaxonomy()
     {
         $labels = array(
-            'name'                       => _x('Categories',
+            'name'                       => _x(STAFFORDS_EMP_CATEGORY_PLURAL,
                                                'taxonomy general name'),
-            'singular_name'              => _x('Category',
+            'singular_name'              => _x(STAFFORDS_EMP_CATEGORY_SINGLE,
                                                'taxonomy singular name'),
-            'search_items'               => __('Search Categories'),
-            'popular_items'              => __('Popular Categories'),
-            'all_items'                  => __('All Categories'),
+            'search_items'               => __('Search' . STAFFORDS_EMP_CATEGORY_PLURAL),
+            'popular_items'              => __('Popular ' . STAFFORDS_EMP_CATEGORY_PLURAL),
+            'all_items'                  => __('All ' . STAFFORDS_EMP_CATEGORY_PLURAL),
             'parent_item'                => null,
             'parent_item_colon'          => null,
-            'edit_item'                  => __('Edit Category'),
-            'update_item'                => __('Update Category'),
-            'add_new_item'               => __('Add New Category'),
-            'new_item_name'              => __('New Category Name'),
-            'separate_items_with_commas' => __('Separate categories with commas'),
-            'add_or_remove_items'        => __('Add or remove categories'),
-            'choose_from_most_used'      => __('Choose from the most used categories'),
+            'edit_item'                  => __('Edit ' . STAFFORDS_EMP_CATEGORY_SINGLE),
+            'update_item'                => __('Update ' . STAFFORDS_EMP_CATEGORY_SINGLE),
+            'add_new_item'               => __('Add New ' . STAFFORDS_EMP_CATEGORY_SINGLE),
+            'new_item_name'              => __('New ' . STAFFORDS_EMP_CATEGORY_SINGLE . ' Name'),
+            'separate_items_with_commas' => __('Separate ' . strtolower( STAFFORDS_EMP_CATEGORY_PLURAL ) . ' with commas'),
+            'add_or_remove_items'        => __('Add or remove ' . strtolower( STAFFORDS_EMP_CATEGORY_PLURAL )),
+            'choose_from_most_used'      => __('Choose from the most used ' . strtolower( STAFFORDS_EMP_CATEGORY_PLURAL )),
         );
 
         register_taxonomy(
             STAFFORDS_EMP_TAX_CATEGORIES, STAFFORDS_EMP_POST_TYPE,
             array(
-            'label'             => __('Job Category'),
+        'label'             => __('Job ' . STAFFORDS_EMP_CATEGORY_SINGLE),
             'labels'            => $labels,
             'hierarchical'      => true,
             'show_ui'           => true,
@@ -436,28 +436,28 @@ class staffords_employment_job
         ));
 
         $labels = array(
-            'name'                       => _x('Properties',
+            'name'                       => _x(STAFFORDS_EMP_DEPARTMENT_PLURAL,
                                                'taxonomy general name'),
-            'singular_name'              => _x('Property',
+            'singular_name'              => _x(STAFFORDS_EMP_DEPARTMENT_SINGLE,
                                                'taxonomy singular name'),
-            'search_items'               => __('Search Properties'),
-            'popular_items'              => __('Popular Properties'),
-            'all_items'                  => __('All Properties'),
+            'search_items'               => __('Search ' . STAFFORDS_EMP_DEPARTMENT_PLURAL),
+            'popular_items'              => __('Popular ' . STAFFORDS_EMP_DEPARTMENT_PLURAL),
+            'all_items'                  => __('All ' . STAFFORDS_EMP_DEPARTMENT_PLURAL),
             'parent_item'                => null,
             'parent_item_colon'          => null,
-            'edit_item'                  => __('Edit Property'),
-            'update_item'                => __('Update Property'),
-            'add_new_item'               => __('Add New Property'),
-            'new_item_name'              => __('New Property Name'),
-            'separate_items_with_commas' => __('Separate departments with commas'),
-            'add_or_remove_items'        => __('Add or remove departments'),
-            'choose_from_most_used'      => __('Choose from the most used departments'),
+            'edit_item'                  => __('Edit ' . STAFFORDS_EMP_DEPARTMENT_SINGLE),
+            'update_item'                => __('Update ' . STAFFORDS_EMP_DEPARTMENT_SINGLE),
+            'add_new_item'               => __('Add New ' . STAFFORDS_EMP_DEPARTMENT_SINGLE),
+            'new_item_name'              => __('New ' . STAFFORDS_EMP_DEPARTMENT_SINGLE . ' Name'),
+            'separate_items_with_commas' => __('Separate ' . strtolower( STAFFORDS_EMP_DEPARTMENT_PLURAL ) . ' with commas'),
+            'add_or_remove_items'        => __('Add or remove ' . strtolower( STAFFORDS_EMP_DEPARTMENT_PLURAL )),
+            'choose_from_most_used'      => __('Choose from the most used ' . strtolower( STAFFORDS_EMP_DEPARTMENT_PLURAL )),
         );
 
         register_taxonomy(
             STAFFORDS_EMP_TAX_DEPARTMENTS, STAFFORDS_EMP_POST_TYPE,
             array(
-            'label'        => __('Job Property'),
+            'label'        => __('Job ' . STAFFORDS_EMP_DEPARTMENT_SINGLE),
             'labels'       => $labels,
             'hierarchical' => true,
             'show_ui'      => true,
@@ -478,8 +478,8 @@ class staffords_employment_job
         $columns = array(
             "cb"               => "<input type=\"checkbox\" />",
             "title"            => "Job Title",
-            "glmjobs_col_cat"  => "Category",
-            "glmjobs_col_dep"  => "Property",
+            "glmjobs_col_cat"  => STAFFORDS_EMP_CATEGORY_SINGLE,
+            "glmjobs_col_dep"  => STAFFORDS_EMP_DEPARTMENT_SINGLE,
             "glmjobs_col_date" => "Dates",
         );
         return $columns;
index 77e9b7b..ec46541 100644 (file)
@@ -7,13 +7,13 @@
     <h2><?php echo $job->post_title; ?></h2>
     <?php if ($job->staffords_jobs_property) : ?>
     <div><strong>
-    <?php echo (count( $job->staffords_jobs_property ) > 1 ) ? 'Properties:' : 'Property:' ?> </strong>
+    <?php echo (count( $job->staffords_jobs_property ) > 1 ) ? STAFFORDS_EMP_DEPARTMENT_PLURAL . ':' : STAFFORDS_EMP_DEPARTMENT_SINGLE . ':' ?> </strong>
     <?php echo implode(', ', $job->staffords_jobs_property);?>
     </div>
     <?php endif; ?>
     <?php if ($job->staffords_jobs_category) : ?>
     <div><strong>
-    <?php echo (count( $job->staffords_jobs_category ) > 1 ) ? 'Categories:' : 'Category:' ?> </strong>
+    <?php echo (count( $job->staffords_jobs_category ) > 1 ) ? STAFFORDS_EMP_CATEGORY_PLURAL . ':' : STAFFORDS_EMP_CATEGORY_SINGLE . ':' ?> </strong>
     <?php echo implode(', ', $job->staffords_jobs_category);?>
     </div>
     <?php endif; ?>
index 2ff3194..196897d 100644 (file)
@@ -5,13 +5,13 @@
             <h2><a href="<?php echo $job->href;?>"><?php echo $job->post_title;?></a></h2>
             <?php if ($job->staffords_jobs_property) : ?>
             <div>
-            <?php echo (count( $job->staffords_jobs_property ) > 1 ) ? 'Properties:' : 'Property:' ?>
+            <?php echo (count( $job->staffords_jobs_property ) > 1 ) ? STAFFORDS_DEPARTMENT_PLURAL . ':' : STAFFORDS_EMP_DEPARTMENT_SINGLE . ':' ?>
             <?php echo implode(', ', $job->staffords_jobs_property);?>
             </div>
             <?php endif; ?>
             <?php if ($job->staffords_jobs_category) : ?>
             <div>
-            <?php echo (count( $job->staffords_jobs_category ) > 1 ) ? 'Categories:' : 'Category:' ?>
+            <?php echo (count( $job->staffords_jobs_category ) > 1 ) ? STAFFORDS_EMP_CATEGORY_PLURAL . ':' : STAFFORDS_EMP_CATEGORY_SINGLE . ':' ?>
             <?php echo implode(', ', $job->staffords_jobs_category);?>
             </div>
             <?php endif; ?>
index 39f5389..1263ca6 100644 (file)
@@ -7,7 +7,7 @@
             <?php wp_dropdown_categories( $cat_args );?>
         </div>
         <div class="small-12 medium-5 columns">
-            <label>Search by Property</label>
+            <label>Search by <?php echo STAFFORDS_EMP_DEPARTMENT_SINGLE;?></label>
             <?php wp_dropdown_categories( $dep_args );?>
         </div>
         <div class="small-12 medium-2 columns">