Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

on map page, select design response category

  • Loading branch information...
commit 7ae80366ae2a890cfaae858f8106238d4f57c98a 1 parent 6949583
@rmarianski authored
View
3  application/config/pps.php
@@ -8,3 +8,6 @@
// og data to use
$config['og_title'] = 'By the City / For the City - Urban Design Week 2011';
$config['fb_admins'] = '753810374';
+
+// design response category
+$config['design_response_category_id'] = -1;
View
13 application/controllers/main.php
@@ -131,6 +131,8 @@ public function index()
// Get all active top level categories
$parent_categories = array();
+ $child_categories = array();
+ $design_response_category = ((int) Kohana::config('pps.design_response_category_id'));
foreach (ORM::factory('category')
->where('category_visible', '1')
->where('parent_id', '0')
@@ -159,6 +161,16 @@ public function index()
$child->category_image
);
+ $new_child = array($display_title,
+ $child->category_color,
+ $child->category_image,
+ $child->id);
+ if ($child->id === $design_response_category) {
+ array_unshift($child_categories, $new_child);
+ } else {
+ array_push($child_categories, $new_child);
+ }
+
if ($child->category_trusted)
{ // Get Trusted Category Count
$trusted = ORM::factory("incident")
@@ -202,6 +214,7 @@ public function index()
}
}
$this->template->content->categories = $parent_categories;
+ $this->template->content->child_categories = $child_categories;
// Get all active Layers (KMZ/KML)
$layers = array();
View
7 application/views/main_js.php
@@ -446,6 +446,13 @@ function toggleLayer(link, layer){
return false;
});
+
+ // click on the first category, which will be
+ // the design response
+ var designResponseCategory = $("a[id^='cat_']")[1];
+ if (designResponseCategory) {
+ setTimeout(function() { $(designResponseCategory).click(); }, 0);
+ }
// Sharing Layer[s] Switch Action
$("a[id^='share_']").click(function()
View
39 themes/pps/views/main.php
@@ -19,11 +19,11 @@
<ul id="category_switch" class="category-filters">
<li><a class="active" id="cat_0" href="#"><span class="swatch" style="background-color:<?php echo "#".$default_map_all;?>"></span><span class="category-title"><?php echo Kohana::lang('ui_main.all_categories');?></span></a></li>
<?php
- foreach ($categories as $category => $category_info)
- {
+ // foreach ($categories as $category => $category_info)
+ // {
// need to show subcategories for visible categories, and not top level
- $category_title = $category_info[0];
/*
+ $category_title = $category_info[0];
$category_color = $category_info[1];
$category_image = '';
$color_css = 'class="swatch" style="background-color:#'.$category_color.'"';
@@ -38,11 +38,32 @@
*/
// Get Children
//echo '<div class="hide" id="child_'. $category .'">';
- if( sizeof($category_info[3]) != 0)
- {
- //echo '<ul>';
- foreach ($category_info[3] as $child => $child_info)
+ /* if( sizeof($category_info[3]) != 0) */
+ /* { */
+ /* //echo '<ul>'; */
+ /* foreach ($category_info[3] as $child => $child_info) */
+ /* { */
+ /* $child_title = $child_info[0]; */
+ /* $child_color = $child_info[1]; */
+ /* $child_image = ''; */
+ /* $color_css = 'class="swatch" style="background-color:#'.$child_color.'"'; */
+ /* if($child_info[2] != NULL && file_exists(Kohana::config('upload.relative_directory').'/'.$child_info[2])) { */
+ /* $child_image = html::image(array( */
+ /* 'src'=>Kohana::config('upload.relative_directory').'/'.$child_info[2], */
+ /* 'style'=>'float:left;padding-right:5px;' */
+ /* )); */
+ /* $color_css = ''; */
+ /* } */
+ /* //echo '<li style="padding-left:20px;"><a href="#" id="cat_'. $child .'"><span '.$color_css.'>'.$child_image.'</span><span class="category-title">'.$child_title.'</span></a></li>'; */
+ /* echo '<li><a href="#" id="cat_'. $child .'"><span '.$color_css.'>'.$child_image.'</span><span class="category-title">'.$child_title.'</span></a></li>'; */
+ /* } */
+ /* //echo '</ul>'; */
+ /* } */
+ //echo '</div></li>';
+ // }
+ foreach ($child_categories as $child_info)
{
+ $child = $child_info[3];
$child_title = $child_info[0];
$child_color = $child_info[1];
$child_image = '';
@@ -57,10 +78,6 @@
//echo '<li style="padding-left:20px;"><a href="#" id="cat_'. $child .'"><span '.$color_css.'>'.$child_image.'</span><span class="category-title">'.$child_title.'</span></a></li>';
echo '<li><a href="#" id="cat_'. $child .'"><span '.$color_css.'>'.$child_image.'</span><span class="category-title">'.$child_title.'</span></a></li>';
}
- //echo '</ul>';
- }
- //echo '</div></li>';
- }
?>
</ul>
<?php
Please sign in to comment.
Something went wrong with that request. Please try again.