* This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/> * * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\JQueryUI\Dialog; use ScavixWDF\JQueryUI\uiControl; default_string('TITLE_DIALOG', 'Dialog'); /** * Wraps a jQueryUI Dialog * * See http://jqueryui.com/dialog/ */ class uiDialog extends uiControl { protected $Buttons = array(); protected $CloseButton = null; var $CloseButtonAction = null; /** * @param string $title The dialogs title * @param array $options See http://api.jqueryui.com/dialog/ */ function __initialize($title = "TITLE_DIALOG", $options = array())
/** * @internal Removes a term. * * Removes a term from all translations. * @param string $term The term to remove * @return void * @attribute[RequestParam('term','string')] */ function Remove($term) { default_string("TITLE_REMOVE_TERM", "Remove term"); default_string("TXT_REMOVE_TERM", "Do you really want to remove this term? This cannot be undone!"); if (!AjaxAction::IsConfirmed("REMOVE_TERM")) { return AjaxAction::Confirm("REMOVE_TERM", 'TranslationAdmin', 'Remove', array('term' => $term)); } $this->ds->ExecuteSql("DELETE FROM wdf_translations WHERE id=?", $term); return AjaxResponse::Redirect('TranslationAdmin', 'Translate', array('lang' => $_SESSION['trans_admin_lang'], 'offset' => $_SESSION['trans_admin_offset'], 'search' => $_SESSION['trans_admin_search'])); }
* * @author PamConsult GmbH http://www.pamconsult.com <*****@*****.**> * @copyright 2007-2012 PamConsult GmbH * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\Controls\Table; use ExcelCulture; use PDO; use ScavixWDF\Base\Control; use ScavixWDF\Controls\Anchor; use ScavixWDF\Localization\CultureInfo; use ScavixWDF\Model\DataSource; default_string("TXT_NO_DATA_FOUND", "no data found"); /** * Allows to easily integrate database tables into UI. * */ class DatabaseTable extends Table { const PB_NOPROCESSING = 0x0; const PB_STRIPHTML = 0x1; const PB_HTMLSPECIALCHARS = 0x2; var $DataSource = false; var $ResultSet = false; var $DataTable = false; var $Sql = false; var $CacheExecute = false; var $Columns = false;
/** * @shortcut for <default_string>($constant, $text) */ function tds($constant, $text) { return default_string($constant, $text); }
* Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/> * * @author PamConsult GmbH http://www.pamconsult.com <*****@*****.**> * @copyright 2007-2012 PamConsult GmbH * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\Base; use ScavixWDF\ICallable; use ScavixWDF\Localization\Localization; default_string('ERR_JAVASCRIPT_AND_COOKIES_REQUIRED', 'This page requires JavaScript and Cookies.'); /** * Base class for all Html pages. * * Will perform all rendering and collect js, css, meta and more. * @attribute[Resource('jquery.js')] * @attribute[Resource('jquery.json.js')] * @attribute[Resource('htmlpage.js')] */ class HtmlPage extends Template implements ICallable { var $meta = array(); var $js = array(); var $css = array(); var $docready = array(); var $plaindocready = array();
* You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/> * * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\JQueryUI; use ScavixWDF\Localization\CultureInfo; use ScavixWDF\Localization\DateTimeFormat; use ScavixWDF\Localization\Localization; default_string('BTN_DP_NEXT', 'Next'); default_string('BTN_DP_PREV', 'Prev'); default_string('TXT_DP_CLOSE', 'Close'); default_string('TXT_DP_CURRENT', 'Today'); /** * Wraps a jQueryUI DatePicker * * See http://jqueryui.com/datepicker/ */ class uiDatePicker extends uiControl { protected $CultureInfo = false; protected $init_code = "datepicker"; /** * @param mixed $value The default value * @param bool $inline If true will be displayed inline */ function __initialize($value = false, $inline = false) {
* * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/> * * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\JQueryUI\Dialog; default_string('TITLE_WARNING', 'Warning'); /** * Displays a uiDialog with an OK button. * */ class uiMessageBox extends uiDialog { /** * @param string $message_text Message text * @param string $type Defines the css class, so you may use this to style different kinds of messages * @param string $title A title */ function __initialize($message_text, $type = 'hint', $title = 'TITLE_WARNING') { $options = array('autoOpen' => true, 'modal' => true, 'width' => 450, 'height' => 300); parent::__initialize($title, $options);
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/> * * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\JQueryUI\Dialog; use ScavixWDF\WdfException; default_string("TITLE_CONFIRMATION", "Confirm"); default_string("TXT_CONFIRMATION", "Please confirm"); /** * Displays a confirmation dialog. * * This is basically a normal modal <uiDialog> with a predefined set of buttons. */ class uiConfirmation extends uiDialog { const OK_CANCEL = 1; const YES_NO = 2; var $Mode; /** * Creates a new uiConfirmation object. * * The $text_base argument in fact defines two texts in one (and assumes you are using translations!): * It will be prefixed with 'TXT_' and 'TITLE_' and that two constants will be used.
/** * @attribute[RequestParam('table','string',false)] * @attribute[RequestParam('action','string',false)] * @attribute[RequestParam('model','array',false)] * @attribute[RequestParam('row','string',false)] */ function DelProduct($table, $action, $model, $row) { $this->_login(); // require admin to be logged in // we use the ajax confirm features of the framework which require some translated string, so we set them up here // normally we would start the sysadmin and create some, but for this sample we ignore that. default_string('TITLE_DELPRODUCT', 'Delete Product'); default_string('TXT_DELPRODUCT', 'Do you really want to remove this product? This cannot be undone!'); if (!AjaxAction::IsConfirmed('DELPRODUCT')) { return AjaxAction::Confirm('DELPRODUCT', 'Admin', 'DelProduct', array('model' => $model)); } // load and delete the product dataset $ds = model_datasource('system'); $prod = $ds->Query('products')->eq('id', $model['id'])->current(); $prod->Delete(); // delete the image too if present if ($prod->image) { $image = __DIR__ . '/../images/' . $prod->image; if (file_exists($image)) { unlink($image); } } return AjaxResponse::Redirect('Admin'); }
* You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/> * * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\JQueryUI; use ScavixWDF\Controls\Form\Label; use ScavixWDF\Controls\Form\Select; default_string('TXT_VERY_POOR', 'Poor'); default_string('TXT_NOT_THAT_BAD', 'Bad'); default_string('TXT_AVERAGE', 'Average'); default_string('TXT_GOOD', 'Good'); default_string('TXT_PERFECT', 'Perfect'); /** * Wraps a jQueryUI 'Star-Rating' control. * * See http://plugins.jquery.com/project/Star_Rating_widget * @attribute[Resource('jquery-ui/ui.stars.js')] * @attribute[Resource('jquery-ui/ui.stars.css')] */ class uiStarSelect extends uiControl { private $_value = 3; public $_content; var $_scale = array(1 => "TXT_VERY_POOR", 2 => "TXT_NOT_THAT_BAD", 3 => "TXT_AVERAGE", 4 => "TXT_GOOD", 5 => "TXT_PERFECT"); /** * @param array $options See http://plugins.jquery.com/project/Star_Rating_widget */
* * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/> * * @author Scavix Software Ltd. & Co. KG http://www.scavix.com <*****@*****.**> * @copyright since 2012 Scavix Software Ltd. & Co. KG * @license http://www.opensource.org/licenses/lgpl-license.php LGPL */ namespace ScavixWDF\JQueryUI; default_string("TXT_UNKNOWN", 'Unknown'); /** * This is a container for UI elements. * * May be deprecated, we used it in the past for widget based UI designs. * It's kind of a dialog, but not exactly and contain clickable icons in the header. * @attribute[Resource('jquery-ui/ui.container.js')] * @attribute[Resource('jquery-ui/ui.container.css')] */ class uiContainer extends uiControl { /** * @param string $title Title for header section * @param options $options */ function __initialize($title = "TXT_UNKNOWN", $options = array())