<?php /** * Close.php - Handles including the HTML for the buttons after other modules are finished * * @author Jeremy Booker <jbooker at tux dot appstate dot edu> */ PHPWS_Core::initModClass('addthis', 'AddThisView.php'); PHPWS_Core::initModClass('addthis', 'Settings.php'); $settings = addthis\Settings::getInstance(); if ($settings->get('enabled') == 1) { $view = new addthis\AddThisView($settings); $view->view(); }
* @author Jeremy Booker <jbooker at tux dot appstate dot edu> */ if (!defined('PHPWS_SOURCE_DIR')) { include '../../core/conf/404.html'; exit; } // Include some things we're probably going to always need PHPWS_Core::initModClass('addthis', 'Settings.php'); PHPWS_Core::initModClass('addthis', 'SettingsView.php'); if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'SaveSettings') { // save the settings $settings = addthis\Settings::getInstance(); $settingList = $settings->getAll(); $inputSettings = $_POST['enabled_check']; foreach ($settingList as $key => $value) { if (isset($inputSettings[$key])) { $settings->set($key, 1); } else { $settings->set($key, 0); } } // redirect to the 'show settings' page, with a success message header('HTTP/1.1 303 See Other'); header("Location: index.php?module=addthis&action=ShowSettings"); exit; } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ShowSettings') { // Create the settings view $settingsView = new addthis\SettingsView(addthis\Settings::getInstance()); \Layout::add(\PHPWS_ControlPanel::display($settingsView->show())); }