3 class Paginator
extends AOOSModule
5 private $_module = null;
6 private $_options = null;
10 // First we clear options from previous
11 $this->_options
= null;
13 $url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
14 $url = str_replace($this->core()->getSetting("server_name"), "", $url);
15 $parts = explode("/", $url);
16 if (strlen($parts[0]) > 0)
18 $this->_module
= array_shift($parts);
19 $this->_options
= array();
20 foreach ($parts as $f)
22 $this->_options
[] = array_shift($parts);
24 if (!$this->core()->isLoaded($this->_module
))
28 return $this->core()->getModule($this->_module
)->show();
30 $module = $this->core()->getSetting("default_module", __class__
);
31 return $this->core()->getModule($module)->show();
34 public function options()
36 return $this->_options
;
39 public function createURL($module, $options) {
40 if (!is_array($options)) {
41 throw new AOOSException($this->core(), $this->tr("not_array"), "", true, 1);
44 $url = $this->core()->getSetting("server_name");
46 $opt = implode("/", $options);
51 public function numOptions() {
52 return count($this->options());