Exemple #1
0
 private function createFeedLink(SearchKey $searchKey)
 {
     $feedUrl = WEBDIR . 'rss.php?search=' . urlencode($searchKey->asText());
     $this->output->addFeedLink($feedUrl);
     $link = $this->tmpl->addSubtemplate('searchAsRss');
     $link->assign('feedUrl', $feedUrl);
 }
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require_once 'books/SearchKey.php';
require_once 'notification/Searches.php';
require_once 'tools/Mailer.php';
$searchKey = new SearchKey();
if (!$searchKey->isGiven()) {
    header('Location: ./');
}
$mail = Mailer::mailFromUser('mail');
if ($mail == null) {
    $mail = Mailer::mailFromUser('name');
}
if ($mail) {
    $searches = new Searches();
    $searches->addSearch($searchKey->asText(), $mail);
    header('Location: ./?search=' . urlencode($searchKey->asText()) . '&searchSaved=1');
}
$tmpl = Template::fromFile("view/save_search.html");
$tmpl->assign('searchKey', $searchKey->asHtml());
$tmpl->assign('urlSearchKey', urlencode($searchKey->asHtml()));
$output = new Output();
$output->send($tmpl->result());