diff options
-rw-r--r-- | modules/tag/controllers/tag.php | 7 | ||||
-rw-r--r-- | modules/tag/helpers/tag.php | 3 | ||||
-rw-r--r-- | modules/tag/helpers/tag_block.php | 5 | ||||
-rw-r--r-- | modules/tag/js/tag.js | 24 | ||||
-rw-r--r-- | modules/tag/tests/Tag_Test.php | 31 | ||||
-rw-r--r-- | modules/tag/views/tag_block.html.php | 13 | ||||
-rw-r--r-- | themes/default/css/screen.css | 9 |
7 files changed, 12 insertions, 80 deletions
diff --git a/modules/tag/controllers/tag.php b/modules/tag/controllers/tag.php index e6bdbfe4..21117150 100644 --- a/modules/tag/controllers/tag.php +++ b/modules/tag/controllers/tag.php @@ -24,10 +24,7 @@ class Tag_Controller extends REST_Controller { * @see Rest_Controller::_index() */ public function _index() { - $filter = valid::digit($_GET["filter"]) ? $_GET["filter"] : null; - $filter = ($filter <= 0) ? 1 : - ($filter >= tag::$NUMBER_OF_BUCKETS ? tag::$NUMBER_OF_BUCKETS - 1 : $filter); - print tag_block::sidebar_blocks(null, $filter); + throw new Exception("@todo Comment_Controller::_form NOT IMPLEMENTED"); } /** @@ -58,7 +55,7 @@ class Tag_Controller extends REST_Controller { // @todo Production this code // 1) Add security checks throw new Exception("@todo Tag_Controller::_delete NOT IMPLEMENTED"); - } + } public function _update($tag) { // @todo Productionize this diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 70448527..4e3c0643 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -60,10 +60,9 @@ class tag_Core { * array("id" => "tag_id", "name" => "tag_name", "count" => "frequency", * "class" => "bucket") */ - public static function load_buckets($filter=1) { + public static function load_buckets() { $tag_list = array(); $tags = ORM::factory("tag") - ->where("count >=", $filter) ->orderby("count", "ASC") ->find_all() ->as_array(); diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php index 23a9e276..6adf5ca6 100644 --- a/modules/tag/helpers/tag_block.php +++ b/modules/tag/helpers/tag_block.php @@ -19,11 +19,6 @@ */ class tag_block_Core { - public static function head($theme) { - $url = url::file("modules/tag/js/tag.js"); - return "<script src=\"$url\" type=\"text/javascript\"></script>"; - } - public static function sidebar_blocks($theme, $filter=1) { $block = new Block(); $block->id = "gTag"; diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js deleted file mode 100644 index 6157b81b..00000000 --- a/modules/tag/js/tag.js +++ /dev/null @@ -1,24 +0,0 @@ -$("document").ready(function() { - $("#gTagLess").click(function(event){ - event.preventDefault(); - get_tag_block($("#gTagLess").attr("href")); - }); - $("#gTagMore").click(function(event){ - event.preventDefault(); - get_tag_block($("#gTagMore").attr("href")); - }); -}); - -function get_tag_block(url) { - $.get(url, function(data) { - $('#gTag').html(data); - $("#gTagLess").click(function(event){ - event.preventDefault(); - get_tag_block($("#gTagLess").attr("href")); - }); - $("#gTagMore").click(function(event){ - event.preventDefault(); - get_tag_block($("#gTagMore").attr("href")); - }); - }); -} diff --git a/modules/tag/tests/Tag_Test.php b/modules/tag/tests/Tag_Test.php index 0a7f878c..1a4f7698 100644 --- a/modules/tag/tests/Tag_Test.php +++ b/modules/tag/tests/Tag_Test.php @@ -51,30 +51,17 @@ class Tag_Test extends Unit_Test_Case { } $tag_list = tag::load_buckets(); - Kohana::log("debug", print_r($tag_list, true)); + $expected_tag_list = array( - array("name" => "tag0", "count" => 8, "class" => 5), - array("name" => "tag1", "count" => 9, "class" => 6), - array("name" => "tag2", "count" => 6, "class" => 4), - array("name" => "tag3", "count" => 5, "class" => 3), - array("name" => "tag4", "count" => 4, "class" => 2), - array("name" => "tag5", "count" => 3, "class" => 1), - array("name" => "tag6", "count" => 2, "class" => 0), - array("name" => "tag7", "count" => 1, "class" => 0) + array("id" => "2", "name" => "tag0", "count" => 8, "class" => 5), + array("id" => "1", "name" => "tag1", "count" => 9, "class" => 6), + array("id" => "3", "name" => "tag2", "count" => 6, "class" => 4), + array("id" => "4", "name" => "tag3", "count" => 5, "class" => 3), + array("id" => "5", "name" => "tag4", "count" => 4, "class" => 2), + array("id" => "6", "name" => "tag5", "count" => 3, "class" => 1), + array("id" => "7", "name" => "tag6", "count" => 2, "class" => 0), + array("id" => "8", "name" => "tag7", "count" => 1, "class" => 0) ); $this->assert_equal($expected_tag_list, $tag_list, "incorrect non filtered tag list"); - - $tag_list = tag::load_buckets(2); - Kohana::log("debug", print_r($tag_list, true)); - $expected_tag_list = array( - array("name" => "tag0", "count" => 8, "class" => 5), - array("name" => "tag1", "count" => 9, "class" => 6), - array("name" => "tag2", "count" => 6, "class" => 4), - array("name" => "tag3", "count" => 5, "class" => 3), - array("name" => "tag4", "count" => 4, "class" => 2), - array("name" => "tag5", "count" => 3, "class" => 1), - array("name" => "tag6", "count" => 2, "class" => 0) - ); - $this->assert_equal($expected_tag_list, $tag_list, "incorrect filtered tag list"); } }
\ No newline at end of file diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php index 9334a5ce..485c6d20 100644 --- a/modules/tag/views/tag_block.html.php +++ b/modules/tag/views/tag_block.html.php @@ -1,17 +1,4 @@ <? defined("SYSPATH") or die("No direct script access."); ?> -<div class="gTagFilter"> - <? if ($filter < (tag::$NUMBER_OF_BUCKETS - 1)): ?> - <? $lessFilter = $filter + 1; ?> - <a id="gTagLess" href="<?= url::site("tag/?filter=$lessFilter") ?>">See Less</a> - <? endif; ?> - <? if ($filter > 1): ?> - <? $moreFilter = $filter - 1;?> - <a id="gTagMore" href="<?= url::site("tag/?filter=$moreFilter") ?>">See More</a> - <? endif; ?> - - <div id="gTagReloadProgress" class="">Resizing Tag Cloud...</div> - <hr /> -</div> <ul> <? foreach ($tag_list as $tag): ?> <li class="size<?=$tag["class"] ?>"> diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index 5fffad62..52ad3fd9 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -408,15 +408,6 @@ table.gMetadata td.toggle { margin-top: 10px; } -#gTag .gTagFilter { - margin-left: .5em; -} - -#gTag #gTagReloadProgress { - display: none; - text-align: left; - color: #0e2b52; -} /* Tags ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #gTag ul { |