File indexing completed on 2025-05-04 05:29:03
0001 <?php 0002 /** 0003 * ocs-webserver 0004 * 0005 * Copyright 2016 by pling GmbH. 0006 * 0007 * This file is part of ocs-webserver. 0008 * 0009 * This program is free software: you can redistribute it and/or modify 0010 * it under the terms of the GNU Affero General Public License as 0011 * published by the Free Software Foundation, either version 3 of the 0012 * License, or (at your option) any later version. 0013 * 0014 * This program is distributed in the hope that it will be useful, 0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0017 * GNU Affero General Public License for more details. 0018 * 0019 * You should have received a copy of the GNU Affero General Public License 0020 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0021 **/ 0022 ?> 0023 <link rel="stylesheet" href="//cdn.jsdelivr.net/jquery.validationengine/2.6.4/css/template.css"> 0024 <link rel="stylesheet" href="//cdn.jsdelivr.net/jquery.validationengine/2.6.4/css/validationEngine.jquery.css"> 0025 <script src="//cdn.jsdelivr.net/jquery.validationengine/2.6.4/js/jquery.validationEngine.min.js"></script> 0026 <script src="//cdn.jsdelivr.net/jquery.validationengine/2.6.4/languages/jquery.validationEngine-en.js"></script> 0027 <style> 0028 .highlight { 0029 background-color: #fefff3; 0030 } 0031 </style> 0032 <div class="messages"> 0033 <?php foreach (Zend_Controller_Action_HelperBroker::getStaticHelper('flashMessenger') 0034 ->getCurrentMessages() as $message) : ?> 0035 <p><?php echo $this->escape($message); ?></p> 0036 <?php endforeach; ?> 0037 </div> 0038 <div id="TableContainer"></div> 0039 <div id="dialog-form" title="Object Details"></div> 0040 <script type="text/javascript"> 0041 $(document).ready(function () { 0042 $('#TableContainer').jtable({ 0043 jqueryuiTheme: true, 0044 paging: true, 0045 title: 'Table of Spam Keywords', 0046 sorting: true, //Enable sorting 0047 defaultSorting: 'spam_key_word', //Set default sorting 0048 actions: { 0049 listAction: '/backend/spamkeywords/list', 0050 createAction: '/backend/spamkeywords/create', 0051 updateAction: '/backend/spamkeywords/update', 0052 deleteAction: '/backend/spamkeywords/delete' 0053 }, 0054 fields: { 0055 spam_key_id: { 0056 key: true, 0057 create: false, 0058 edit: false, 0059 list: false 0060 }, 0061 spam_key_word: { 0062 title: 'Keyword', 0063 width: '20%', 0064 inputClass: 'validate[required]' 0065 }, 0066 spam_key_created_at: { 0067 title: 'Created At', 0068 width: '5%', 0069 type: 'date', 0070 create: false, 0071 edit: false 0072 }, 0073 spam_key_is_deleted: { 0074 title: 'deleted', 0075 width: '5%', 0076 options: {'0': 'Not Deleted', '1': 'Deleted'}, 0077 defaultValue: '0', 0078 create: false 0079 }, 0080 spam_key_is_active: { 0081 title: 'active', 0082 width: '5%', 0083 inputTitle: 'Status*', 0084 options: {'1': 'Active', '0': 'Inactive'}, 0085 defaultValue: '1' 0086 } 0087 }, 0088 //Initialize validation logic when a form is created 0089 formCreated: function (event, data) { 0090 data.form.validationEngine(); 0091 $('#jtable-create-form').attr('style', 'padding:5%'); 0092 }, 0093 //Validate form when it is being submitted 0094 formSubmitting: function (event, data) { 0095 return data.form.validationEngine('validate'); 0096 }, 0097 //Dispose validation logic when form is closed 0098 formClosed: function (event, data) { 0099 data.form.validationEngine('hide'); 0100 data.form.validationEngine('detach'); 0101 }, 0102 0103 }); 0104 0105 $('#TableContainer').jtable('load'); 0106 0107 $("#dialog-form").dialog({ 0108 autoOpen: false, 0109 //height: 350, 0110 width: 600, 0111 modal: true, 0112 buttons: { 0113 Close: function () { 0114 $(this).dialog("close"); 0115 } 0116 } 0117 }); 0118 0119 }); 0120 </script>