From: <wis...@us...> - 2012-01-04 12:46:51
|
Revision: 8634 http://xoops.svn.sourceforge.net/xoops/?rev=8634&view=rev Author: wishcraft Date: 2012-01-04 12:46:39 +0000 (Wed, 04 Jan 2012) Log Message: ----------- X-REST 1.50 - Rest API for XOOPS 2.x - JSON, Serialisation, XML output, with reserved words ?restplugin= & &outputmode= - use http://yoursite.com/module/xrest/plugin/?var1=example&var2=example2 to access API Added Paths: ----------- XoopsModules/xrest/ XoopsModules/xrest/releases/ XoopsModules/xrest/releases/1.50/ XoopsModules/xrest/releases/1.50/docs/ XoopsModules/xrest/releases/1.50/docs/licence.txt XoopsModules/xrest/releases/1.50/htdocs/ XoopsModules/xrest/releases/1.50/htdocs/modules/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/.htaccess XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/admin_header.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/index.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/menu.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/permissions.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/class.functions.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/close12.gif XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbfields.png XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbtables.png XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbviews.png XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/left_both.gif XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/open12.gif XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/permissions.png XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/plugins.png XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/right_both.gif XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/xrest_slogo.png XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/JSON.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/common.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/functions.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/server.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/index.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/language/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/language/english/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/language/english/admin.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/language/english/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/language/english/main.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/language/english/modinfo.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/language/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/inc/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/inc/authcheck.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/inc/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/inc/siteinfocheck.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/inc/usercheck.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/post.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/retrieve.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/retrievecrc.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/retrievekeys.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/tableschemer.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/tablesforpost.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/tablesforretrieve.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/tablesforupdate.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/update.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/viewretrieve.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/viewsforretrieve.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/xoops_authentication.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/xoops_check_activation.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/xoops_create_user.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/xoops_network_disclaimer.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/plugins/xoops_user_validate.php XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/sql/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/sql/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/sql/mysql.sql XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/templates/ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/templates/index.html XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/xoops_version.php Added: XoopsModules/xrest/releases/1.50/docs/licence.txt =================================================================== --- XoopsModules/xrest/releases/1.50/docs/licence.txt (rev 0) +++ XoopsModules/xrest/releases/1.50/docs/licence.txt 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/.htaccess =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/.htaccess (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/.htaccess 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,8 @@ +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +RewriteRule ^images/(.*?)$ images/$1 +RewriteRule ^admin/(.*?)$ admin/$1 +RewriteRule ^(.*?)/?(.*?)$ index.php?xrestplugin=$1&$2 +RewriteRule ^(.*?)/$ index.php?xrestplugin=$1& Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/admin_header.php =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/admin_header.php (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/admin_header.php 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,31 @@ +<?php +/** + * $Id: admin_header.php v 1.13 06 july 2004 Catwolf Exp $ + * Module: WF-Downloads + * Version: v2.0.5a + * Release Date: 26 july 2004 + * Author: WF-Sections + * Licence: GNU + */ + error_reporting(E_ALL); +include '../../../mainfile.php'; +include '../../../include/cp_header.php'; +include '../include/functions.php'; + +include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; +include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; +include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; + +if (is_object($xoopsUser)) { + $xoopsModule = XoopsModule::getByDirname("xjson"); + if (!$xoopsUser->isAdmin($xoopsModule->mid())) { + redirect_header(XOOPS_URL . "/", 3, _NOPERM); + exit(); + } +} else { + redirect_header(XOOPS_URL . "/", 1, _NOPERM); + exit(); +} +$myts = &MyTextSanitizer::getInstance(); +error_reporting(E_ALL); +?> \ No newline at end of file Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/index.php =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/index.php (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/index.php 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,529 @@ +<?php + +include 'admin_header.php'; +include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; +include_once '../include/functions.php'; + +error_reporting(E_ALL); +global $xoopsDB; + + if (isset($_GET)) { + foreach ($_GET as $k => $v) { + ${$k} = $v; + } + } + + if (isset($_POST)) { + foreach ($_POST as $k => $v) { + ${$k} = $v; + } + } + +switch ($op){ + +case "fields": + + if (!$tbl_id) + $tbl_id=1; + + $sql = "SELECT * FROM ".$xoopsDB->prefix('json_tables')." where view = '0'"; + $ret = $xoopsDB->queryF($sql); + + $form_sel = new XoopsThemeForm(_XC_SELECTTABLE, "seltable", $_SERVER['PHP_SELF'] .""); + $form_sel->setExtra( "enctype='multipart/form-data'" ) ; + + $table_sel = new XoopsFormSelect(_XC_SELECTTABLE.':', 'select'); + $table_sel->setExtra('onchange="window.location=\'\'+this.options[this.selectedIndex].value"'); + + while($row = $xoopsDB->fetchArray($ret)) { + $table_sel->addOption("index.php?op=fields&tbl_id=".$row['tbl_id'], $row['tablename']); + if ($tbl_id == $row['tbl_id']) + $table_sel->setValue("index.php?op=fields&tbl_id=".$row['tbl_id']); + } + $form_sel->addElement($table_sel); + + $sql = "SHOW FIELDS FROM ".$xoopsDB->prefix(get_tablename($tbl_id)); + $ret = $xoopsDB->queryF($sql); + + $form_fld = new XoopsThemeForm(_XC_FIELDOPTIONSFOR.' '.get_tablename($tbl_id), "fields", $_SERVER['PHP_SELF'] .""); + $form_fld->setExtra( "enctype='multipart/form-data'" ) ; + + $field=0; + $tbldat = get_tableconfig(get_tablename($tbl_id)); + + $ele_tray = array(); + + while(list($fieldname, $type, $null, $keytype, $tmp, $tmp) = $xoopsDB->fetchRow($ret)){ + $field++; + + $int = 0; + $string = 0; + $float = 0; + $text = 0; + $other = 0; + $key = 0; + if (strpos(' '.$type,'int')>0){ + $int = 1; + } elseif (strpos(' '.$type,'char')>0){ + $string = 1; + } elseif (strpos(' '.$type,'float')>0){ + $float = 1; + } elseif (strpos(' '.$type,'text')>0){ + $text = 1; + } else { + $other = 1; + } + + if ($keytype == "PRI"){ + $key = 1; + } + $tbldat = get_fieldconfig($fieldname, $tbl_id); + + if (!isset($tbldat)){ + $new++; + $ele_tray[$field] = new XoopsFormElementTray($fieldname.' (new)',' ',$fieldname); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", "new")); + $ele_tray[$field]->addElement(new XoopsFormHidden("key[$field]", $key)); + $ele_tray[$field]->addElement(new XoopsFormHidden("string[$field]", $string)); + $ele_tray[$field]->addElement(new XoopsFormHidden("int[$field]", $int)); + $ele_tray[$field]->addElement(new XoopsFormHidden("float[$field]", $float)); + $ele_tray[$field]->addElement(new XoopsFormHidden("text[$field]", $text)); + $ele_tray[$field]->addElement(new XoopsFormHidden("other[$field]", $other)); + $ele_tray[$field]->addElement(new XoopsFormHidden("fieldname[$field]", $fieldname)); + + $post[$field] = new XoopsFormCheckBox("Post", "post[$field]"); + $retrieve[$field] = new XoopsFormCheckBox("Retrieve", "retrieve[$field]"); + $update[$field] = new XoopsFormCheckBox("Update", "update[$field]"); + $visible[$field] = new XoopsFormCheckBox("Visible", "visible[$field]"); + $crc[$field] = new XoopsFormCheckBox("CRC", "crc[$field]"); + + $post[$field]->addOption(1, ' '); + $retrieve[$field]->addOption(1, ' '); + $update[$field]->addOption(1, ' '); + $visible[$field]->addOption(1, ' '); + $crc[$field]->addOption(1, ' '); + + if ($key==1) + $post[$field]->setExtra('disabled="disabled"'); + elseif ($tbldat['allowpost']==1) + $post[$field]->setValue(1); + $ele_tray[$field]->addElement($post[$field]); + + if ($tbldat['allowretrieve']==1) + $retrieve[$field]->setValue(1); + $ele_tray[$field]->addElement($retrieve[$field]); + + if ($key==1) + $update[$field]->setExtra('disabled="disabled"'); + elseif ($tbldat['allowupdate']==1) + $update[$field]->setValue(1); + $ele_tray[$field]->addElement($update[$field]); + + if ($tbldat['visible']==1) + $visible[$field]->setValue(1); + $ele_tray[$field]->addElement($visible[$field]); + + if ($key==1) + $crc[$field]->setExtra('disabled="disabled"'); + elseif ($tbldat['crc']==1) + $crc[$field]->setValue(1); + $ele_tray[$field]->addElement($crc[$field]); + + } else { + + $ele_tray[$field] = new XoopsFormElementTray($fieldname.'',' ',$fieldname); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", $tbldat['fld_id'])); + $ele_tray[$field]->addElement(new XoopsFormHidden("key[$field]", $key)); + $ele_tray[$field]->addElement(new XoopsFormHidden("string[$field]", $string)); + $ele_tray[$field]->addElement(new XoopsFormHidden("int[$field]", $int)); + $ele_tray[$field]->addElement(new XoopsFormHidden("float[$field]", $float)); + $ele_tray[$field]->addElement(new XoopsFormHidden("text[$field]", $text)); + $ele_tray[$field]->addElement(new XoopsFormHidden("other[$field]", $other)); + $ele_tray[$field]->addElement(new XoopsFormHidden("fieldname[$field]", $fieldname)); + + $post[$field] = new XoopsFormCheckBox("Post", "post[$field]", $tbldat['allowpost']); + $retrieve[$field] = new XoopsFormCheckBox("Retrieve", "retrieve[$field]", $tbldat['allowretrieve']); + $update[$field] = new XoopsFormCheckBox("Update", "update[$field]", $tbldat['allowupdate']); + $visible[$field] = new XoopsFormCheckBox("Visible", "visible[$field]", $tbldat['visible']); + $crc[$field] = new XoopsFormCheckBox("CRC", "crc[$field]", $tbldat['crc']); + + $post[$field]->addOption(1, ' '); + $retrieve[$field]->addOption(1, ' '); + $update[$field]->addOption(1, ' '); + $visible[$field]->addOption(1, ' '); + $crc[$field]->addOption(1, ' '); + + if ($key==1) + $post[$field]->setExtra('disabled="disabled"'); + $ele_tray[$field]->addElement($post[$field]); + + $ele_tray[$field]->addElement($retrieve[$field]); + + if ($key==1) + $update[$field]->setExtra('disabled="disabled"'); + $ele_tray[$field]->addElement($update[$field]); + + $ele_tray[$field]->addElement($visible[$field]); + + if ($key==1) + $crc[$field]->setExtra('disabled="disabled"'); + + $ele_tray[$field]->addElement($crc[$field]); + + } + + $form_fld->addElement( $ele_tray[$field] ); + } + + $form_fld->addElement(new XoopsFormHidden("tbl_id", $tbl_id)); + $form_fld->addElement(new XoopsFormHidden("op", "savefields")); + $form_fld->addElement(new XoopsFormHidden("new", $new)); + $form_fld->addElement(new XoopsFormButton('', 'send', _SEND, 'submit')); + xoops_cp_header(); + adminMenu(2); + $form_sel->display(); + echo "<div style='clear:both;'></div>"; + $form_fld->display(); + footer_adminMenu(); + xoops_cp_footer(); + break; + +case "savefields": + + foreach ($id as $f){ + $tt++; + switch ($f){ + case "new": + $sql = "INSERT INTO ".$xoopsDB->prefix('json_fields')." (tbl_id, fieldname, allowpost, allowretrieve, allowupdate, visible, `key`, `string`, `int`, `float`, `text`, `other`, `crc`) VALUES ('$tbl_id','".addslashes($fieldname[$tt])."','".intval($post[$tt])."','".intval($retrieve[$tt])."','".intval($update[$tt])."','".intval($visible[$tt])."','".intval($key[$tt])."','".intval($string[$tt])."','".intval($int[$tt])."','".intval($float[$tt])."','".intval($text[$tt])."','".intval($other[$tt])."','".intval($crc[$tt])."')"; + $ty=$xoopsDB->queryF($sql); + break; + default: + $sql = "UPDATE ".$xoopsDB->prefix('json_fields')." SET allowpost ='".intval($post[$tt])."', allowupdate ='".intval($update[$tt])."',allowretrieve = '".intval($retrieve[$tt])."', visible='".intval($visible[$tt])."',`key` ='".intval($key[$tt])."', `string` = '".intval($string[$tt])."', `int`='".intval($int[$tt])."',`float` ='".intval($float[$tt])."', `text` = '".intval($text[$tt])."', `other`='".intval($other[$tt])."', crc = '".intval($crc[$tt])."' WHERE fld_id = ".$id[$tt]. " and tbl_id = ".$tbl_id; + $ty=$xoopsDB->queryF($sql); + } + + } + redirect_header("index.php?op=fields&tbl_id=".$tbl_id,2,_XC_DATABASEUPDATED); + break; + +case "savetables": + + + foreach ($id as $f){ + $tt++; + switch ($f){ + case "new": + $sql = "INSERT INTO ".$xoopsDB->prefix('json_tables')." (tablename, allowpost, allowretrieve, allowupdate, visible, view) VALUES ('".addslashes($tablename[$tt])."','".intval($post[$tt])."','".intval($retrieve[$tt])."','".intval($update[$tt])."','".intval($visible[$tt])."','0')"; + $ty=$xoopsDB->queryF($sql); + break; + default: + $sql = "UPDATE ".$xoopsDB->prefix('json_tables')." SET allowpost ='".intval($post[$tt])."', allowretrieve = '".intval($retrieve[$tt])."', allowupdate = '".intval($update[$tt])."', visible='".intval($visible[$tt])."' WHERE tbl_id = ".$id[$tt]; + $ty=$xoopsDB->queryF($sql); + } + + } + redirect_header("index.php?op=tables",2,_XC_DATABASEUPDATED); + break; + +case "saveviews": + + foreach ($id as $f){ + $tt++; + switch ($f){ + case "new": + $sql = "INSERT INTO ".$xoopsDB->prefix('json_tables')." (tablename, allowpost, allowretrieve, allowupdate, visible, view) VALUES ('".addslashes($tablename[$tt])."','".intval($post[$tt])."','".intval($retrieve[$tt])."','".intval($update[$tt])."','".intval($visible[$tt])."','1')"; + $ty=$xoopsDB->queryF($sql); + break; + default: + $sql = "UPDATE ".$xoopsDB->prefix('json_tables')." SET allowpost ='".intval($post[$tt])."', allowretrieve = '".intval($retrieve[$tt])."', allowupdate = '".intval($update[$tt])."', visible='".intval($visible[$tt])."' WHERE tbl_id = ".$id[$tt]; + $ty=$xoopsDB->queryF($sql); + } + + } + redirect_header("index.php?op=views",2,_XC_DATABASEUPDATED); + break; + +case "views": + + $sql = "SHOW VIEWS FROM ".XOOPS_DB_NAME.""; + $ret = $xoopsDB->queryF($sql); + + $ele_tray = array(); + $form_view = new XoopsThemeForm(_XC_VIEWSFOR.' '.XOOPS_DB_NAME, "views", $_SERVER['PHP_SELF'] .""); + $form_view->setExtra( "enctype='multipart/form-data'" ) ; + + $field=0; + while(list($table) = $xoopsDB->fetchRow($ret)){ + $field++; + $tbldat = get_tableconfig($table); + if (!isset($tbldat)){ + + $new++; + $ele_tray[$field] = new XoopsFormElementTray($table.' (new)',' ',$table); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", "new")); + $ele_tray[$field]->addElement(new XoopsFormHidden("viewname[$field]", $table)); + + $retrieve[$field] = new XoopsFormCheckBox("Retrieve", "retrieve[$field]"); + $visible[$field] = new XoopsFormCheckBox("Visible", "post[$field]"); + + $retrieve[$field]->addOption(1, ' '); + $visible[$field]->addOption(1, ' '); + + } else { + + $ele_tray[$field] = new XoopsFormElementTray(strip_prefix($table).'',' ',strip_prefix($table)); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", $tbldat['tbl_id'])); + $ele_tray[$field]->addElement(new XoopsFormHidden("viewname[$field]", strip_prefix($table))); + + $retrieve[$field] = new XoopsFormCheckBox("Retrieve", "retrieve[$field]"); + $visible[$field] = new XoopsFormCheckBox("Visible", "post[$field]"); + + $retrieve[$field]->addOption(1, ' '); + $visible[$field]->addOption(1, ' '); + + if ($tbldat['visible']==1) + $visible[$field]->setValue(1); + $ele_tray[$field]->addElement($visible[$field]); + + if ($tbldat['allowretrieve']==1) + $retrieve[$field]->setValue(1); + $ele_tray[$field]->addElement($retrieve[$field]); + + } + + $form_view->addElement( $ele_tray[$field] ); + } + + $form_view->addElement(new XoopsFormHidden("op", "saveviews")); + $form_view->addElement(new XoopsFormHidden("new", $new)); + $form_view->addElement(new XoopsFormButton('', 'send', _SEND, 'submit')); + + xoops_cp_header(); + adminMenu(3); + $form_view->display(); + footer_adminMenu(); + xoops_cp_footer(); + break; + +case "saveplugins": + + + foreach ($id as $f){ + $tt++; + switch ($f){ + case "new": + $sql = "INSERT INTO ".$xoopsDB->prefix('json_plugins')." (plugin_name, plugin_file, active) VALUES ('".addslashes($functionname[$tt])."','".addslashes($filename[$tt])."','".intval($active[$tt])."')"; + $ty=$xoopsDB->queryF($sql); + break; + default: + $sql = "UPDATE ".$xoopsDB->prefix('json_plugins')." SET active ='".intval($active[$tt])."' WHERE plugin_id = ".$id[$tt]; + $ty=$xoopsDB->queryF($sql); + } + + } + redirect_header("index.php?op=plugins",2, _XC_SAVEDSUCCESSFUL); + break; + +case "plugins": + error_reporting(E_ALL); + global $xoopsModuleConfig; + require_once('../class/class.functions.php'); + $funct = new FunctionsHandler($xoopsModuleConfig['wsdl']); + + $FunctionDefine = array(); + foreach($funct->GetServerExtensions() as $extension){ + $phpcode= file_get_contents(XOOPS_ROOT_PATH.'/modules/xjson/plugins/'.$extension); + ob_start(); + $r=eval("?>".$phpcode."<?php +"); + $result = ob_get_contents(); + ob_end_clean(); + if (strpos(' '.$result,"Parse")==0){ + $FunctionDefine[] = $extension; + } + + } + + $ele_tray = array(); + $form_plugin = new XoopsThemeForm(_XC_PLUGINAVAILABLE, "plugins", $_SERVER['PHP_SELF'] .""); + $form_plugin->setExtra( "enctype='multipart/form-data'" ) ; + + $field=0; + foreach($FunctionDefine as $func) { + + $field++; + + $functdata = get_functionconfig($func); + if (!isset($functdata)){ + $new++; + + $ele_tray[$field] = new XoopsFormElementTray($func.' (new)',' ',$func); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", "new")); + $ele_tray[$field]->addElement(new XoopsFormHidden("functionname[$field]", str_replace('.php','',$func))); + $ele_tray[$field]->addElement(new XoopsFormHidden("filename[$field]", $func)); + + $active[$field] = new XoopsFormCheckBox("Active", "active[$field]"); + $active[$field]->addOption(1, ' '); + $ele_tray[$field]->addElement($active[$field]); + + } else { + + $ele_tray[$field] = new XoopsFormElementTray($func.'',' ',$func); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", $functdata['plugin_id'])); + $ele_tray[$field]->addElement(new XoopsFormHidden("functionname[$field]", str_replace('.php','',$func))); + $ele_tray[$field]->addElement(new XoopsFormHidden("filename[$field]", $func)); + + $active[$field] = new XoopsFormCheckBox("Active", "active[$field]"); + + $active[$field]->addOption(1, ' '); + + if ($functdata['active']==1) + $active[$field]->setValue(1); + $ele_tray[$field]->addElement($active[$field]); + + } + $form_plugin->addElement( $ele_tray[$field] ); + } + + $form_plugin->addElement(new XoopsFormHidden("op", "saveplugins")); + $form_plugin->addElement(new XoopsFormHidden("new", $new)); + $form_plugin->addElement(new XoopsFormButton('', 'send', _SEND, 'submit')); + + xoops_cp_header(); + adminMenu(4); + $form_plugin->display(); + footer_adminMenu(); + xoops_cp_footer(); + break; + +default: + + $sql = "SHOW TABLES FROM ".XOOPS_DB_NAME." LIKE '".XOOPS_DB_PREFIX."\_%'"; + $ret = $xoopsDB->queryF($sql); + + $ele_tray = array(); + $form_tables = new XoopsThemeForm(_XC_TABLESAVAILABLE.' '.XOOPS_DB_NAME, "tables", $_SERVER['PHP_SELF'] .""); + $form_tables->setExtra( "enctype='multipart/form-data'" ) ; + + $field=0; + while(list($table) = $xoopsDB->fetchRow($ret)){ + $field++; + $tbldat = get_tableconfig($table); + + if (!isset($tbldat)){ + $new++; + + $ele_tray[$field] = new XoopsFormElementTray(strip_prefix($table).' (new)',' ',strip_prefix($table)); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", 'new')); + $ele_tray[$field]->addElement(new XoopsFormHidden("tablename[$field]", strip_prefix($table))); + + $post[$field] = new XoopsFormCheckBox("Post", "post[$field]", 0); + $retrieve[$field] = new XoopsFormCheckBox("Retrieve", "retrieve[$field]", 0); + $update[$field] = new XoopsFormCheckBox("Update", "update[$field]", 0); + $visible[$field] = new XoopsFormCheckBox("Visible", "visible[$field]", 0); + + $post[$field]->addOption(1, ' '); + $retrieve[$field]->addOption(1, ' '); + $update[$field]->addOption(1, ' '); + $visible[$field]->addOption(1, ' '); + + $ele_tray[$field]->addElement($post[$field]); + $ele_tray[$field]->addElement($retrieve[$field]); + $ele_tray[$field]->addElement($update[$field]); + $ele_tray[$field]->addElement($visible[$field]); + + } else { + + $ele_tray[$field] = new XoopsFormElementTray(strip_prefix($table).'',' ',strip_prefix($table)); + $ele_tray[$field]->addElement(new XoopsFormHidden("id[$field]", $tbldat['tbl_id'])); + $ele_tray[$field]->addElement(new XoopsFormHidden("tablename[$field]", strip_prefix($table))); + + $post[$field] = new XoopsFormCheckBox("Post", "post[$field]", $tbldat['allowpost']); + $retrieve[$field] = new XoopsFormCheckBox("Retrieve", "retrieve[$field]", $tbldat['allowretrieve']); + $update[$field] = new XoopsFormCheckBox("Update", "update[$field]", $tbldat['allowupdate']); + $visible[$field] = new XoopsFormCheckBox("Visible", "visible[$field]", $tbldat['visible']); + + $post[$field]->addOption(1, ' '); + $retrieve[$field]->addOption(1, ' '); + $update[$field]->addOption(1, ' '); + $visible[$field]->addOption(1, ' '); + + $ele_tray[$field]->addElement($post[$field]); + $ele_tray[$field]->addElement($retrieve[$field]); + $ele_tray[$field]->addElement($update[$field]); + $ele_tray[$field]->addElement($visible[$field]); + + } + $form_tables->addElement( $ele_tray[$field] ); + } + + $form_tables->addElement(new XoopsFormHidden("op", "savetables")); + $form_tables->addElement(new XoopsFormHidden("new", $new)); + $form_tables->addElement(new XoopsFormButton('', 'send', _SEND, 'submit')); + + xoops_cp_header(); + adminMenu(1); + $form_tables->display(); + footer_adminMenu(); + xoops_cp_footer(); + break; + +} + +function strip_prefix($raw_tablename){ + return str_replace(XOOPS_DB_PREFIX."_",'',$raw_tablename); +} + +function get_tableconfig($raw_tablename){ + global $xoopsDB; + $sql = "SELECT * FROM ".$xoopsDB->prefix('json_tables')." WHERE tablename = '".strip_prefix($raw_tablename)."'"; + $ret = $xoopsDB->query($sql); + if ($xoopsDB->getRowsNum($ret)){ + return $xoopsDB->fetchArray($ret); + } else { + + } +} +function get_functionconfig($plugin_filename){ + global $xoopsDB; + $sql = "SELECT * FROM ".$xoopsDB->prefix('json_plugins')." WHERE plugin_file = '".addslashes($plugin_filename)."'"; + $ret = $xoopsDB->query($sql); + if ($xoopsDB->getRowsNum($ret)){ + return $xoopsDB->fetchArray($ret); + } else { + + } +} + +function get_fieldconfig($raw_fieldname, $tbl_id){ + global $xoopsDB; + $sql = "SELECT * FROM ".$xoopsDB->prefix('json_fields')." WHERE fieldname = '$raw_fieldname' and tbl_id = $tbl_id"; + $ret = $xoopsDB->query($sql); + if ($xoopsDB->getRowsNum($ret)){ + return $xoopsDB->fetchArray($ret); + } else { + + } +} +function get_tableid($tablename){ + global $xoopsDB; + $sql = "SELECT * FROM ".$xoopsDB->prefix('json_tables')." WHERE tablename = '$tablename'"; + $ret = $xoopsDB->query($sql); + $row = $xoopsDB->fetchArray($ret); + return $row['tbl_id']; +} + +function get_tablename($tableid){ + global $xoopsDB; + $sql = "SELECT * FROM ".$xoopsDB->prefix('json_tables')." WHERE tbl_id = '$tableid'"; + $ret = $xoopsDB->query($sql); + $row = $xoopsDB->fetchArray($ret); + return $row['tablename']; +} + +function compile_wsdl(){ + return true; +} + + +?> \ No newline at end of file Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/menu.php =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/menu.php (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/menu.php 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,18 @@ +<?php + +$adminmenu[1]['title'] = _XC_ADMINMENU_1; +$adminmenu[1]['link'] = "admin/index.php?op=tables"; +$adminmenu[1]['icon'] = "images/dbtables.png"; +$adminmenu[2]['title'] = _XC_ADMINMENU_2; +$adminmenu[2]['link'] = "admin/index.php?op=fields"; +$adminmenu[2]['icon'] = "images/dbfields.png"; +$adminmenu[3]['title'] = _XC_ADMINMENU_3; +$adminmenu[3]['link'] = "admin/index.php?op=views"; +$adminmenu[3]['icon'] = "images/dbviews.png"; +$adminmenu[4]['title'] = _XC_ADMINMENU_4; +$adminmenu[4]['link'] = "admin/index.php?op=plugins"; +$adminmenu[4]['icon'] = "images/plugins.png"; +$adminmenu[5]['title'] = _XC_ADMINMENU_5; +$adminmenu[5]['link'] = "admin/permissions.php"; +$adminmenu[5]['icon'] = "images/permissions.png"; +?> \ No newline at end of file Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/permissions.php =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/permissions.php (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/admin/permissions.php 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,53 @@ +<?php + +include_once("admin_header.php"); +include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; + +$op = ''; + +foreach ($_POST as $k => $v) { + ${$k} = $v; +} + +foreach ($_GET as $k => $v) { + ${$k} = $v; +} + +switch ($op) { + case "default": + default: + global $xoopsDB, $xoopsModule; + + $module_handler = xoops_gethandler('module'); + $xoModule = $module_handler->getByDirname('xjson'); + + xoops_cp_header(); + adminmenu(5); + // View Categories permissions + $item_list_view = array(); + $block_view = array(); + + $result_view = $xoopsDB->query("SELECT plugin_id, plugin_name FROM " . $xoopsDB->prefix("json_plugins") . " "); + if ($xoopsDB->getRowsNum($result_view)) { + while ($myrow_view = $xoopsDB->fetcharray($result_view)) { + $item_list_view['cid'] = $myrow_view['plugin_id']; + $item_list_view['title'] = $myrow_view['plugin_name']; + $form_view = new XoopsGroupPermForm("", $xoModule->getVar('mid'), "plugin_call", "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/close12.gif alt='' /></a>" . _XC_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _XC_VIEW_FUNCTION . "</span>"); + $block_view[] = $item_list_view; + foreach ($block_view as $itemlists) { + $form_view->addItem($itemlists['cid'], $itemlists['title']); + } + } + echo $form_view->render(); + } else { + echo "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoModule->dirname() . "/images/close12.gif alt='' /></a> " . _XCOAP_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _XC_NOPERMSSET . "</span>"; + + } + echo "</div>"; + + echo "<br />\n"; +} +footer_adminMenu(); +xoops_cp_footer(); + +?> \ No newline at end of file Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/class.functions.php =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/class.functions.php (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/class.functions.php 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,81 @@ +<?php +class FunctionsHandler { + + var $functions=array(); + + function __construct($wsdl){ + + } + + function GetServerExtensions (){ + $files = array(); + $f = array(); + $files = $this->getFileListAsArray(XOOPS_ROOT_PATH.'/modules/xjson/plugins/'); + static $f_count; + static $f_buffer; + + if ($f_count != count($files)){ + $f_count = count($files); + foreach($files as $k => $l){ + if (strpos($k,".php",1)== (strlen($k)-4)){ + $f[] = $k; + } + } + $f_buffer = $f; + } + + return $f_buffer; + + } + + function getDirListAsArray( $dirname ) { + $ignored = array(); + $list = array(); + if ( substr( $dirname, -1 ) != '/' ) { + $dirname .= '/'; + } + if ( $handle = opendir( $dirname ) ) { + while ( $file = readdir( $handle ) ) { + if ( substr( $file, 0, 1 ) == '.' || in_array( strtolower( $file ), $ignored ) ) continue; + if ( is_dir( $dirname . $file ) ) { + $list[$file] = $file; + } + } + closedir( $handle ); + asort( $list ); + reset( $list ); + } + //print_r($list); + return $list; + } + + /* + * gets list of all files in a directory + */ + function getFileListAsArray($dirname, $prefix="") + { + $filelist = array(); + if (substr($dirname, -1) == '/') { + $dirname = substr($dirname, 0, -1); + } + if (is_dir($dirname) && $handle = opendir($dirname)) { + while (false !== ($file = readdir($handle))) { + if (!preg_match("/^[\.]{1,2}$/",$file) && is_file($dirname.'/'.$file)) { + $file = $prefix.$file; + $filelist[$file] = $file; + } + } + closedir($handle); + asort($filelist); + reset($filelist); + } + return $filelist; + } + + function __destruct(){ + + } + +} + +?> \ No newline at end of file Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/index.html =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/index.html (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/class/index.html 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,10 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Untitled Document</title> +</head> + +<body> +</body> +</html> Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/close12.gif =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/close12.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbfields.png =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbfields.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbtables.png =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbtables.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbviews.png =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/dbviews.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/index.html =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/index.html (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/index.html 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,10 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Untitled Document</title> +</head> + +<body> +</body> +</html> Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/left_both.gif =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/left_both.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/open12.gif =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/open12.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/permissions.png =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/permissions.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/plugins.png =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/plugins.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/right_both.gif =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/right_both.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/xrest_slogo.png =================================================================== (Binary files differ) Property changes on: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/images/xrest_slogo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/JSON.php =================================================================== --- XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/JSON.php (rev 0) +++ XoopsModules/xrest/releases/1.50/htdocs/modules/xrest/include/JSON.php 2012-01-04 12:46:39 UTC (rev 8634) @@ -0,0 +1,806 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +/** + * Converts to and from JSON format. + * + * JSON (JavaScript Object Notation) is a lightweight data-interchange + * format. It is easy for humans to read and write. It is easy for machines + * to parse and generate. It is based on a subset of the JavaScript + * Programming Language, Standard ECMA-262 3rd Edition - December 1999. + * This feature can also be found in Python. JSON is a text format that is + * completely language independent but uses conventions that are familiar + * to programmers of the C-family of languages, including C, C++, C#, Java, + * JavaScript, Perl, TCL, and many others. These properties make JSON an + * ideal data-interchange language. + * + * This package provides a simple encoder and decoder for JSON notation. It + * is intended for use with client-side Javascript applications that make + * use of HTTPRequest to perform server communication functions - data can + * be encoded into JSON notation for use in a client-side javascript, or + * decoded from incoming Javascript requests. JSON format is native to + * Javascript, and can be directly eval()'ed with no further parsing + * overhead + * + * All strings should be in ASCII or UTF-8 format! + * + * LICENSE: Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: Redistributions of source code must retain the + * above copyright notice, this list of conditions and the following + * disclaimer. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * @category + * @package Services_JSON + * @author Michal Migurski <mik...@te...> + * @author Matt Knapp <mdknapp[at]gmail[dot]com> + * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com> + * @copyright 2005 Michal Migurski + * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $ + * @license http://www.opensource.org/licenses/bsd-lice... [truncated message content] |