diff --git a/class.schedule.php b/class.schedule.php --- a/class.schedule.php +++ b/class.schedule.php @@ -225,7 +225,7 @@ class Schedule echo '}); '; /* Close document.ready for jquery */ echo 'window.print(); '; - echo '

Return to normal view

'; + echo '

« Return to normal view

'; } else { @@ -243,7 +243,7 @@ class Schedule jQuery(\'#selectItemsInput\').hide(); });'; echo '});'; /* Close document.ready for jquery */ - echo '

You can share your schedule with the URL below:

http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'].'

'; + echo '

You can share your schedule with the URL below:

'.$outputPage->gen_share_url($this->id_get()).'

'; echo '

Print :: Share :: Home

Having problems? Let us know.

Keyboard Shortcut: Left and right arrow keys switch between schedules

'; } @@ -370,9 +370,9 @@ class Schedule /* edit button */ if ($id = $this->id_get()) - echo '

'; + echo '

'; - echo "

There were a total of " . $this->possiblePermutations . " possible permutations. Only " . $this->nPermutations . " permutations had no class conflicts.

"; + echo "

There were a total of " . $this->possiblePermutations . " possible permutations. Only " . $this->nPermutations . " permutations had no class conflicts.

"; $outputPage->foot(); } diff --git a/inc/class.page.php b/inc/class.page.php --- a/inc/class.page.php +++ b/inc/class.page.php @@ -408,4 +408,22 @@ class page // '; } + private function add_trailing_slash($path){ + if($path[strlen($path)-1] != '/') { + return $path . "/"; + } + else { + return $path; + } + } + + public function gen_share_url($id){ + global $clean_urls, $short_url_base,$_SERVER; + if($clean_urls && isset($short_url_base)) { + return $this->add_trailing_slash($short_url_base) . $id; + } + else { + return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; + } + } } diff --git a/inc/config.inc.example b/inc/config.inc.example --- a/inc/config.inc.example +++ b/inc/config.inc.example @@ -29,6 +29,17 @@ /** * \brief + * Custom clean URLs for schedule sharing. $clean_urls must be enabled. + * + * This string should be set to a valid base URL that is rewritten + * to a valid slate_permutate installation. This feature will be + * extended in the future to support URL shorteners. + */ +/* $short_url_base = 'http://example.com/sp/'; */ + + +/** + * \brief * List of Google Analytics trackers to enable. Default: empty list. * * Set this to an array of Google Analytics tracker IDs if you want to diff --git a/styles/print.css b/styles/print.css --- a/styles/print.css +++ b/styles/print.css @@ -21,6 +21,12 @@ div.scroller div.section div.txt { background: #fff!important; } -#footer { +#editbutton { + display: none; +} +#leftfoot { + display: none; /* Hide feedback button */ +} +#possiblestats { text-align: center; }