Changeset 496513
- Timestamp:
- 01/28/2012 03:28:26 PM (14 years ago)
- Location:
- joemobi/branches/pages
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
singletons/api.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
joemobi/branches/pages
- Property svn:ignore
-
old new 1 1 joemobi.esproj 2 img 3 Project.espressostorage 4 user.jsambells.espressostorage
-
- Property svn:ignore
-
joemobi/branches/pages/singletons/api.php
r491146 r496513 107 107 } 108 108 109 function get_available_tabs() { 110 111 // Define Available tabs 112 $tabs = array(); 113 114 $obj = new StdClass(); 115 $obj->ID = "latest_posts"; 116 $obj->post_title = "Latest"; 117 $obj->JoeMobiType = "Feed"; 118 $obj->JoeMobiTypeTabID = "latest_posts"; 119 $obj->post_content = "This is a list of the later posts from all categories and tags. Generally this would be the same as the blog page on your site."; 120 $tabs[] = $obj; 121 122 $obj = new StdClass(); 123 $obj->ID = "categories"; 124 $obj->post_title = "Categories"; 125 $obj->JoeMobiType = "List"; 126 $obj->JoeMobiTypeTabID = "categories"; 127 $obj->post_content = "A list of all the categories used on your site."; 128 $tabs[] = $obj; 129 130 $obj = new StdClass(); 131 $obj->ID = "tags"; 132 $obj->post_title = "Tags"; 133 $obj->JoeMobiType = "List"; 134 $obj->JoeMobiTypeTabID = "tags"; 135 $obj->post_content = "A list of all the tags used on your site."; 136 $tabs[] = $obj; 137 138 $obj = new StdClass(); 139 $obj->ID = "pages"; 140 $obj->post_title = "Pages"; 141 $obj->JoeMobiType = "List"; 142 $obj->JoeMobiTypeTabID = "pages"; 143 $obj->post_content = "A list of all the tags used on your site."; 144 $tabs[] = $obj; 145 146 $obj = new StdClass(); 147 $obj->ID = "search"; 148 $obj->post_title = "Search"; 149 $obj->JoeMobiType = "Search"; 150 $obj->JoeMobiTypeTabID = "search"; 151 $obj->post_content = "A list of all the tags used on your site."; 152 $tabs[] = $obj; 153 154 $pages = get_pages(); 155 while(list($k,$v) = each($pages)) { 156 $pages[$k]->JoeMobiType = 'Page'; 157 $pages[$k]->JoeMobiTypeTabID = "page-" . $v->ID; 158 } 159 160 return array_merge( $tabs, get_pages()); 161 162 } 163 109 164 function admin_options() { 110 165 … … 118 173 119 174 120 // Define Available tabs 121 $tabs = array(); 122 123 $obj = new StdClass(); 124 $obj->ID = "latest_posts"; 125 $obj->post_title = "Latest"; 126 $obj->JoeMobiType = "Feed"; 127 $obj->JoeMobiTypeTabID = "latest_posts"; 128 $obj->post_content = "This is a list of the later posts from all categories and tags. Generally this would be the same as the blog page on your site."; 129 $tabs[] = $obj; 130 131 $obj = new StdClass(); 132 $obj->ID = "categories"; 133 $obj->post_title = "Categories"; 134 $obj->JoeMobiType = "List"; 135 $obj->JoeMobiTypeTabID = "categories"; 136 $obj->post_content = "A list of all the categories used on your site."; 137 $tabs[] = $obj; 138 139 $obj = new StdClass(); 140 $obj->ID = "tags"; 141 $obj->post_title = "Tags"; 142 $obj->JoeMobiType = "List"; 143 $obj->JoeMobiTypeTabID = "tags"; 144 $obj->post_content = "A list of all the tags used on your site."; 145 $tabs[] = $obj; 146 147 $pages = get_pages(); 148 while(list($k,$v) = each($pages)) { 149 $pages[$k]->JoeMobiType = 'Page'; 150 $pages[$k]->JoeMobiTypeTabID = "page-" . $v->ID; 151 } 152 153 $available_tabs = array_merge( $tabs, get_pages()); 175 $available_tabs = $this->get_available_tabs(); 176 154 177 $available_tabs_keys = array(); 155 178 while(list($k,$v) = each($available_tabs)) { … … 160 183 // 161 184 162 $active_tabs = explode(',', get_option('joemobi_api_tabs', 'latest,categories,tags '));185 $active_tabs = explode(',', get_option('joemobi_api_tabs', 'latest,categories,tags,search')); 163 186 if (count($active_tabs) == 1 && empty($active_tabs[0])) { 164 187 $active_tabs = array(); … … 460 483 461 484 function get_tabs() { 462 $tabs = explode(',',get_option('joemobi_api_tabs', 'latest,categories,posts')); 485 $available_tabs = $this->get_available_tabs(); 486 //var_dump($available_tabs); die(); 487 488 $tabs = explode(',',get_option('joemobi_api_tabs', 'latest,categories,posts,search')); 463 489 while(list($k,$v) = each($tabs)) { 464 490 list($slug,$id) = explode('-',$v); 491 492 // Find title 493 $title = 'Tab'; 494 foreach($available_tabs as $at) { 495 if ($at->JoeMobiTypeTabID == $v) { 496 $title = $at->post_title; 497 break; 498 } 499 } 500 465 501 $tabs[$k] = array( 466 502 'type' => $slug, 467 503 'callback' => 'get_' . $slug, 468 504 'id' => (int)$id, 469 505 'title' => $title, 506 'position' => $k, 507 'icon' => 'default', 470 508 ); 471 509 }
Note: See TracChangeset
for help on using the changeset viewer.