00001 <?php
00002
00011 class views_handler_argument_term_node_tid_depth_modifier extends views_handler_argument {
00012 function options_form(&$form, &$form_state) { }
00013 function query($group_by = FALSE) { }
00014 function pre_query() {
00015
00016 $argument = isset($this->view->args[$this->position]) ? $this->view->args[$this->position] : NULL;
00017 if (!is_numeric($argument)) {
00018 return;
00019 }
00020
00021 if ($argument > 10) {
00022 $argument = 10;
00023 }
00024
00025 if ($argument < -10) {
00026 $argument = -10;
00027 }
00028
00029
00030 $keys = array_reverse(array_keys($this->view->argument));
00031 $skip = TRUE;
00032 foreach ($keys as $key) {
00033 if ($key == $this->options['id']) {
00034 $skip = FALSE;
00035 continue;
00036 }
00037
00038 if ($skip) {
00039 continue;
00040 }
00041
00042 if (empty($this->view->argument[$key])) {
00043 continue;
00044 }
00045
00046 if (isset($handler)) {
00047 unset($handler);
00048 }
00049
00050 $handler = &$this->view->argument[$key];
00051 if (empty($handler->definition['accept depth modifier'])) {
00052 continue;
00053 }
00054
00055
00056 $handler->options['depth'] = $argument;
00057 }
00058 }
00059 }