Skip to content
Snippets Groups Projects
Commit ffb5f860 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

check-out of WININDX stable branch on 2019-10-26 as of r3006, using:

parents
Branches
No related tags found
No related merge requests found
Showing
with 3125 additions and 0 deletions
RELEASES:
v5.8.2
Focus: Minor bug, feature, and security fixes and improvements.
BUGS:
1. Fix for https://sourceforge.net/p/wikindx/v5bugs/167/ – select box for languages reverting to default language and slashes before quotes.
2. Fix display of ‘next’ arrow when displaying a random idea.
FEATURE ENHANCEMENTS:
1. Improved the processing and display of creator aliases.
SECURITY:
1. Fix an XSS vulnerability in paging (CVE-2019-13588)
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.8.1
Focus: Minor database upgrade and bug fixes
BUGS:
1. Minor display issues with the 'next' link when displaying a random resource.
2. Incorrect display of resource lists and totals when using alphanumeric paging.
3. In SQL:like(), a collation of 'COLLATE utf8mb4_bin' meant many results were not found in QUICKSEARCH that should have been found.
This has been corrected to 'COLLATE utf8mb4_unicode_520_ci'.
4. Fix for https://sourceforge.net/p/wikindx/v5bugs/156/ – ensure matches across table and directories for attachments (checked when upgrading).
5. Fixed display of internal citations in the long custom field.
6. With a new install of 5.7.3, the folder styles/CACHE/ is missing and WIKINDX will not run. This has been fixed. Errors here, and in 5.7.3,
resulted from the use of a new compression routine when making the release file – this routine did not compress empty folders.
FEATURE ENHANCEMENTS:
1. Removed WIKINDX_ALLOW_DBUPGRADE (too clumsy to use) and instead enhanced the warning messages during DB upgrade in case a user
attempts to use SVN code requiring such an upgrade on a production server.
2. Use the viewport for tablets.
SECURITY:
1. Fix an XSS vulnerability in menu display (CVE-2019-12930)
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.7.4
Focus: Quick bug fix for a broken 5.7.3 release.
Private release that contains bug fix 6 and feature 2 of version 5.8.1.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.7.3
Focus: Quick bug fix for a broken 5.7.2 release
BUGS:
1. With a new install of 5.7.2, the folder tplcompilation/ is missing and WIKINDX will not run. This has been fixed.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.7.2
Focus: Maintenance release
FEATURE ENHANCEMENTS:
1. Migration programming manual to phpDocumentor 3.
2. Full support of PHP 7.3.x (#154).
3. Update json2.js library to 2017-06-12 version
4. Add the constant WIKINDX_ALLOW_DBUPGRADE (TRUE/FALSE). Allow DB upgrade or not. WIKINDX_ALLOW_DBUPGRADE should be FALSE for SVN
code and TRUE for release code (whether that release code upgrades the DB or not)
BUGS:
1. Add a missing column (resourceattachmentsResourceId) in GROUP BY clause of list common, that fix a crash on MySQL 5.6.x.
2. Check minimal MySql and MariaDB engine version flawlessly, without diying hard, in debug mode.
3. Fix for the search bug and accents (https://sourceforge.net/p/wikindx/v5bugs/157/). A new MySQL server setting for the length of
GROUP_CONCAT() has been set: if, in config.php, $WIKINDX_DB_PERSISTENT is set to TRUE, set it to FALSE temporarily to pick up this new setting.
4. Fix #158: unterminated regular expression literal in json2.js
5. Fix #159: URL editor: syntax error in advlink.js
6. Fix "character_set_connection" and "collation_connection" values by not calling SET CHARACTER SET 'utf8mb4'
after SET NAMES utf8mb4 COLLATE 'utf8mb4_unicode_520_ci'; Indeed, "SET CHARACTER SET" has the perverse effect
of resetting to utf8 these two variables that "SET NAMES" has already positioned well in utf8bm4.
7. Fix https://sourceforge.net/p/wikindx/v5bugs/160/ – abbreviation of creator name lists using et al. or similar.
8. Fix upgrade of [code]example[/code] bbcode tags broken by the migration of preg_replace to utf8:
Warning: preg_replace(): Unknown modifier '.' in .\wikindx\core\display\BBCODE.php on line 114
9. Fix a bug in the display of ideas. Template designers should change the following in content_ideas.tpl:
{if isset($ideaList.navigation)}
<tr>
<td align="right">
{"&nbsp;&nbsp;"|implode:$ideaList.navigation}
</td>
</tr>
{/if}
to:
{if isset($navigation)}
<tr>
<td align="right">
{"&nbsp;&nbsp;"|implode:$navigation}
</td>
</tr>
{/if}
SECURITY:
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.7.1
Focus: bug fixes for v5.7 and minor feature enhancements. The database is NOT upgraded.
FEATURE ENHANCEMENTS:
1. There are now three ways to add attachments to resources including drag and drop of multiple files.
Template designers should add the following to templates/xxxx/template.css and edit according to style:
/**
* START multiple file upload styles
*
* Adapted from https://code-boxx.com/simple-drag-and-drop-file-upload/
*/
.attachmentBorder {
border: #F90 1px groove;
}
#uploader {
height: 200px;
background: transparent;
padding: 10px;
border-width: 1px;
border-style: solid;
}
#uploader.highlight {
background: #7FFF00;
}
#uploader.disabled {
background: #aaa;
}
/**
* END multiple file upload styles
*/
2. When editing a resource's attachments, it is now possible to delete all attachments via a single checkbox.
BUGS:
1. repairkit plugin (v1.6.1) : corrected a misnamed, case-sensitive path.
2. Update copyrights.
3. When adding (and caching) a new attachment, the filemtime() check sometimes incorrectly reported the file still needed
caching when going to the front page.
4. Make use of template/xxxx/icons/viewmetaAttach.png in list views when there are both metadata and attachments in a resource.
5. Fix incorrect display of Added by/Edited by 'Deleted user' when displaying lists and single resources.
SECURITY:
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.7
Focus: Major feature enhancements mainly for user authentication, bug fixes, and security improvements. The database is upgraded.
N.B. There are no versions 5.4, 5.5, or 5.6 (bringing WIKINDX version no. in sync. with the database version no.).
FEATURE ENHANCEMENTS:
1. In order to speed up searching of attachments, PDF, DOC, and DOCX files are cached as text files in the new attachments_cache/ folder. A cache
check is done on first running of the home page of v5.7 and above and the caching proceeds as necessary – depending on how many attachments you
have and how large they are, this one-off process might take some time. Subsequently, each time an attachment is added to a resource, it is cached.
2. Added LDAP authentication for accessing the WIKINDX. Set this up from Admin|Configure.
3. Implemented an authentication gate that can be controlled through the Admin|Configure menu. This is intended to ensure users read and accept any
privacy policy such as any used for the EU's General Data Protection Regulation.
4. From the Admin|Users menu, admins can now temporarily block/unblock users. Among other things, blocking users is useful when upgrading the database.
5. Update Smarty from 3.1.30 to 3.1.33 : PHP 7.2 compatibility.
6. Update PHPMailer from 6.0.3 to 6.0.6 : PHP 7.3 compatibility.
7. Different strengths of user password can be set. Set this up from Admin|Configure.
8. Replace AdoDB library by a native Database abstraction Layer that support multiple queries.
9. Use the full power of the native DDL for db upgrade.
10. Provide a way of upgrading the db structure of plugins.
11. Use MySql utf8mb4 encoding and utf8mb4_unicode_520_ci collation that fix a number of sorting issues (based on UCA 5.2.0 weight
keys [http://www.unicode.org/Public/UCA/5.2.0/allkeys.txt]).
12. Version 3 of plugins (fix the display of plugins menus).
13. Optimized database upgrade process.
BUGS:
1. Fixed a session error that led to read-only users experiencing a PHP memory allocation error when listing large numbers of resources.
2. Fixed a minor bug in the search function when inserting a citation that caused an error when there were no results.
3. Fixed a bug in upgrading a pre-v5 database: collections such as journals are no longer being removed from the resources (duplicates are
being correctly removed from the collections table while the collection field in resource_misc is now correctly updated).
4. Fixed a fatal error that stopped wikindx loading if plugin versions were not compatible with the latest wikindx version.
5. 'Quick List All...' now takes account of the user bibliography that is set for browsing.
6. A template error (on the next metadata link) when viewing random metadata has been fixed.
7. Stop changing the charset and the collation of the database because (wikindx can be in a shared db).
8. Fix a warning about configListlink for public access.
9. Fix an error in the template compilation of the resource delete page. Template designers should amend the following lines in content.tpl:
{if isset($resourceList.submit)}
<div class="resourceListSubmitBlock">{$resourceList.submit}</div>
{/if}
to:
{if isset($submit)}
<div class="resourceListSubmitBlock">{$submit}</div>
{/if}
10. Fixed a minor issue with presenting the logon screen following a logout if read only access was enabled.
11. Fixed a bug with the display of quotes, paraphrases, and musings. Template designers should change the following (or similar) in:
content_quotes.tpl:
<td><strong><span class="small">{$resourceSingle.quotes.title}</span></strong>
{if isset($resourceSingle.quotes.editLink)}&nbsp;&nbsp;{$resourceSingle.quotes.editLink}{/if}</td>
to:
<td><strong><span class="small">{$resourceSingle.quotesTitle}</span></strong>
{if isset($resourceSingle.quotesEditLink)}&nbsp;&nbsp;{$resourceSingle.quotesEditLink}{/if}
</td>
and
content_paraphrases.tpl:
<td><strong><span class="small">{$resourceSingle.paraphrases.title}</span></strong>
{if isset($resourceSingle.paraphrases.editLink)}&nbsp;&nbsp;{$resourceSingle.paraphrases.editLink}{/if}</td>
to:
<td><strong><span class="small">{$resourceSingle.paraphrasesTitle}</span></strong>
{if isset($resourceSingle.paraphrasesEditLink)}&nbsp;&nbsp;{$resourceSingle.paraphrasesEditLink}{/if}
</td>
and
content_musings.tpl:
<td><strong><span class="small">{$resourceSingle.musings.title}</span></strong>
{if isset($resourceSingle.musings.editLink)}&nbsp;&nbsp;{$resourceSingle.musings.editLink}{/if}</td>
to:
<td><strong><span class="small">{$resourceSingle.musingsTitle}</span></strong>
{if isset($resourceSingle.musingsEditLink)}&nbsp;&nbsp;{$resourceSingle.musingsEditLink}{/if}
</td>
12. Fixed an issue with user self-registration that sent users to the login prompt instead of the registration screen.
13. Fix for bug https://sourceforge.net/p/wikindx/v5bugs/151/ – incorrect browsing of collections.
14. Fix slow queries on some installations of MySQL when INFORMATION_SCHEMA and TABLE_SCHEMA are used.
15. Fix for bug https://sourceforge.net/p/wikindx/v5bugs/123/ (surnames with apostrophe or dash were not found when entered into
quicksearch and cases where one author goes under several nom de plumes).
SECURITY:
1. Enforce session security against session usurpation, cookies forgery, and Cross-Site Scripting attacks.
2. Add a .htaccess in docs/manual to prevent malicious code execution in that directory.
3. On WIKINDX initialization, forbid common superadmin usernames.
4. Update Smarty from 3.1.30 to 3.1.33 : fix for CVE-2018-16831.
5. Update PHPMailer from 6.0.3 to 6.0.6 : Fix potential object injection vulnerability. CVE-2018-19296.
6. Fix an XSS Vulnerability in ressource view (CVE-2019-9961).
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.3.2
Focus: Minor feature enhancements and bug fixes.
FEATURE ENHANCEMENTS:
1. Optimizations to search and list routines: speed is improved and next/previous links on single resource view work as they should.
2. Optimizations of SQL inserts when organizing large numbers of resources (resource lists can be bulk-reorganized with keywords, categories etc.).
3. Improved display of idea lists and the idea thread view now has links for previous and next thread.
Template designers should add the $ideaListInfo block to their content_ideas.tpl file
(see templates/default/content_ideas.tpl) and change the code
<td align="right">
{$ideaList.navigation}
</td>
to
<td align="right">
{"&nbsp;&nbsp;"|implode:$ideaList.navigation}
</td>
BUGS:
1. Admin Configure Miscellaneous interface: Fix incorrect sorting on restricted user so that the database userId is correctly used.
2. When citing another resource, ensure the apostrophe is no longer split in some citation styles. e.g. "As Grimshaw (2018)'s
article states" is now correctly rendered as "As Grimshaw's (2018) article states".
3. Corrected incorrect mapping of page numbers when importing bibtex files with book chapters.
4. Minor debugging and improved validification of search phrase.
5. https://sourceforge.net/p/wikindx/v5bugs/140/ (delete images) and some related debugging re. uploading of images.
6. Fix an issue stopping a newly registered user logging on.
7. Update special chars table to Unicode 11
8. Fix broken session saveState() – for logged on users, sessions are now restored for each logon.
9. Fix minor error in monthly statistics compilation.
10. Fix bibtex and endnote import where deactivated resource types were not ignored (https://sourceforge.net/p/wikindx/v5bugs/143/).
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.3.1
Focus: Minor feature enhancements and bug fixes. The database is upgraded.
1. Improved wildcard matching in quick search and advanced search.
2. Progress on PHP 7.2 support.
3. When first adding (rather than editing) quotes, paraphrases, and musings, fill in the keyword textarea with the resource's keywords.
4. Request dx.doi.org, wikipedia, sourceforge.net, amazon, www.ncbi.nlm.nih.gov, www.unicode.org via HTTPS.
5. resourceForm.js, RESSOURCEWRITE.php : test HTTP and HTTPS.
6. Added the American 'Fall' (Autumn) to the list of months in English CONSTANTS.php
7. Added calendar functionality to embargo date when adding an attachment to a resource and to the resource new/edit form.
8. Rewritten the Admin|Configure interface to be more user friendly.
9. Many variables in config.php have been moved to the Admin|Configure interface. Check config.php.dist to see what is now expected
in config.php. When upgrading an existing WIKINDX to v5.3, config.php is rewritten with a limited set of variables – all other variables
are transferred to the database which is upgraded when running v5.3 for the first time.
10. Via Admin|Configure, it is now possible to display all statistics to read-only users (choosing to hide user data if required).
11. Update jQuery from v1.12.4 to v3.3.1.
BUGS:
1. Fix bug #126 : PHP 7.2 changes the behaviour of sessions and we can't define *session.usecookies* at startup.
Since *session.usecookies* is ON by default after PHP 5.3, we can remove this operation safely.
2. Fixed the display of backslashes in text fields.
3. Some journal article page numbers are given in the format 500.e1-500.e9 where, presumably, the 'e'
stands for electronic (online). Such numbers are now stored as is instead of being expanded as an exponent (e.g. 500.e3 –> 500000).
4. Fix a crash of all templates on attachments listing when an anonymous user sees a resource.
5. Fix warnings in image uploader (unable to calculate the size of the uploaded image).
6. Fix bug #126 : count on non array variable is now forbidden.
7. Remove a dead JS link (blocking for IE).
8. Fix wikindxImageDialog.js to accept https content.
9. Fix HTML syntax errors.
10. Under some circumstances, a previously entered URL was not displayed when editing resources.
11. Under some circumstances, the editUserId field was not updated in the database when editing a resource. This resulted in the
display of 'Deleted User' as the last person editing the file.
12. Fix to https://sourceforge.net/p/wikindx/v5bugs/132/ (searching on exact phrase with a filtered word).
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.2.2
Focus: Minor feature enhancements and bug fixes.
1. Upgrade PHPMailer to 6.0.3 (no new option provided, but imply that autosigned certificates
are allowed, server names are not checked:
cf. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#updating-ca-certificates).
2. Upgrade PdfToText to 1.6.6 (add compliance with PHP versions < 5.6 and a better support of UTF8).
3. Word search fields in Quick and Advanced search can now use the wildcard characters '?' and '*'.
These are treated as literal characters in "exact phrases".
4. Bug fix: https://packetstormsecurity.com/files/146208/Wikindx-5.2.1-Cross-Site-Scripting.html
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v5.2.1
Focus: Major feature enhancements, optimization, and minor bug fixes.
NB -- This version upgrades the database so ensure your pre-existing WIKINDX database is
backed up before running. Either a v3.8.2 database or a v4.x database can be upgraded.
NB -- at least PHP 5.5.0 is now needed.
NB -- template designers will need to update their .tpl files to account for Smarty 3.1's
stricter type and variable checking (without 2.x BC compatibility mode).
This means the use of {if isset($variable)}. . .{/if} statements. See the default/
templates for examples.
NB -- you will need to add the following variables to config.php (see config.php.dist):
1. $WIKINDX_CMS_LANGUAGE
2. $WIKINDX_MAX_WRITECHUNK
3. $WIKINDX_IMAGES_ALLOW
4. $WIKINDX_IMAGES_MAXSIZE
5. $WIKINDX_DEBUG_EMAIL
A number of email-related variables have been removed from or added to config.php --
see Feature Enhancement 15 below.
$WIKINDX_RSS_HOST has been removed from config.php.
NB -- if your database is over 1500 resources and you expect to export
lists of resources of at least this length (with the importexportbib plugin), then you should set
public $WIKINDX_MEMORY_LIMIT = "64M";
or more in config.php in order to avoid memory allocation errors. See also $WIKINDX_MAX_WRITECHUNK.
FEATURE ENHANCEMENTS:
1. Added ideas. Where musings are specific to resources, ideas are database
wide, are threaded and can be public, private or shared
with a group. Template designers should update their .tpl files accordingly.
See templates/default/content.tpl and templates/default/content_ideas.tpl --
a new .tpl file, content_ideas.tpl, should be created and linked to in content.tpl
in the section labelled
{* START METADATA ENTRY DISPLAY (NEW/EDIT QUOTES, PARAPHRASES, MUSINGS AND COMMENTS) *}
2. Added a glossary. When adding/editing keywords, a glossary annotation may be
appended to the keyword. The annotation is displayed when the mouse hovers over a keyword.
3. Resource originators can delete resources they added.
4. Replaced Select Resources, Search Resources, Select Metadata, and Search Metadata
with a new Advanced Search that allows complex, composite search and select operations
to be quickly and easily constructed. Additionally full-text searches may be performed
on resource attachments of type PDF, DOC, or DOCX. Files larger that 10MB are quietly ignored. Searching
across several attachments takes some time . . . If your PHP installation has CURL installed, this
time is dramatically cut.
5. My Wikindx email notification. When setting notification to a digest of recent updates,
added the option to receive either a list of all recently added or edited resources or,
above a set value, just the total number of added or edited resources since the last notification.
6. Bibliographic styles can now include custom fields if these have been added to the
style using the adminstyle plugin.
7. When adding or editing a resource that belongs to a collection (e.g. an article in a
journal, a paper in proceedings), selecting the collection from the select box will now fill
in default data for that collection in several other fields. This can be overridden in the
resource add/edit form for each individual resource. The default values are set when editing
collections and the process of editing these values will also apply them to all resources in
that collection.
8. Added a new image browser for use when inserting images in the metadata textarea. In addition to
pointing the image to a URL (as before), users can now upload images to the images/ folder and can
browse and select images. This uploading can be disabled by setting the new configuration variable
$WIKINDX_IMAGES_ALLOW (see config.php.dist) to FALSE. File sizes are controlled through WIKINDX_IMAGES_MAXSIZE.
9. Clear template cache after the user chooses another template.
10. Upgrade Smarty template engine to version 3.1.30.
11. Upgrade ADOdb from v3.1.1 to v5.20.9.
12. Upgrade to HTML 5.
13. Add support for robots.txt and sitemaps to facilitate indexing of public content by web crawlers
and to hide internal stuff.
14. For reasons of memory optimization when displaying lists, COinS data (e.g. for exporting resources to Zotero)
have been separated from the list display. To access COinS, display a list then chose 'Export to COinS' from the
select box.
15. PEAR::MAIL is no longer used by WIKINDX. Instead, email has been rewritten to use PhpMailer 5.2.23 (https://github.com/PHPMailer).
Variables pertaining to email have been deleted in config.php: $WIKINDX_PEARMAIL_USE and $WIKINDX_MAIL_SMARGS
have been removed and xxxx_PEARMAIL_xxxx variables have been renamed to xxxx_MAIL_xxxx -- check config.php.dist.
16. Upgraded statistics view to give more options.
17. RSS feed conforms to the RSS standard and $WIKINDX_RSS_HOST has been removed in config.php.
18. Convert database table names to lowercase to be crossplatform.
19. Full support of UTF8 (code base and database [MySQL 3 bits only]).
20. More advanced RTF export of resources.
21. Compliance with RTF 1.9 specification.
22. Google's CAPTCHA (for user registration) has been replaced by a WIKINDX solution.
OPTIMIZATION:
1. Database: All data from research_quote, research_quote_text, research_quote_comment,
research_paraphrase, research_paraphrase_text, research_paraphrase_comment, research_musing,
research_musing_text have been moved into research_metadata and those tables removed. Columns in
research_keyword relating to quotes, paraphrases, and musings have been removed and their data
transferred to the researchkeywordMetadataId column.
2. Removed some javascript pop-ups in favour of HTML pop-ups (cf single resource view: 'View
all bibliographic details').
3. Many SQL statements have been optimized for speed especially those related to searches.
4. Other speed optimizations such as the loading of bibliographic styles.
5. PHP memory optimizations.
BUG FIXES:
1. Fixed SQL injection bug reported at: https://sourceforge.net/p/wikindx/discussion/326884/thread/9976f9f5/.
In config.php, WIKINDX_DEBUG_ERRORS should be FALSE on production servers.
2. Minor bugs with making the bibtexKey when importing bibtex.
3. When alphabetical paging is on, sorting by title produced an SQL error. This has been fixed.
4. Fixed a bug that, in some circumstances, prevented part-registered users from confirming their
registration.
5. Fixed a bug in SMTP.php that sometimes sent out news items to multiple addresses multiple times.
6. When editing a resource, the ID of the originator of the resource was replaced by the editor's ID. This
has been fixed.
7. When displaying a list of resources, deleting items from a user bibliography or from the database
has been fixed.
8. The peer reviewed flag has been added to books, book articles, and book chapters.
9. Users could be identified with resource creators when the user was added or edited. Now, from the
Admin|Config menu, the superadmin can likewise be identified.
10. Fix any memory leaks due to an oversight in fclose().
11. Separate is_dir and file_exists tests because order evaluation is not guaranteed for the same operator precedence in TEMPLATE loading.
12. Double quotes in a resource title caused display problems -- this has been fixed.
13. Braces {...} are removed from database field values that serve as the ordering field in lists, searches, browses and so on.
14. Fix some missing aspects of header and footer behaviour in specific pages (popup and page without menu).
15. Separate template cache to not confuse template programmer between template directories and special directories for template.
16. Remove use of functions deprecated in PHP < 7 (except MySQL extension).
17. Set unlimited memory when we launch a backup with the backupMySQL plugin (for very large databases).
18. When storing the plain version of resource title and subtitle (stored in resource::resourceTitleSort), ensure all HTML and
non-letter symbols are removed in order to correctly sort resources by title.
19. Turn on error_reporting to E_ALL if required to follow PHP >= 5.4.x policy.
20. Inifite loop if a curly brace was not balanced in titles.
21. Timeout in RTF export when a resource contains a picture.
22. Return correct mime types.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.2.2
Focus: Minor bug fixes and feature enhancements
FEATURE ENHANCEMENT:
1. Using the localeDescription plugin, users can now change the front page description (default set in Admin|Configure) to
a localized version if the user chooses that language localization.
2. Quicksearch has been simplified to just text input and the default join between search terms is now OR rather
than AND (this mirrors Goggle-type searching).
3. When creating/editing a new resource that can have a month publication date (e.g. journal article), seasons can now be added (e.g. Spring).
Localization editors should add the four season names to the two month arrays in languages/<lang.>/CONSTANTS.php as in the English version of
CONSTANTS.php
4. Bibliographic styles mean that not all bibliographic details are displayed when viewing resources. Therefore, when viewing a single resource,
all bibliographic details for that resource can now be displayed.
BUG FIXES:
1. Issues to do with localization languages and the logon prompt and some submit buttons.
2. When adding attachments, all embargo fields in the attachments table were updated.
3. When installing a fresh database, sometimes the user was unable to get to the configuration screen to set initial
superadmin details.
4. If only one new category was added, it was not possible to edit or delete it until a second category had been added.
5. Amended the SMTP code for emails to account for cases where the wikindx is operating through URL rewrite/redirect. Links to
wikindx added to emails under these conditions are now correct.
6. When importing bibTeX, keywords now have HTML and javascript stripped.
7. RSS feeds now fully validate with validator.w3.org. If RSS is turned on in config.php, an icon is set to be displayed in the
template's menu.tpl. Template designers should amend their custom templates accordingly.
8. Fixed English CONSTANTS.php so that timezone set in config.php now works.
9. Fixed https://sourceforge.net/p/wikindx/v4-bugs/79/ (re-ordering searches on creator IDs caused a SQL error).
10. For a new resource, abstract and note were not written to the database if there was the possibility of adding a small custom field
(but with no large custom field).
11. When importing/pasting bibtex, an '=' sign in the value string of an entry must now be escaped for it not to be taken as the key=value delimiter.
12. When editing a resource, any URL in a long custom field was messed up (https://sourceforge.net/p/wikindx/v4-bugs/87/).
13. When adding or editing a book chapter or book article, the details of a translated book either led to an error or were not written to the database.
14. Fixed an error in form header generation that stopped some forms (e.g. the bibliographic style plug-in) from working.
15. On some server environments, filepaths were incorrect for some tinyMCE functionality.
16. Improvements to core bibtex exporting especially when using the importexportbib plugin (the plugin should be updated to importexportbib4.2_1.6).
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.2.1
This version upgrades the database so ensure your database is backed up before running. Either a v3.8.2
database or a v4.1 database can be upgraded.
NB Template designers:
1. You will need a new icon in your template called 'toTop.png' (see templates/default/icons/).
2. Javascript functions for various popup windows have been removed from template.js.
3. You should shift the loading of the core javascript to be before the loading of template.js. In header.tpl,
the javascript section should now look something like this ($scripts has been moved):
<!-- Required Javascript -->
{* Placeholder for any javascript scripts or includes added in the PHP scripts. DO NOT REMOVE. *}
{$scripts}
{* Leave these assign lines *}
{assign var=loadAjaxScript value=$loadAjaxScript|default:false}
{if $loadAjaxScript}
<script src="core/ajax/ajax.js"></script>
{/if}
{* Change this path *}
<script src="{$tplPath}/template.js"></script>
Loading the core javascript functions first allows you to override these functions, such as the popup window
functions, in your template.js simply by redeclaring the functions in your template javascript (see core/coreJavascript.js).
See BUG FIX 8. below for updating config.php.
FEATURE ENHANCEMENT:
1. Plugins must now have $wikindxVersion in their config.php files. This must be an integer that is equal to
WIKINDX_PLUGIN_VERSION defined in core/startup/CONSTANTS.php, if it is not, the plugin will not load in the menus
or inline although you will still be able to administer them from the Admin|Plugins menu.
2. WIKINDX converted to use with PHP's mysqli functions as mysql functions will soon become deprecated.
3. All GROUP BY functions made compatible with MySQL's ONLY_FULL_GROUP_BY mode.
4. Updated the database to increase field sizes for resource titles, subtitles etc. to account for titles such
as those found here: http://oldbooktitles.tumblr.com/
5. Updated the database to increase the usersUserSession field which was overflowing in 4.1 and causing problems
with navigation.
6. Updated the database to increase the field sizes in the cache table.
7. Added a database field and enabled the user to add a description for each resource's attachments.
8. Improved the interfaces for new/edit resource, resource category/keyword etc. editing, and search/select resources/metadata.
9. Improved resorting of lists.
10. When viewing a list, improved the interface to add/remove chosen resources to/from categories/keywords etc.
11. Statistics can now be viewed for each user.
12. Improvements to the interfaces for Admin editing of categories and subcategories.
13. Statistics (less user data) are now available to all users.
14. Several interface improvements (e.g. editing keywords, creators, custom fields, categories etc.).
15. Added the option to ignore keywords when importing bibTeX resources.
16. When deleting a user, the choice is given to leave the user's metadata (quotes etc.) unchanged, to transfer them to the
superadmin, or to delete them.
17. The separator for authors in BibTeX imports can now be 'and', 'AND', or '&' ('AND' added).
BUG FIX:
1. When deleting a resource, all fields in the database_summary table were set to '1'. The repairkit plugin
does a check and fix of this if this has happened in the past.
2. Fixed a preg_replace warning when parsing bibtex creators.
3. In RSS feeds, the resource type is now translated.
4. DOI fields are now correctly resolved.
5. When selecting a resource from the front page, the next/previous arrows gave the wrong result.
6. Corrections to RSS feed.
7. When upgrading a v3.8.2 database, a more extensive check of UTF-8 characters is carried out.
8. Sometimes, depending on the OS or if the root directory of wikindx is not searchable (i.e. if PHP's getcwd() does
not work), the TinyMCE editor will not function completely. To fix this, $WIKINDX_WIKINDX_PATH has been added to
config.php.dist and should be copied to config.php.
9. If a resource had usertags, the references to those usertags were not removed when the resource was deleted.
10. Attachments were not deleted from the table or from the folder when a resource was deleted.
11. Several other minor bug fixes.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.9
Focus: Minor bug fixes
BUG FIX:
1. Unable to add a new user: https://sourceforge.net/p/wikindx/v4-bugs/45/
2. Despite admin configuration forbidding it, registered users were still able to add attachments.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.8
Focus: Minor feature enhancement and major bug fix
FEATURE ENHANCEMENT:
1. When viewing a list from List Resources or Browse, the list/browse parameters are now displayed.
BUG FIX:
1. When merging keywords, if one keyword was selected and a new keyword was typed and the two, regardless
of case, were equal, all keywords were deleted from the database. See https://sourceforge.net/p/wikindx/v4-bugs/43/
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.7
Focus: Minor bug fix
BUG FIX:
1. Missing PHP file added back to release
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.6
Focus: Minor feature enhancements and bug fixes
FEATURE ENHANCEMENTS:
1. Improved the database upgrade process: more information at the start especially about
PHP memory issues leading to blank pages (during upgrading, PHP error reporting is turned on).
2. Added index.html to certain folders to stop users being able to get a directory listing. The file
is empty -- edit these files if you wish to redirect (see: https://sourceforge.net/p/wikindx/v4-feature-requests/20/).
3. Added $WIKINDX_MAX_EXECUTION_TIMEOUT to config.php (copy it from config.php.dist).
BUG FIX:
1. Inconsistency in conferences and publisher fields for proceedings and proceedings_article types.
2. When viewing a single resource and using numeric paging, the next and previous links work for the entire list.
3. Correction to bibtex export for web_articles.
4. Corrected errors when installing a fresh wikindx that had crept in c.v4.1.3.
5. v4.1 switches the numPages data for books and theses from resourceField6 to resourcemiscField6 -- this is now accounted for
in the database update process.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.5
Focus: Major Bug Fix
BUG FIX:
1. Deleting a note would delete all notes, deleting an abstract would delete all abstracts.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.4
Focus: Bug fixes
BUG FIXES:
1. Fixed some styles not displaying author names correctly.
2. Some fixes to list displays when using alphabetic ordering in Preferences.
3. When editing resources, under some circumstances and when removing creators, the resource_creator table was not written correctly.
4. When upgrading a database from v3,8,2, bad UTF8 characters are fixed.
5. Fix for bibTeX export: https://sourceforge.net/p/wikindx/v4-bugs/26/
Other minor bugs mainly to do with warnings and formatting.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.3
Focus: Minor bug fix
BUG FIXES:
1. When upgrading a v3.8.2 database, the sql_mode is set incorrectly
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.2
Focus: Minor feature enhancements and bug fixes
FEATURE ENHANCEMENTS:
1. When viewing lists ordered by title, creator or attachments and with alphabetic paging turned on, paging letters
are aggregated until the max. no. resources to display is reached. Instead of single letters, if the max. no.
is 10, resources listed under A, B, C will be displayed on one screen as 'A~C' if they total <= 10 and so on.
2. When importing and exporting bibTeX files, for @book and @thesis types, the bibTeX field 'pages' maps to number of pages.
3. Added a dateFormat() method to languages/en/CONSTANTS.php so that date and time formats can be in accordance with the
selected localization. CONSTANTS.php in each installed localization should be adjusted accordingly.
4. In the 'Insert citation' dialog of the WYSIWYG editors, creator, keyword and user_tag fields can now be searched on.
5. Added a check on startup that certain files and folders are writeable by the web server user.
BUG FIXES:
1. When editing a resource where the title and/or subtitle have UTF-8 characters such as real apostrophes,
the fields are no longer truncated.
2. If two resources of the same resource type and title exist, editing one of those resources produces
the warning about duplicate resources -- if accepted, a third resource is produced and so on.
3. Single quotes in search strings are now escaped.
4. Under certain configuration settings, some registered users could not add/edit attachments and urls.
5. When searching, ordering by publication year was incorrect.
6. Searching on some existing creator names produced a SQL error.
7. Errors in updating resource_creator table when merging creators.
8. When merging keywords, the keyword cache was not cleared.
9. Resources such as web_article etc. now require a URL.
10. In category tree, subcategories did not display correctly.
11. In some cases, a new localization was only loaded after the page was reloaded.
12. When logged on as admin, the Admin|Plugins menu item is now shown so that plugins, templates, localizations,
and styles can be managed and configured.
Other minor bugs mainly to do with warnings and formatting.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1.1
Focus: Minor feature enhancements and bug fixes
FEATURE ENHANCEMENTS:
1. More options added to CMS output. See docs/README_CMS.txt
BUG FIXES:
1. Bibtex Paste input is now cleared of any previous text.
2. Under some circumstances, keywords and user tags were not added to resources when editing resources.
3. Some missing messages for table and image in the tiny_mce editors.
4. SQL error in SELECT resources when choosing just the option NOT in user bibliography.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
v4.1
Focus: Major feature and interface enhancements, significant speed improvements, bug fixes and program/database re-structuring.
STRUCTURAL ENHANCEMENTS:
1. The database has been re-structured mainly to allow the provision of a table prefix in hosting situations where
the user may only have one database (see wikindx4/config.php $WIKINDX_DB_TABLEPREFIX).
2. v4 requires >= PHP5.2.9 -- and has been re-written in a more OOP-like manner to reflect this -- and requires
that javascript be enabled in the web browser. PHP5.2.9 also allows full use of AJAX/JSON techniques to improve
the user interface and this is used in several areas of WIKINDX.
3. v4 requires at least MySQL 4.1 to cater for subqueries.
4. The database now uses the UTF-8 character set and collation.
5. v3.x plug-in modules will require minor re-writes to become compatible with the new v4 structure.
6. The core code is smaller and many extraneous functions in previous versions are now available as separately downloadable
plug-in modules.
7. v4 uses Smarty templates for the display and greater control has now been given to admins over the visual display of many
elements and pages.
FEATURE ENHANCEMENTS include:
1. For registered users, the session state is now automatically saved (bookmarks, searches, basket etc.) without requiring an
explicit log-off.
2. Cited authors may now be browsed as a tag cloud.
3. Publication years may now be browsed as a tag cloud.
4. Resource types may now be browsed as a tag cloud.
5. For registered users, their user bibliographies may now be browsed as a tag cloud.
6. Multiple URLs may now be stored with each resource.
7. Bibliographic style files are now cached speeding up formatting operations.
8. New Subcategories are organized hierarchically below Categories. Each category can have zero or multiple subcategories;
each subcategory belongs to one and only one category.
9. Registered users can make use of new user tags (managed from the My Wikindx menu). These function like personal keywords
for resources.
10. Custom fields are now searcheable from within Search.
11. Resources added by registered users can now be optionally quarantined and blocked from public view until approved by an
administrator. Administrators can quarantine resources at any time.
12. When displaying lists of resources, by default any URLs that appear as part of the bibliographic format for that resource
are hyperlinked to that URL. Registered users can now set the entire resource to be hyperlinked to viewing that resource.
13. In addition to merging creators (where the merged creators will be deleted and subsumed under the target creator), admins
may now group creators. This is intended for situations where one person may be represented by different creator names but
you wish to keep those creator names accurate to the original bibliographic source. Grouped creators will not be deleted but,
in select and browse operations, a selection of any member of a group will produce a list of resources for all members of that group.
14. Registered users can now be placed in a department and institution for organizational purposes and can be specified as a
creator for email notification of resource edits where they are a creator. If a creator has been specified for users, departments
or institutions, these three can be listed in the browse menu.
15. Attachments can be embargoed (blocked from public view) until a specified date -- the embargo is automatically lifted on
or after the specified date. Until that time, only admins can view embargoed attachments.
16. BBCode is now no longer used and all form fields that previously used BBCode now use the WYSIWYG TinyMCE editor (WIKINDX v4
uses TinyMCE v3.5.5). All such form fields are now, therefore, WYSIWYG. The database upgrade process for v3.8 wikindices converts
BBCode elements to HTML elements.
17. User registration requests can now be checked using CAPTCHA technology in order to cut down spam and bot requests. Get public
and private keys for your domain from: https://www.google.com/recaptcha/admin/create and enter them in config.php.
18. If the email subsystem is enabled, WIKINDX can now use the more efficient PEAR::Mail rather than PHP's default Mail().
PEAR::Mail is not part of the standard PHP install. See config.php for configuration options.
19. A search string can now be specified using combinations of double quotes, AND, OR, and NOT.
20. In a multi-user system, admins can set statistics (resource views and attachment downloads of users' resources) to be
emailed to registered users who are creators in the database. Statistics are emailed on or after the 1st of each month and are
triggered by the first user (inc. read only) to access the wikindx on or after that date.
21. Conference poster and company brochure added as resource types.
22. Added a top-level menu 'search'.
23. Added Quick Search and the special string $QUICKSEARCH$ to place the quick search form on the front page (see Admin|Configure).
24. When viewing a list, selections from that list may be placed in the basket.
25. Added a language field to resources. Like categories and subcategories, languages must be added by the admin and can be
browsed, selected and searched.
26. BibTeX import has been improved to handle UTF-8 encoding.
27. BibTeX export has been improved to offer a choice of ',' or ';' to separate keywords and a choice of UTF-8 or Latin (ISO-8859-1)
and TeX encoding.
28. WIKINDX uses multi-level menus to make efficient use of the screen space. The number of menu levels can be set in user
preferences unless the template designer has mandated a specific number.
29. The provision of a valid ISBN/ISSN for a resource makes that number hyperlinked to the Wikipedia 'Book Sources' site when
viewing that resource.
30. Admin|Plugins allows admins to manage (e.g. enable or disable) plugins, templates, languages and bibliographic styles.
31. WIKINDX resources can now be optionally indexed by Google Scholar.
BUG FIXES include:
1. All querystring and form input is now stripped of javascript tags and other unwanted information.
OTHER ENHANCEMENTS
1. Significant improvements to SQL execution speeds especially for complex queries and wikindices with large numbers of records.
2. Interface improvements re entering/editing new resources -- all fields are now entered on one page -- and search and list pages.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
CHANGELOG v3, v2 and v1: see wikindx3/CHANGELOG in the wikindx3.8.2 download
--o READMEFIRST o--
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
///////////////////
If you are upgrading from a previous installation of WIKINDX, read docs/UPGRADE.txt.
///////////////////
NB
///////////////////
INSTALLATION OF WIKINDX 5.x
1. If you are installing a fresh WIKINDX with a blank database, read
docs/INSTALL.txt
2. If you are upgrading a previous installation of WIKINDX 4.x to 5.x,
simply overwrite the existing installation. $WIKINDX_WIKINDX_PATH has been
added to config.php.dist and should be copied to config.php and the first
running of WIKINDX will upgrade the database in a single step. If upgrading a
v4.x installation below v4.2, you should also download and reinstall all your
plugins as, from v4.2, WIKINDX introduced a plugin compatibility check.
3. If you are upgrading from a previous installation of WIKINDX below v4.x,
read docs/UPGRADE.txt
4. WIKINDX uses caching in the database _cache table for lists of creators, keywords etc.
For large WIKINDX databases, if you receive messages such as 'MySQL server has gone away',
try increasing max_allowed_packet in the MySQL server.
5. If your database is over 1500 resources and you expect to export (with the importexport plugin)
lists of resources of at least this length, then you should set
public $WIKINDX_MEMORY_LIMIT = "64M";
or higher in config.php in order to avoid memory allocation errors.
///////////////////
///////////////////
A test database (wikindx5_1_testDatabase.sql) is provided in docs/. Read
docs/README_TESTDATABASE.txt.
///////////////////
Other README files can be found in docs/
Developed under the Creative Commons CC-BY-NC-SA 2.0 license, the project homepage
can be found at: https://sourceforge.net/projects/wikindx/ and the required
files/updates and a variety of enhancements (language locailzations and
plug-ins) are freely available there.
WIKINDX Requirements (and has been tested on):
* PHP >= v5.6.x and <= 7.3.x
* MySQL >= v5.7.5 or MariaDB >= 10.2 (mysqli driver)
* Apache >= 2.x or nginx >= 1.11 (or any web Server able to run PHP scripts).
The client accesses the database via a standard (graphical) web
browser. WIKINDX makes use of the tinyMCE editor (v2.0.4) and this
limits the web browsers that can be used.
A list of compatible browsers can be found here:
http://www.tinymce.com/wiki.php/Browser_compatiblity.
Generally, though, if you use the following, you should be OK:
* Internet Explorer >= v9
* Edge >= v10
* Firefox >= v12
* Chrome >= v4
* Safari >= v10
* Opera >= v12
* WebKit-based navigators (https://en.wikipedia.org/wiki/List_of_web_browsers#WebKit-based)
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
--
Mark Grimshaw-Aagaard
The WIKINDX Team 2019
sirfragalot@users.sourceforge.net
--o README_PHPDOC o--
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
To compile the WIKINDX core/ programming manual, run phpDocumentor 3 inside wikindx/trunk/
Using the command:
phpdoc
at the command line will automatically make use of the config file wikindx/trunk/phpdoc.xml
Documentation is saved to wikindx/trunk/docs/manual/
phpdoc is often capricious depending on the PHP environment installed. For a better experience
it is recommended to use the phar version of phpDocumentor 3.
Download it from the assets section of the last release of phpdoc at:
https://github.com/phpDocumentor/phpDocumentor2/releases
Put the two files phpDocumentor.phar and phpDocumentor.phar.pubkey in the root directory of the site and run:
php phpDocumentor.phar -c phpdoc.xml
The -c option is mandatory since a bug of phpdoc 3 prevents the implicit read of the config file.
---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---:::---
--
Mark Grimshaw
The WIKINDX Team 2019
sirfragalot@users.sourceforge.net
\ No newline at end of file
Attached files go here.
This folder must be writable by 'nobody' or the general web user.
Attached files go here.
This folder must be writable by 'nobody' or the general web user.
<?php
/**
* WIKINDX : Bibliographic Management system.
* @link http://wikindx.sourceforge.net/ The WIKINDX SourceForge project
* @author The WIKINDX Team
* @copyright 2018 Mark Grimshaw <sirfragalot@users.sourceforge.net>
* @license https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode CC-BY-NC-SA 2.0
*/
/**
* CMS
*
* Content Management System hooks.
*
* @version 1
*
* @package wikindx5
* @author Mark Grimshaw <sirfragalot@users.sourceforge.net>
*
*/
include_once("core/startup/CONSTANTS.php");
function preserve_qs()
{
if (empty($_SERVER['QUERY_STRING']) && mb_strpos($_SERVER['REQUEST_URI'], '?') === FALSE) {
return '';
}
return '&' . $_SERVER['QUERY_STRING'];
}
// This code had moved to core/modules/sitemap/SITEMAP.php
// to use the current module loading scheme.
// Keep this page only to not break external links
// LkpPo, 20180802
// HTTP/1.0 301 Moved Permanently
// Check if request is to parse text for [cite]...[/cite] tags
if (array_key_exists('action', $_GET) && ($_GET['action'] == 'parseText' || $_GET['action'] == 'parseSql'))
{
header('Location: ' . WIKINDX_CMS_PAGE . str_replace('action=', 'method=', preserve_qs()), TRUE, 301);
}
else
{
header('Location: ' . WIKINDX_CMS_PAGE . str_replace('action=', 'type=', preserve_qs()) . ((!array_key_exists('method', $_GET)) ? '&method=queryDb' : ''), TRUE, 301);
}
exit();
?>
\ No newline at end of file
<?php
/**********************************************************************************
WIKINDX: Bibliographic Management system.
Copyright (C)
Creative Commons
Creative Commons Legal Code
Attribution-NonCommercial-ShareAlike 2.0
THE WORK IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE") – docs/LICENSE.txt.
THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER
THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
The WIKINDX Team 2019
sirfragalot@users.sourceforge.net
**********************************************************************************/
/**
*
* WIKINDX v5.x CONFIGURATION FILE
*
* NB. BEFORE YOU MAKE CHANGES TO THIS FILE, BACK IT UP!
* NB. BEFORE YOU MAKE CHANGES TO THIS FILE, BACK IT UP!
* NB. BEFORE YOU MAKE CHANGES TO THIS FILE, BACK IT UP!
*
* If you make changes, backup the edited file as future upgrades of WIKINDX might overwrite this file - no questions asked!
*/
/**********************************************************************************/
class CONFIG
{
/*****
* START DATABASE CONFIGURATION
*****/
// NB:
// wikindx supports only MySQL with mysqli PHP driver ($WIKINDX_DB_TYPE parameter is deprecated).
//
// The database and permissions for accessing it must be created using your RDBMS client. Wikindx
// will NOT do this for you. If unsure how to do this, contact your server admin. After you have
// set up an empty database with the correct permissions (GRANT ALL), the first running of Wikindx
// will create the necessary database tables.
//
// WIKINDX uses caching in the database _cache table for lists of creators, keywords etc. If you have a large
// database, you may get SQL errors as WIKINDX attempts to write these cache data. You will need to increase
// max allowed packet in my.cnf and restart the MySQL server.
//
// Host on which the relational db management system (i.e. the MySQL server) is running (usually localhost if
// the web files are on the same server as the RDBMS although some web hosting services may specify something like
// localhost:/tmp/mysql5.sock).
// If your DB server is on a non-standard socket (i.e. not port 3306), then you should set something like localhost:xxxx
// where 'xxxx' is the non-standard socket.
public $WIKINDX_DB_HOST = "localhost";
// name of the database which these scripts interface with:
public $WIKINDX_DB = "wikindx5";
// username and password required to connect to and open the database
// (it is strongly recommended that you change these default values):
public $WIKINDX_DB_USER = "wikindx";
public $WIKINDX_DB_PASSWORD = "wikindx";
// If using WIKINDX on a shared database, set the WIKINDX table prefix here (lowercase only)
// (do NOT change after running WIKINDX and creating the tables!):
public $WIKINDX_DB_TABLEPREFIX = 'wkx_';
// WIKINDX uses MySQL persistent connections by default.
// Some hosting services are not configured for this: if you have problems
// connecting to your MySQL server and/or receive error messages about 'too many connections',
// set $WIKINDX_DB_PERSISTENT to FALSE
public $WIKINDX_DB_PERSISTENT = TRUE;
/*****
END DATABASE CONFIGURATION
*****/
/**********************************************************************************/
/*****
START PATHS CONFIGURATION
*****/
// If a Virtual Host Directory is not defined for this installation of Wikindx,
// or you can't define it, use this variable to simulate it.
// You have to indicate protocol HTTP / HTTPS and remove the terminal /.
// e.g. if wikindx's index.php file is in /wikindx5/ under the httpd/ (or similiar)
// folder on the www.myserver.com, then set the variable
// to http://www.myserver.com/wikindx5
// Otherwise, leave as FALSE.
public $WIKINDX_BASE_URL = FALSE;
// The TinyMCE editor needs the WIKINDX server installation path.
// WIKINDX tries to get this through getcwd() but this is not always possible.
// In this case, you will receive an error message and WIKINDX will die and you should then set that path here.
// The path should be the full path from the root folder to your wikindx5 folder with no trailing '/'.
// On Apple OSX running XAMPP, for example, the case-sensitive path is:
// '/Applications/XAMPP/xamppfiles/htdocs/wikindx5'.
// The script will continue to die until it has a valid installation path.
// If you get no error message and WIKINDX runs fine, then you can leave this value as FALSE.
// For tinymce to work properly with Apache on Ubuntu you need to set the following in the /etc/apache2/apache2.conf file:
// EnableSendfile on
public $WIKINDX_WIKINDX_PATH = FALSE;
// On some web-hosting services, disk quotas are set on session storage directories.
// WIKINDX is a heavy user of sessions and the folder set for storing session data may fill up quickly causing session write errors.
// This may manifest itself as XML files only being partly written or not all data being added to the database when creating a new resource.
// Additionally, large numbers of old session files can cause significant slow-down of the system.
// See here for a report on the problem: https://sourceforge.net/projects/wikindx/forums/forum/326884/topic/4477010
// This variable sets an alternate path for storing sessions (which can be in your home directory).
// If this variable is FALSE, the default session path, as set in php.ini, will be used.
// Otherwise, the directory must exist and be writable by the web server user.
// There should be no trailing '\' or '/'.
// For example, for a windows system, WIKINDX_SESSION_PATH might be "D:\sessions"
// On a *NIX system, the path might be "sessions" for a folder at the top level of wikindx5/
public $WIKINDX_SESSION_PATH = FALSE;
// If WIKINDX_SESSION_PATH is set, this value will remove sessions in the above directory older than xx days.
// Set to 0 to never remove sessions.
// The default system value will be used if WIKINDX_SESSION_PATH is FALSE.
// Do NOT use quotes around the value.
public $WIKINDX_SESSION_PATH_CLEAR = 10;
// Alternate locations for storing attachments and exported files.
// If these are FALSE, the default locations at the top level of wikindx5/ will be used.
// It is the administrator's responsibility to ensure that these directories are web-server user readable and writeable.
// There should be no trailing '\' or '/'.
// For example, for a windows system, WIKINDX_ATTACHMENTS_DIR might be "D:\attachments"
// For example, for a *NIX system, WIKINDX_FILE_PATH might be "files"
public $WIKINDX_ATTACHMENTS_PATH = FALSE;
public $WIKINDX_FILE_PATH = FALSE;
/*****
END PATH CONFIGURATION
*****/
/**********************************************************************************/
/*****
START PHP MEMORY AND EXECUTION CONFIGURATION
*****/
// WIKINDX usually runs with the standard PHP memory_limit of 32MB.
// With some PHP configurations, however, this is not enough -- a mysterious blank page is often the result.
// If you are unable to update php.ini's memory_limit yourself, WIKINDX_MEMORY_LIMIT may be set (an integer such as 64 or 128 followed by 'M').
// Despite the PHP manual stating that this may not be set outside of php.ini, it seems to work most of the time.
// It is not, however, guaranteed to do so and editing php.ini is the preferred method particularly if your PHP is in 'safe' mode.
// Use double quotes around the value.
public $WIKINDX_MEMORY_LIMIT = "32M";
// WIKINDX should run fine with the PHP standard execution timeouts (typically 30 seconds) but,
// in some cases such as database upgrading of a large database on a slow server, you will need to increase the timeout figure.
// If this is FALSE, the value set in php.ini is used.
// Despite the PHP manual stating that this may not be set outside of php.ini, it seems to work most of the time.
// It is not, however, guaranteed to do so and editing php.ini is the preferred method particularly if your PHP is in 'safe' mode.
// The value is in seconds.
// Do NOT use quotes around the value.
public $WIKINDX_MAX_EXECUTION_TIMEOUT = FALSE;
// WIKINDX_MAX_WRITECHUNK concerns how many resources are exported and written to file in one go.
// If your WIKINDX contains several thousands of resources and you wish to export them all (e.g. to bibTeX or Endnote),
// then you may run into memory problems which will manifest as either
// a blank page when you attempt to export or an error report (if you have error reporting turned on).
// WIKINDX_MAX_WRITECHUNK breaks down the SQL querying of resources and subsequent writing of resources to file into manageable chunks.
// As a rough guide, with a WIKINDX_MEMORY_LIMIT of 32M, WIKINDX_MAX_WRITECHUNK of 700 should work fine and with 64M, 1500 works fine.
// If WIKINDX_MAX_WRITECHUNK is FALSE, the chunk is set to 10,000.
// This can be a tricky figure to set as setting the figure too low increases SQL and PHP execution times significantly.
// Do NOT use quotes around the value.
public $WIKINDX_MAX_WRITECHUNK = FALSE;
/*****
END PHP MEMORY AND EXECUTION CONFIGURATION
*****/
}
?>
\ No newline at end of file
<?php
/**
* WIKINDX : Bibliographic Management system.
* @link http://wikindx.sourceforge.net/ The WIKINDX SourceForge project
* @author The WIKINDX Team
* @copyright 2017 Mark Grimshaw <sirfragalot@users.sourceforge.net>
* @license https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode CC-BY-NC-SA 2.0
*/
/**
* Interface for AJAX elements in various pages.
*
*
* @version 2
* @author Mark Grimshaw
* @package wikindx5\core\ajax
*/
namespace AJAX
{
/**
* AJAX
*/
/**
* Load the ajax javascript and the user javascript(s) into the HTML page output.
*
* @param mixed $scripts Either an array of .js scripts to load or a single string. It can be FALSE.
*/
function loadJavascript($scripts = FALSE)
{
$pString = '';
if(!is_array($scripts)) $scripts = array($scripts);
foreach($scripts AS $script)
{
$pString .= \HTML\jsInlineExternal($script);
}
\GLOBALS::addTplVar('content', $pString);
}
/**
* Create and load the HTML form element insert for the AJAX action and function.
*
* @param string $action The javascript action such as 'onclick' etc.
* @param array $jsonArray The parameter to be passed to gateway() as an array ready to be converted to JSON
* @param boolean $return If TRUE, generated javascript has a return from the gateway() function. Default is FALSE.
*/
function jActionForm($action, $jsonArray, $return = FALSE)
{
$json = \AJAX\encode_jArray($jsonArray, TRUE);
if($return) $return = 'return';
return "$action=\"$return gateway('$json');\"";
}
/**
* Create and load the IMG element insert for the AJAX action and function. Works with core/display/LOADICONS.php.
*
* @param string $icon The icon to make an image of ('add', 'delete', 'view' etc.)
* @param string $action The javascript action such as 'onclick' etc.
* @param array $jsonArray The parameter to be passed to gateway() as an array ready to be converted to JSON
* @param boolean $return If TRUE, generated javascript has a return from the gateway() function. Default is FALSE.
* @return string The image tag
*/
function jActionIcon($icon, $action, $jsonArray, $return = FALSE)
{
if($return) $return = 'return';
$icons = \FACTORY_LOADICONS::getInstance();
$json = \AJAX\encode_jArray($jsonArray, TRUE);
$icons->jscriptActions[$icon] = "$action=\"$return gateway('$json')\"";
$icons->resetSetup();
$icons->setupIcons($icon);
return \HTML\span($icons->{$icon}, 'cursorPointer');
}
/**
* Convert $jsonArray to JSON string and format any array elements referencing javascript functions.
*
* @param array $jsonArray The unformatted JSON array
* @param boolean $quote No encoding of quotation marks (") if set to FALSE. Default is FALSE.
* @return string The JSON string
*/
function encode_jArray($jsonArray, $quote = FALSE)
{
if($quote)
{
array_walk_recursive($jsonArray, function (&$value) { $value = addslashes($value); });
$json = json_encode($jsonArray);
\AJAX\_json_error('encode');
$json = htmlspecialchars($json, ENT_QUOTES);
}
else
{
$json = json_encode($jsonArray);
\AJAX\_json_error('encode');
}
return $json;
}
/**
* Convert JSON-formatted $jsonString to an array or object.
*
* @param string $jsonString The JSON string
* @return mixed Array or object
*/
function decode_jString($jsonString)
{
// Always return an associative array
$return = json_decode(stripslashes($jsonString), TRUE);
\AJAX\_json_error('decode');
return $return;
}
/**
* echo JSON error or return if none.
*
* @param string $type
*/
function _json_error($type)
{
if (json_last_error() != JSON_ERROR_NONE)
{
\GLOBALS::addTplVar('content', 'JSON ' . $type . ' error - ' . json_last_error_msg() . ': ');
}
}
}
?>
\ No newline at end of file
/**********************************************************************************
WIKINDX: Bibliographic Management system.
Copyright (C)
Creative Commons
Creative Commons Legal Code
Attribution-NonCommercial-ShareAlike 2.0
THE WORK IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE”) — docs/LICENSE.txt.
THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER
THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
The WIKINDX Team 2016
sirfragalot@users.sourceforge.net
**********************************************************************************/
/**
* ajax.js
*
* This file provides all the AJAX javascript functionality.
* gateway() is the function to be called from the web page action and is set in core/ajax/AJAX.php.
*
* version 1.1 -- moved some common functions to core/coreJavascript.js
*
* @version 1.1
* @date August 2013
* @author Mark Grimshaw
*/
var A_OBJ = new Array(); // array of AJAX objects
var noTarget = false;
var visible = false;
/********************************************* FUNCTIONS *****************************************/
/**
* Gateway to AJAX javascript functions
* @param input - JSON string representing an array of sets of instructions to be processed in numerical order. At the very
* least a startFunction() method should be present in each set.
*/
function gateway(input)
{
var vars = '';
var parsedInput = JSON.parse(input);
var inputLen = parsedInput.length;
if(gateway.aobj_index == undefined)
gateway.aobj_index = -1;
gateway.aobj_index++;
for(var i = 0; i < inputLen; i++)
{
if(parsedInput[i].startFunction != undefined)
{
if(parsedInput[i].startFunctionVars != undefined)
vars = parsedInput[i].startFunctionVars;
A_OBJ[gateway.aobj_index] = new AJAXOBJECT();
A_OBJ[gateway.aobj_index].input = parsedInput[i];
A_OBJ[gateway.aobj_index].evalReturn = eval('(' + A_OBJ[gateway.aobj_index].input.startFunction + '(' + vars + '))');
if(A_OBJ[gateway.aobj_index].evalReturn == false)
{
return false;
}
}
else
{
alert('No startFunction() defined');
return false;
}
gateway.aobj_index++;
}
return true;
}
/**
* The object used for independent AJAX instances
*/
function AJAXOBJECT()
{
//properties
this.input = null;
this.processedScript = null;
this.phpResponse = null;
this.targetObj = null;
this.evalReturn = null;
// methods
this.checkInput = checkInput;
this.doXmlHttp = doXmlHttp;
}
/**
* Check required input parameters are present in input
* @param input array
* @return false|true
*/
function checkInput(inputArray)
{
var len = inputArray.length;
for(var i = 0; i < len; i++)
{
if(this.input[inputArray[i]] == undefined)
{
alert('required input parameter is missing: ' + inputArray[i]);
return false;
}
}
return true;
}
/**
* Create the xmlHttp object
* @return xmlHttp object
*/
function createXmlHttpObject()
{
var xmlHttp = false;
//Check if we are using IE.
try
{
//If the javascript version is greater than 5.
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
//If not, then use the older active x object.
try
{
//If we are using IE.
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E)
{
//Else we must be using a non-IE browser.
xmlHttp = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlHttp && typeof XMLHttpRequest != undefined)
{
xmlHttp = new XMLHttpRequest();
}
return xmlHttp;
}
/**
* Execute the xmlHTTP object
*
* @return true|false
*/
function doXmlHttp()
{
if(this.targetObj == null)
{
alert('No AJAXOBJECT targetObj property set');
return false;
}
if(this.processedScript == null)
{
alert('No AJAXOBJECT processedScript property set');
return false;
}
var targetObj = this.targetObj;
var xmlHttp = createXmlHttpObject();
xmlHttp.open("GET", this.processedScript, true);
//alert(this.processedScript);
xmlHttp.onreadystatechange = function()
{
if((xmlHttp.readyState == 4) && (xmlHttp.status == 200))
{
try
{
this.phpResponse = JSON.parse(xmlHttp.responseText);
}
catch(err)
{
alert('HTTP status: ' + xmlHttp.status + '. ' + err.message + ' ERROR. PHP says:\n' + xmlHttp.responseText);
return false;
}
if(this.phpResponse.ERROR)
{
alert('PHP ERROR:\n' + this.phpResponse.ERROR);
return false;
}
if(this.phpResponse.innerHTML)
targetObj.innerHTML = this.phpResponse.innerHTML;
//alert(this.phpResponse.next);
// Further action to be taken?
if(this.phpResponse.next != undefined)
gateway(JSON.stringify([this.phpResponse]));
}
}
xmlHttp.send(null);
A_OBJ[gateway.aobj_index].xmlHttp = xmlHttp;
return true;
}
/**
* Do something AJAXy in the 'targetDiv' based upon input from a multiple select box form element
*
* @return boolean
*/
function triggerFromMultiSelect()
{
// Check we have the required input
if(!A_OBJ[gateway.aobj_index].checkInput(['triggerField', 'targetDiv', 'script']))
return false;
// Set the AJAX object's targetObj property
A_OBJ[gateway.aobj_index].targetObj = coreGetElementById(A_OBJ[gateway.aobj_index].input.targetDiv);
// Gather the selected OPTIONS of the triggerField select box
var triggerObj = coreGetElementById(A_OBJ[gateway.aobj_index].input.triggerField);
var len = triggerObj.options.length;
var ajaxReturn = '';
var triggerOptionValues = new Array();
for(var i = 0; i < len; i++)
{
if(triggerObj.options[i].selected && (triggerObj.options[i].value != 0)) // don't include 'IGNORE'
triggerOptionValues.push(triggerObj.options[i].value);
}
if(triggerOptionValues.length)
ajaxReturn = '&ajaxReturn=' + triggerOptionValues.join();
// Gather the current selected OPTIONS of the targetDiv select box
if(A_OBJ[gateway.aobj_index].input.restoreField != undefined)
{
var restoreObj = coreGetElementById(A_OBJ[gateway.aobj_index].input.restoreField);
if(restoreObj)
{
len = restoreObj.options.length;
var restoreOptionValues = new Array();
for(var i = 0; i < len; i++)
{
if(restoreObj.options[i].selected && (restoreObj.options[i].value != 0)) // don't include 'IGNORE'
restoreOptionValues.push(restoreObj.options[i].value);
}
//alert(A_OBJ[gateway.aobj_index].input.targetDiv+ ' ' + restoreOptionValues.length);
if(restoreOptionValues.length)
ajaxReturn = ajaxReturn + '&ajaxReturn2=' + restoreOptionValues.join();
}
}
//alert(A_OBJ[gateway.aobj_index].input.targetDiv + ': ' + ajaxReturn);
A_OBJ[gateway.aobj_index].processedScript = A_OBJ[gateway.aobj_index].input.script + ajaxReturn;
// Execute the AJAX
if(!A_OBJ[gateway.aobj_index].doXmlHttp())
return false;
return true;
}
/**
* Do something AJAXy in the 'targetDiv' based upon input from a single select box form element
*
* @return boolean
*/
function triggerFromSelect()
{
// Check we have the required input
if(!A_OBJ[gateway.aobj_index].checkInput(['triggerField', 'targetDiv', 'script']))
return false;
// Set the AJAX object's targetObj property
A_OBJ[gateway.aobj_index].targetObj = coreGetElementById(A_OBJ[gateway.aobj_index].input.targetDiv);
// Gather the selected OPTIONS of the triggerField select box
var triggerObj = coreGetElementById(A_OBJ[gateway.aobj_index].input.triggerField);
var ajaxReturn = '';
ajaxReturn = '&ajaxReturn=' + triggerObj.value;
//alert(A_OBJ[gateway.aobj_index].input.targetDiv + ': ' + ajaxReturn);
A_OBJ[gateway.aobj_index].processedScript = A_OBJ[gateway.aobj_index].input.script + ajaxReturn;
// Execute the AJAX
if(!A_OBJ[gateway.aobj_index].doXmlHttp())
return false;
return true;
}
/**
* Do something AJAXy in the 'targetDiv' based upon input from a single checkbox form element
*/
function triggerFromCheckbox()
{
// Check we have the required input
if(!A_OBJ[gateway.aobj_index].checkInput(['triggerField', 'targetDiv', 'script']))
return false;
// Set the AJAX object's targetObj property
A_OBJ[gateway.aobj_index].targetObj = coreGetElementById(A_OBJ[gateway.aobj_index].input.targetDiv);
// Gather the selected OPTIONS of the triggerField select box
var triggerObj = coreGetElementById(A_OBJ[gateway.aobj_index].input.triggerField);
var ajaxReturn = '';
if(!visible)
{
A_OBJ[gateway.aobj_index].targetObj.style.display = 'block';
visible = true;
}
else
{
A_OBJ[gateway.aobj_index].targetObj.style.display = 'none';
visible = false;
}
//alert(A_OBJ[gateway.aobj_index].input.targetDiv + ': ' + ajaxReturn);
A_OBJ[gateway.aobj_index].processedScript = A_OBJ[gateway.aobj_index].input.script + ajaxReturn;
// Execute the AJAX
if(!A_OBJ[gateway.aobj_index].doXmlHttp())
return false;
return true;
}
\ No newline at end of file
// json2.js
// 2017-06-12
// Public Domain.
// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
// NOT CONTROL.
// This file creates a global JSON object containing two methods: stringify
// and parse. This file provides the ES5 JSON capability to ES3 systems.
// If a project might run on IE8 or earlier, then this file should be included.
// This file does nothing on ES5 systems.
// JSON.stringify(value, replacer, space)
// value any JavaScript value, usually an object or array.
// replacer an optional parameter that determines how object
// values are stringified for objects. It can be a
// function or an array of strings.
// space an optional parameter that specifies the indentation
// of nested structures. If it is omitted, the text will
// be packed without extra whitespace. If it is a number,
// it will specify the number of spaces to indent at each
// level. If it is a string (such as "\t" or "&nbsp;"),
// it contains the characters used to indent at each level.
// This method produces a JSON text from a JavaScript value.
// When an object value is found, if the object contains a toJSON
// method, its toJSON method will be called and the result will be
// stringified. A toJSON method does not serialize: it returns the
// value represented by the name/value pair that should be serialized,
// or undefined if nothing should be serialized. The toJSON method
// will be passed the key associated with the value, and this will be
// bound to the value.
// For example, this would serialize Dates as ISO strings.
// Date.prototype.toJSON = function (key) {
// function f(n) {
// // Format integers to have at least two digits.
// return (n < 10)
// ? "0" + n
// : n;
// }
// return this.getUTCFullYear() + "-" +
// f(this.getUTCMonth() + 1) + "-" +
// f(this.getUTCDate()) + "T" +
// f(this.getUTCHours()) + ":" +
// f(this.getUTCMinutes()) + ":" +
// f(this.getUTCSeconds()) + "Z";
// };
// You can provide an optional replacer method. It will be passed the
// key and value of each member, with this bound to the containing
// object. The value that is returned from your method will be
// serialized. If your method returns undefined, then the member will
// be excluded from the serialization.
// If the replacer parameter is an array of strings, then it will be
// used to select the members to be serialized. It filters the results
// such that only members with keys listed in the replacer array are
// stringified.
// Values that do not have JSON representations, such as undefined or
// functions, will not be serialized. Such values in objects will be
// dropped; in arrays they will be replaced with null. You can use
// a replacer function to replace those with JSON values.
// JSON.stringify(undefined) returns undefined.
// The optional space parameter produces a stringification of the
// value that is filled with line breaks and indentation to make it
// easier to read.
// If the space parameter is a non-empty string, then that string will
// be used for indentation. If the space parameter is a number, then
// the indentation will be that many spaces.
// Example:
// text = JSON.stringify(["e", {pluribus: "unum"}]);
// // text is '["e",{"pluribus":"unum"}]'
// text = JSON.stringify(["e", {pluribus: "unum"}], null, "\t");
// // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
// text = JSON.stringify([new Date()], function (key, value) {
// return this[key] instanceof Date
// ? "Date(" + this[key] + ")"
// : value;
// });
// // text is '["Date(---current time---)"]'
// JSON.parse(text, reviver)
// This method parses a JSON text to produce an object or array.
// It can throw a SyntaxError exception.
// The optional reviver parameter is a function that can filter and
// transform the results. It receives each of the keys and values,
// and its return value is used instead of the original value.
// If it returns what it received, then the structure is not modified.
// If it returns undefined then the member is deleted.
// Example:
// // Parse the text. Values that look like ISO date strings will
// // be converted to Date objects.
// myData = JSON.parse(text, function (key, value) {
// var a;
// if (typeof value === "string") {
// a =
// /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
// if (a) {
// return new Date(Date.UTC(
// +a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6]
// ));
// }
// return value;
// }
// });
// myData = JSON.parse(
// "[\"Date(09/09/2001)\"]",
// function (key, value) {
// var d;
// if (
// typeof value === "string"
// && value.slice(0, 5) === "Date("
// && value.slice(-1) === ")"
// ) {
// d = new Date(value.slice(5, -1));
// if (d) {
// return d;
// }
// }
// return value;
// }
// );
// This is a reference implementation. You are free to copy, modify, or
// redistribute.
/*jslint
eval, for, this
*/
/*property
JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (typeof JSON !== "object") {
JSON = {};
}
(function () {
"use strict";
var rx_one = /^[\],:{}\s]*$/;
var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
function f(n) {
// Format integers to have at least two digits.
return (n < 10)
? "0" + n
: n;
}
function this_value() {
return this.valueOf();
}
if (typeof Date.prototype.toJSON !== "function") {
Date.prototype.toJSON = function () {
return isFinite(this.valueOf())
? (
this.getUTCFullYear()
+ "-"
+ f(this.getUTCMonth() + 1)
+ "-"
+ f(this.getUTCDate())
+ "T"
+ f(this.getUTCHours())
+ ":"
+ f(this.getUTCMinutes())
+ ":"
+ f(this.getUTCSeconds())
+ "Z"
)
: null;
};
Boolean.prototype.toJSON = this_value;
Number.prototype.toJSON = this_value;
String.prototype.toJSON = this_value;
}
var gap;
var indent;
var meta;
var rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
rx_escapable.lastIndex = 0;
return rx_escapable.test(string)
? "\"" + string.replace(rx_escapable, function (a) {
var c = meta[a];
return typeof c === "string"
? c
: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
}) + "\""
: "\"" + string + "\"";
}
function str(key, holder) {
// Produce a string from holder[key].
var i; // The loop counter.
var k; // The member key.
var v; // The member value.
var length;
var mind = gap;
var partial;
var value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (
value
&& typeof value === "object"
&& typeof value.toJSON === "function"
) {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === "function") {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case "string":
return quote(value);
case "number":
// JSON numbers must be finite. Encode non-finite numbers as null.
return (isFinite(value))
? String(value)
: "null";
case "boolean":
case "null":
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce "null". The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is "object", we might be dealing with an object or an array or
// null.
case "object":
// Due to a specification blunder in ECMAScript, typeof null is "object",
// so watch out for that case.
if (!value) {
return "null";
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === "[object Array]") {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || "null";
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0
? "[]"
: gap
? (
"[\n"
+ gap
+ partial.join(",\n" + gap)
+ "\n"
+ mind
+ "]"
)
: "[" + partial.join(",") + "]";
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === "object") {
length = rep.length;
for (i = 0; i < length; i += 1) {
if (typeof rep[i] === "string") {
k = rep[i];
v = str(k, value);
if (v) {
partial.push(quote(k) + (
(gap)
? ": "
: ":"
) + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (
(gap)
? ": "
: ":"
) + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0
? "{}"
: gap
? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}"
: "{" + partial.join(",") + "}";
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== "function") {
meta = { // table of character substitutions
"\b": "\\b",
"\t": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
"\"": "\\\"",
"\\": "\\\\"
};
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = "";
indent = "";
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === "number") {
for (i = 0; i < space; i += 1) {
indent += " ";
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === "string") {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== "function" && (
typeof replacer !== "object"
|| typeof replacer.length !== "number"
)) {
throw new Error("JSON.stringify");
}
// Make a fake root object containing our value under the key of "".
// Return the result of stringifying the value.
return str("", {"": value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== "function") {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k;
var v;
var value = holder[key];
if (value && typeof value === "object") {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
rx_dangerous.lastIndex = 0;
if (rx_dangerous.test(text)) {
text = text.replace(rx_dangerous, function (a) {
return (
"\\u"
+ ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with "()" and "new"
// because they can cause invocation, and "=" because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with "@" (a non-JSON character). Second, we
// replace all simple value tokens with "]" characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or "]" or
// "," or ":" or "{" or "}". If that is so, then the text is safe for eval.
if (
rx_one.test(
text
.replace(rx_two, "@")
.replace(rx_three, "]")
.replace(rx_four, "")
)
) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The "{" operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval("(" + text + ")");
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return (typeof reviver === "function")
? walk({"": j}, "")
: j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError("JSON.parse");
};
}
}());
This diff is collapsed.
<?php
/**
* WIKINDX : Bibliographic Management system.
* @link http://wikindx.sourceforge.net/ The WIKINDX SourceForge project
* @author The WIKINDX Team
* @copyright 2017-2019 Mark Grimshaw <sirfragalot@users.sourceforge.net>
* @license https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode CC-BY-NC-SA 2.0
*/
/**
* BIBLIOGRAPHY STYLE class
*
* Select a bibliographic style and perform some preprocessing
*
* @package wikindx5\core\bibcitation
* @author Mark Grimshaw <sirfragalot@users.sourceforge.net>
*/
class BIBSTYLE
{
/** object */
private $db;
/** object */
/** object */
private $url;
/** array */
public $creators = array();
/** object */
public $parsexml;
/** array */
public $coinsCreators = array();
/** string */
public $output = 'html';
/** string */
public $shortOutput;
/** boolean */
public $export = FALSE;
/** boolean */
public $setupStyle = FALSE;
/** object */
public $bibformat;
/** array */
public $resourceCreators;
/** boolean */
public $linkUrl = TRUE;
/** array */
private $row = NULL;
/**
* BIBSTYLE
*
* @param string $output 'html', plain', 'rtf'. Default is 'html'
*/
public function __construct($output = 'html')
{
$this->output = $output;
$this->db = FACTORY_DB::getInstance();
$this->parsexml = FACTORY_PARSEXML::getInstance();
$this->bibformat = FACTORY_BIBFORMAT::getInstance($this->output);
$this->init();
}
/**
* Initialize the bib system
*/
private function init()
{
if($this->output == 'html')
$this->bibformat->output = $this->output;
// WIKINDX-specific
$this->bibformat->wikindx = TRUE;
$this->bibformat->initialise();
/**
* CSS class for highlighting search terms
*/
$this->bibformat->patternHighlight = "highlight";
if(empty($this->parsexml->info)) // not yet loaded
$this->parsexml->loadStyle($this->output, $this->export, "styles/bibliography/");
$this->bibformat->getStyle($this->parsexml->common, $this->parsexml->types, $this->parsexml->footnote);
}
/**
* Accept a SQL result row of raw bibliographic data and process it.
*
* We build up the $bibformat->item array with formatted parts from the raw $row.
* @param array $row
* @param boolean $shortOutput If TRUE, output just a short citation. Default is FALSE.
* @param boolean $singleResource If TRUE, we format just a single resource as in RESOURCEVIEW and so gather creator details here.
* Otherwise, gathering creator details is done in LISTCOMMON::formatResources(). Default is TRUE.
*/
public function process($row, $shortOutput = FALSE, $singleResource = TRUE)
{
$row = array_map(array($this, "removeSlashes"), $row);
$this->row = $row;
$this->shortOutput = $shortOutput;
$type = $row['resourceType']; // WIKINDX type
unset($row);
// For WIKINDX, if type == book, book_chapter or book article and there exists both 'year1'
// and 'year2' in $row (entered as publication year and reprint year respectively), then
// switch these around as 'year1' is entered in the style template as 'originalPublicationYear'
// and 'year2' should be 'publicationYear'.
if(($type == 'book') || ($type == 'book_chapter') || ($type == 'book_article'))
{
$year2 = $this->row['resourceyearYear2'];
if($year2)
{
if(!$this->row['resourceyearYear1'])
unset($this->row['resourceyearYear2']);
else
$this->row['resourceyearYear2'] = $this->row['resourceyearYear1'];
$this->row['resourceyearYear1'] = $year2;
}
unset($year2);
}
if($singleResource)
{
// Grab all creator IDs for this resource and normalize to OsBib's expected array keys for creators
$creators = array();
$this->db->formatConditions(array('resourcecreatorResourceId' => $this->row['resourceId']));
$this->db->ascDesc = $this->db->asc;
$this->db->orderBy('resourcecreatorRole', TRUE, FALSE);
$this->db->orderBy('resourcecreatorOrder', TRUE, FALSE);
$resultSet = $this->db->select('resource_creator', array('resourcecreatorCreatorId', 'resourcecreatorRole'));
while($cRow = $this->db->fetchRow($resultSet))
$creators[$cRow['resourcecreatorRole']][] = $cRow['resourcecreatorCreatorId'];
// Make creators public for use in e.g. RESOURCEVIEW()
$this->resourceCreators = $creators;
if(empty($creators))
{
for($index = 1; $index <=5; $index++)
$this->row["creator$index"] = ''; // need empty fields for BIBSTYLE
}
else
{
for($index = 1; $index <=5; $index++)
{
if(array_key_exists($index, $creators))
$this->row["creator$index"] = join(',', $creators[$index]);
else
$this->row["creator$index"] = '';
}
}
}
if($this->parsexml->citation['citationStyle'] && ($this->parsexml->citation['endnoteStyle'] == 2)) // footnotes
$this->bibformat->citationFootnote = TRUE;
$this->row = $this->bibformat->preProcess($type, $this->row);
// Return $type is the OSBib resource type ($this->book, $this->web_article etc.) as used in STYLEMAP
$type = $this->bibformat->type;
$this->preProcess($type, $singleResource);
// WIKINDX specific
if($this->shortOutput)
{
$pString = '';
if($this->row['creator1'])
$pString .= $this->bibformat->item[$this->bibformat->styleMap->{$type}['creator1']] . " ";
if($this->row['resourceyearYear1'])
$pString .= $this->row['resourceyearYear1'] . " ";
if($type == 'book_chapter')
$pString .= 'Ch. ' . $this->row['resourceTitle'] . ' ';
else
$pString .= $this->row['resourceTitle'];
if($this->row['resourceSubtitle'])
$pString .= ": " . $this->row['resourceSubtitle'];
if($type == 'book_chapter')
$pString .= 'In ' . $this->row['collectionTitle'];
$pString .= " [$type]";
return preg_replace("/{(.*)}/Uu", "$1", $pString);
}
// We now have an array for this item where the keys match the key names of $this->styleMap->$type
// where $type is book, journal_article, thesis etc. and are now ready to map this against the defined
// bibliographic style for each resource ($this->book, $this->book_article etc.).
// This bibliographic style array not only provides the formatting and punctuation for each field but also
// provides the order. If a field name does not exist in this style array, we print nothing.
$pString = $this->bibformat->map();
// bibTeX ordinals such as 5$^{th}$
$pString = preg_replace_callback("/(\d+)\\$\^\{(.*)\}\\$/u", array($this, "ordinals"), $pString);
// remove extraneous {...}
return preg_replace("/{(.*)}/Uu", "$1", $pString);
}
/**
* Perform some pre-processing
*
* @param string $type
* @param boolean $singleResource If TRUE, we format just a single resource as in RESOURCEVIEW and so gather creator details here.
*/
private function preProcess($type, $singleResource)
{
$localBibType = $this->bibformat->styleMap->$type;
// Various types of creator
for($index = 1; $index <= 5; $index++)
{
if($this->shortOutput && ($index > 1))
break;
if(!$this->row['creator' . $index])
continue;
if(!array_key_exists('creator' . $index, $localBibType))
continue;
else
$this->grabNames('creator' . $index, $singleResource);
}
// The title of the resource
$this->createTitle();
if(!$this->shortOutput)
{
// custom fields
if(array_key_exists($type, $this->bibformat->customTypes))
{
$custom = array();
foreach($localBibType as $key => $value)
{
$split = UTF8::mb_explode('_', $key);
if((sizeof($split) == 2) && ($split[0] == 'custom'))
$custom[] = $value;
}
if(!empty($custom))
$this->createCustom($custom);
}
// edition
if($editionKey = array_search('edition', $localBibType))
$this->createEdition($editionKey);
// pageStart and pageEnd
$this->pages = FALSE; // indicates not yet created pages for articles
if(array_key_exists('pages', $localBibType))
$this->createPages();
// Date
if(array_key_exists('date', $localBibType))
$this->createDate();
// runningTime for film/broadcast
if(array_key_exists('runningTime', $localBibType))
$this->createRunningTime();
// web_article URL
if(array_key_exists('URL', $localBibType))
if ($itemElement = $this->createUrl())
$this->bibformat->addItem($itemElement, 'URL');
// DOI
if(array_key_exists('DOI', $localBibType))
if ($itemElement = $this->createDoi())
$this->bibformat->addItem($itemElement, 'DOI');
// proceedings_article and proceedings can have publisher as well as organiser/location. Publisher is in 'miscField1'
if(($type == 'proceedings_article') || ($type == 'proceedings'))
{
if ($this->row['resourcemiscField1'])
{
$this->db->formatConditions(array('publisherId' => $this->row['resourcemiscField1']));
$recordset = $this->db->select('publisher', array("publisherName", "publisherLocation"));
$pubRow = $this->db->fetchRow($recordset);
if($pubRow['publisherName'])
$this->bibformat->addItem($pubRow['publisherName'], 'publisher');
if($pubRow['publisherLocation'])
$this->bibformat->addItem($pubRow['publisherLocation'], 'location');
}
}
// book and book_article can have a translated work's original publisher's details in `miscField1`
else if(($type == 'book') || ($type == 'book_article'))
{
if ($this->row['resourcemiscField1'])
{
$this->db->formatConditions(array('publisherId' => $this->row['resourcemiscField1']));
$recordset = $this->db->select('publisher', array("publisherName", "publisherLocation"));
$pubRow = $this->db->fetchRow($recordset);
if($pubRow['publisherName'])
$this->bibformat->addItem($pubRow['publisherName'], 'transPublisherName');
if($pubRow['publisherLocation'])
$this->bibformat->addItem($pubRow['publisherLocation'], 'transPublisherLocation');
}
}
// For WIKINDX, resources of type thesis, have the thesis type stored as integers in $row['field1'] and the label stored in $row['field2']
else if($type == 'thesis')
{
$field1 = array(
0 => "UNKNOWN",
1 => "master's",
2 => "doctoral",
3 => "PhD",
4 => "diploma",
5 => "EdD");
$field2 = array(
1 => "thesis",
2 => "dissertation");
}
// publisher field no longer needed....
unset($this->row['resourcemiscPublisher']);
// the rest... All other database resource fields that do not require special formatting/conversion.
$this->bibformat->addAllOtherItems($this->row);
}
// Add the publication year for short output.
else if(array_key_exists('year1', $localBibType) && $this->row['year1'])
$this->bibformat->addItem($this->row['year1'], 'year1');
}
/**
* callback for ordinals
*
* @param array $matches
*/
private function ordinals($matches)
{
if($this->output == 'html')
return $matches[1] . "<sup>" . $matches[2] . "</sup>";
else if($this->output == 'rtf')
return $matches[1] . "{{\up5 " . $matches[2] . "}}";
else
return $matches[1] . $matches[2];
}
/**
* Create the resource title
*/
private function createTitle()
{
$pString = $this->row['resourceNoSort'] . ' ' . $this->row['resourceTitle'];
// If title ends in a sentence-end marker, don't add titleSubtitleSeparator
if ($this->row['resourceSubtitle'])
{
if (preg_match("/[?!¡¿.]$/u", $this->row['resourceTitle']))
{
/* Why should there be no linebreak and two spaces between title and subtitle?
if($this->output == 'html')
$pString .= "&nbsp;&nbsp;";
else
*/
$pString .= ' ';
}
else
$pString .= $this->bibformat->style['titleSubtitleSeparator'];
}
// anything enclosed in {...} is to be left as is
$this->bibformat->formatTitle($pString, "{", "}"); // title
if($this->row['resourceSubtitle'])
$this->bibformat->formatTitle($this->row['resourceSubtitle'], "{", "}"); // subTitle
// Title of the original work from which a translation has been made.
$pString = $this->row['resourceTransNoSort'] . ' ' . $this->row['resourceTransTitle'];
if ($this->row['resourceTransSubtitle'])
{
if(preg_match("/[?!¡¿.]$/u", $this->row['resourceTransTitle']))
{
/* Why should there be no linebreak and two spaces between title and subtitle?
if($this->output == 'html')
$pString .= "&nbsp;&nbsp;";
else
*/
$pString .= ' ';
}
else
$pString .= $this->bibformat->style['titleSubtitleSeparator'];
}
// anything enclosed in {...} is to be left as is
$this->bibformat->formatTransTitle($pString, "{", "}");
if($this->row['resourceTransSubtitle'])
$this->bibformat->formatTransTitle($this->row['resourceTransSubtitle'], "{", "}");
if($this->row['resourceShortTitle'])
$this->bibformat->formatShortTitle($this->row['resourceShortTitle'], "{", "}");
}
/**
* Grab any custom fields for this resource
*
* @param array $array (resourcecustomCustomId)
*/
private function createCustom($array)
{
$this->db->formatConditionsOneField($array, 'resourcecustomCustomId');
$this->db->formatConditions(array('resourcecustomResourceId' => $this->row['resourceId']));
$resource = $this->db->select('resource_custom', array('resourcecustomShort', 'resourcecustomLong', 'resourcecustomCustomId'));
while($row = $this->db->fetchRow($resource))
{
if($row['resourcecustomShort'])
$this->bibformat->item['custom_' . $row['resourcecustomCustomId']] = $row['resourcecustomShort'];
else if($row['resourcecustomLong'])
$this->bibformat->item['custom_' . $row['resourcecustomCustomId']] = $row['resourcecustomLong'];
}
}
/**
* Create the URL
*/
private function createUrl()
{
if(!$this->row['resourcetextUrls'])
return FALSE;
$this->url = FACTORY_URL::getInstance();
$urls = $this->url->getUrls($this->row['resourcetextUrls']);
if(empty($urls))
return FALSE;
// In $urls array, [0] index is primary URL
$url = ($this->output == 'html') ? htmlspecialchars($urls[0]) : $urls[0];
unset($this->row['resourcetextUrls']);
if($this->output == 'html')
{
$label = $this->url->reduceUrl($url, 50);
if($this->linkUrl)
return \HTML\a('rLink', $label, $url, "_blank");
else
return $label;
}
else
return $url;
}
/**
* Create the DOI
*/
private function createDoi()
{
if(!$this->row['resourceDoi'])
return FALSE;
$this->url = FACTORY_URL::getInstance();
// In $urls array, [0] index is primary URL
$doi = ($this->output == 'html') ? htmlspecialchars($this->row['resourceDoi']) : $this->row['resourceDoi'];
unset($this->row['resourceDoi']);
$doi = 'https://dx.doi.org/' . $doi;
if($this->output == 'html')
{
$label = $this->url->reduceUrl($doi, 50);
if($this->linkUrl)
return \HTML\a('rLink', $label, $doi, "_blank");
else
return $label;
}
else
return $doi;
}
/**
* Create date
*/
private function createDate()
{
$startDay = isset($this->row['resourcemiscField2']) ? $this->row['resourcemiscField2'] : FALSE;
$startMonth = isset($this->row['resourcemiscField3']) ? $this->row['resourcemiscField3'] : FALSE;
unset($this->row['resourcemiscField2']);
unset($this->row['resourcemiscField3']);
$endDay = isset($this->row['resourcemiscField5']) ? $this->row['resourcemiscField5'] : FALSE;
$endMonth = isset($this->row['resourcemiscField6']) ? $this->row['resourcemiscField6'] : FALSE;
unset($this->row['resourcemiscField5']);
unset($this->row['resourcemiscField6']);
$startDay = ($startDay == 0) ? FALSE : $startDay;
$startMonth = ($startMonth == 0) ? FALSE : $startMonth;
if(!$startMonth)
return;
$endDay = ($endDay == 0) ? FALSE : $endDay;
$endMonth = ($endMonth == 0) ? FALSE : $endMonth;
if($this->row['resourceType'] == 'web_article')
{
if($endDay && !$endMonth)
$endDay == FALSE;
else if($endMonth)
{
$this->bibformat->formatDate($endDay, $endMonth, FALSE, FALSE, TRUE);
$endDay = $endMonth = FALSE;
}
}
$this->bibformat->formatDate($startDay, $startMonth, $endDay, $endMonth);
}
/**
* Create runningTime for film/broadcast
*/
private function createRunningTime()
{
$minutes = $this->row['resourcemiscField1'];
$hours = $this->row['resourcemiscField4'];
if(!$hours && !$minutes)
return;
if(!$hours)
$hours = 0;
$this->bibformat->formatRunningTime($minutes, $hours);
}
/**
* Create the edition number
*
* @param int $editionKey
*/
private function createEdition($editionKey)
{
if(!$this->row[$editionKey])
return FALSE;
$edition = $this->row[$editionKey];
$this->bibformat->formatEdition($edition);
}
/**
* Create page start and page end
*/
private function createPages()
{
if(!$this->row['resourcepagePageStart'] || $this->pages) // empty field or page format already done
{
$this->pages = TRUE;
return;
}
$this->pages = TRUE;
$start = trim($this->row['resourcepagePageStart']);
$end = $this->row['resourcepagePageEnd'] ? trim($this->row['resourcepagePageEnd']) : FALSE;
$this->bibformat->formatPages($start, $end);
}
/**
* get names from database for creator, editor, translator etc.
*
* @param string $nameType
* @param boolean $singleResource If TRUE, we format just a single resource as in RESOURCEVIEW and so gather creator details here.
*/
private function grabNames($nameType, $singleResource)
{
$this->coinsCreators = array();
$nameIds = UTF8::mb_explode(",", $this->row[$nameType]);
foreach($nameIds as $nameId)
{
if(array_key_exists($nameId, $this->creators))
{
$rowSql[$nameId] = $this->creators[$nameId];
continue;
}
$conditions[] = $this->db->formatFields("creatorId") . $this->db->equal . $this->db->tidyInput($nameId);
}
if(!isset($conditions))
{
$this->bibformat->formatNames($rowSql, $nameType);
$this->coinsCreators = $rowSql;
return;
}
if($singleResource)
{
$this->db->formatConditions(join($this->db->or, $conditions));
$recordset = $this->db->select('creator', array(array("creatorSurname" => 'surname'),
array("creatorFirstname" => 'firstname'),
array("creatorInitials" => 'initials'), array("creatorPrefix" => 'prefix'), "creatorId"));
// Reorder $row so that creator order is correct and not that returned by SQL
while($row = $this->db->fetchRow($recordset))
$this->creators[$row['creatorId']] = $rowSql[$row['creatorId']] = array_map(array($this, "removeSlashes"), $row);
}
if(!isset($rowSql))
return FALSE;
foreach($nameIds as $id)
{
if(array_key_exists($id, $rowSql))
$rowTemp[] = $this->coinsCreators[] = $rowSql[$id];
}
$this->bibformat->formatNames($rowTemp, $nameType);
}
/**
* Remove slashes depending upon output
*
* @param string $element
*/
function removeSlashes($element)
{
if($this->output == 'rtf')
return str_replace('\\', '\\\\', stripslashes($element));
else
return stripslashes($element);
}
}
?>
\ No newline at end of file
<?php
/**
* WIKINDX : Bibliographic Management system.
* @link http://wikindx.sourceforge.net/ The WIKINDX SourceForge project
* @author The WIKINDX Team
* @copyright 2017 Mark Grimshaw <sirfragalot@users.sourceforge.net>
* @license https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode CC-BY-NC-SA 2.0
*/
/**
* CITE class.
*
* Citation handling. This is the main file to handle citations.
*
* @package wikindx5\core\bibcitation
* @author Mark Grimshaw <sirfragalot@users.sourceforge.net>
*/
class CITE
{
/** object */
public $citeStyle;
/**
* CITE
*
* @param string $output 'html', plain', 'rtf'. Default is 'html'
*/
public function __construct($output = 'html')
{
$this->citeStyle = FACTORY_CITESTYLE::getInstance($output);
}
/**
* parse [cite]...[/cite] and format citations
*
* @author Mark Grimshaw
* @version 1
* @param string $text Input text
* @param string $output 'html', plain', 'rtf'
* @param boolean $citeLink Link external citations in the returned citation. Default is TRUE
* @param boolean $rtfBibExport If TRUE, we're exporting to RTF. Default is FALSE
* @param boolean $suwpExport If TRUE, we're exporting to the word processor plug-in. Default is FALSE
* @return string parsed text
*/
public function parseCitations($text, $output, $citeLink = TRUE, $rtfBibExport = FALSE, $suwpExport = FALSE)
{
// If no citations, return doing nothing
if(mb_strpos(mb_strtolower($text), "[cite]") === FALSE)
return $text;
$this->citeStyle->output = $output;
$this->citeStyle->rtfBibExport = $rtfBibExport;
if($suwpExport) // Exporting from the SUWP
{
$this->citeStyle->citeFormat->suwpExport = TRUE;
if($this->citeStyle->citeFormat->style['citationStyle'] && ($output == 'rtf'))
{
$text = preg_replace_callback("/(\[footnote])(.*)(\[\/footnote\])/Uus",
array($this, 'footnoteCallback'), $text);
}
if($this->citeStyle->citeFormat->style['endnoteStyle'] == 1)
{
$this->citeStyle->citeFormat->citeOffsets = preg_split("/\[cite\]/Uuis", $text, -1,
PREG_SPLIT_OFFSET_CAPTURE);
array_shift($this->citeStyle->citeFormat->citeOffsets);
$this->citeStyle->citeFormat->footnoteOffsets = preg_split("/\[footnote\]/Uuis", $text, -1,
PREG_SPLIT_OFFSET_CAPTURE);
array_shift($this->citeStyle->citeFormat->footnoteOffsets);
}
}
return $this->citeStyle->start($text, $citeLink);
}
/**
* Callback
*
* @param array $matches
*/
private function footnoteCallback($matches)
{
if(preg_match("/(.*)\[cite\].*\[\/cite\](.*)/Uus", $matches[2]))
return $matches[1] . preg_replace_callback("/\s*\[cite].*\[\/cite\](.*)/Uus",
array($this, 'footnoteCiteCallback'), $matches[2]) . $matches[3];
else
return $matches[1] . $matches[2] . $matches[3];
}
/**
* Callback
*
* @param array $matches
*/
private function footnoteCiteCallback($matches)
{
return $matches[1];
}
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
/**
* WIKINDX : Bibliographic Management system.
* @link http://wikindx.sourceforge.net/ The WIKINDX SourceForge project
* @author The WIKINDX Team
* @copyright 2018 Mark Grimshaw <sirfragalot@users.sourceforge.net>
* @license https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode CC-BY-NC-SA 2.0
*/
/**
* Format a bibliographic resource for output.
*
* @author Andrea Rossato/Mark Grimshaw <sirfragalot@users.sourceforge.net>
* @version 1
*
* @package wikindx5\core\bibcitation
*/
class EXPORTFILTER
{
/** object */
private $bibformat;
/** string */
private $format;
/** object */
/** string */
public $newline;
/**
* EXPORTFILTER
*
* @param object $ref
* @param string $output 'html', plain', 'rtf'. Default is 'html'
*/
public function __construct(&$ref, $output)
{
$this->bibformat =& $ref;
$this->format = $output;
// New line (used in CITEFORMAT::endnoteProcess)
// Also, bibliographic/footnote templates may have the special string 'NEWLINE'
if($this->format == 'rtf')
$this->newLine = "\\par\\qj ";
else if($this->format == 'html') // 'html'
$this->newLine = BR;
else
$this->newLine = "". LF;
}
/**
* Format for HTML or RTF/plain?
*
* @author Mark Grimshaw
* @version 1
*
* @param string $data Input string
* @param boolean $htmlDone Default FALSE (deprecated)
*/
public function format($data, $htmlDone = FALSE)
{
if(!$data)
return $data;
if($this->format == 'html')
{
/**
* Scan for search patterns and highlight accordingly
*/
/**
* Temporarily replace any URL - works for just one URL in the output string.
*/
if(preg_match("/(<a.*>.*<\/a>)/ui", $data, $match))
{
$url = preg_quote($match[1], '/');
$data = preg_replace("/$url/u", "OSBIB__URL__OSBIB", $data);
}
else
$url = FALSE;
$data = str_replace("\"", "&quot;", $data);
if(!$htmlDone)
{
// $data = str_replace("<", "&lt;", $data);
// $data = str_replace(">", "&gt;", $data);
// $data = preg_replace("/&(?![a-zA-Z0-9#]+?;)/u", "&amp;", $data);
}
// This double replace stops stops the search term 'ass' being used to replace the 'ass' in 'class'
// $data = $this->bibformat->patterns ?
// preg_replace($this->bibformat->patterns, "<span class=\"" . $this->bibformat->patternHighlight . "\">$1</span>", $data) : $data;
$data = preg_replace("/\[b\](.*?)\[\/b\]/uis", "<strong>$1</strong>", $data);
$data = preg_replace("/\[i\](.*?)\[\/i\]/uis", "<em>$1</em>", $data);
$data = preg_replace("/\[sup\](.*?)\[\/sup\]/uis", "<sup>$1</sup>", $data);
$data = preg_replace("/\[sub\](.*?)\[\/sub\]/uis", "<sub>$1</sub>", $data);
$data = preg_replace("/\[u\](.*?)\[\/u\]/uis", "<span style=\"text-decoration: underline;\">$1</span>", $data);
// Recover any URL
if($url)
$data = str_replace("OSBIB__URL__OSBIB", $match[1], $data);
$data = str_replace("WIKINDX_NDASH", "&ndash;", $data);
$data = str_replace("NEWLINE", $this->newLine, $data);
if($this->bibformat->patterns)
{
$data = preg_replace($this->bibformat->patterns, \HTML\span("$1", "highlight"), $data);
// $data = preg_replace($this->bibformat->patterns,
// "W!I!K!I!N!D!X!$1W!I!K!I!N!D!X!", $data);
// $data = preg_replace("/W!I!K!I!N!D!X!(.*)W!I!K!I!N!D!X!/Uu",
// "<span class=\"" . $this->bibformat->patternHighlight . "\">$1</span>", $data);
}
}
else if($this->format == 'rtf')
{
$data = preg_replace("/&#(.*?);/u", "\\u$1", $data);
$data = preg_replace("/\[b\](.*?)\[\/b\]/uis", "{{\\b $1}}", $data);
$data = preg_replace("/\[i\](.*?)\[\/i\]/uis", "{{\\i $1}}", $data);
$data = preg_replace("/\[u\](.*?)\[\/u\]/uis", "{{\\ul $1}}", $data);
$data = preg_replace("/\[sup\](.*?)\[\/sup\]/uis", "{{\\super $1}}", $data);
$data = preg_replace("/\[sub\](.*?)\[\/sub\]/uis", "{{\\sub $1}}", $data);
$data = str_replace("WIKINDX_NDASH", "\\u8212\\'14", $data);
$data = str_replace("NEWLINE", $this->newLine, $data);
}
/**
* OpenOffice-1.x.
*/
else if($this->format == 'sxw')
{
$data = UTF8::decodeUtf8($data);
$data = str_replace("\"", "&quot;", $data);
$data = str_replace("<", "&lt;", $data);
$data = str_replace(">", "&gt;", $data);
$data = preg_replace("/&(?![a-zA-Z0-9#]+?;)/u", "&amp;", $data);
$data = preg_replace("/\[b\](.*?)\[\/b\]/uis", "<text:span text:style-name=\"textbf\">$1</text:span>", $data);
$data = preg_replace("/\[i\](.*?)\[\/i\]/uis", "<text:span text:style-name=\"emph\">$1</text:span>", $data);
$data = preg_replace("/\[sup\](.*?)\[\/sup\]/uis", "<text:span text:style-name=\"superscript\">$1</text:span>", $data);
$data = preg_replace("/\[sub\](.*?)\[\/sub\]/uis", "<text:span text:style-name=\"subscript\">$1</text:span>", $data);
$data = preg_replace("/\[u\](.*?)\[\/u\]/uis", "<text:span text:style-name=\"underline\">$1</text:span>", $data);
$data = "<text:p text:style-name=\"Text body\">".$data."</text:p>". LF;
$data = str_replace("WIKINDX_NDASH", "-", $data);
}
/**
* 'noScan' means do nothing (leave BBCodes intact)
*/
else if($this->format == 'noScan')
{
$data = str_replace("WIKINDX_NDASH", "-", $data);
$data = str_replace("NEWLINE", $this->newLine, $data);
return $data;
}
/**
* StripBBCode for 'plain'.
*/
else
{
$data = preg_replace("/\[.*\]|\[\/.*\]/Uu", "", $data);
$data = str_replace("WIKINDX_NDASH", "-", $data);
$data = str_replace("NEWLINE", $this->newLine, $data);
}
return $data;
}
}
?>
\ No newline at end of file
<?php
/**
* WIKINDX : Bibliographic Management system.
* @link http://wikindx.sourceforge.net/ The WIKINDX SourceForge project
* @author The WIKINDX Team
* @copyright 2017 Mark Grimshaw <sirfragalot@users.sourceforge.net>
* @license https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode CC-BY-NC-SA 2.0
*/
/**
* Load the bibliographic style list
*
* @version 3
*
* @package wikindx5\core\bibcitation
* @author Mark Grimshaw <sirfragalot@users.sourceforge.net>
*
*/
namespace LOADSTYLE
{
/**
* LOADSTYLE
*/
const ROOT_DIR = 'styles/bibliography';
/**
* OSBIB version information
*
* @name OSBIB_VERSION
*/
const OSBIB_VERSION = 3.2;
/**
* Read ROOT_DIR directory for XML style files and return an associative array. Each XML file should
* be within its own folder within ROOT_DIR. This folder name should match the first part of the XML file name e.g.
* apa/APA.xml or chicago/CHICAGO.xml.
*
* CONSTANTS.php stores OSBIB_VERSION -- the osbibVersion field of the style XML file must equal this.
*
* @author Mark Grimshaw
* @version 2
*
* @param boolean $compatibilityCheck If TRUE (default), return only files compatible with OSBIB_VERSION
* @return array Sorted associative array - keys = filename (less '.xml'), values = Style description.
*
*/
function loadDir($compatibilityCheck = TRUE)
{
$array = array();
if($handle = opendir(\LOADSTYLE\ROOT_DIR))
{
while(FALSE !== ($dir = readdir($handle)))
{
if($dir != '.' && $dir != '..' && is_dir(\LOADSTYLE\ROOT_DIR . DIRECTORY_SEPARATOR . $dir))
{
$fileName = mb_strtoupper($dir) . ".xml";
$filePath = \LOADSTYLE\ROOT_DIR . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . $fileName;
if(file_exists($filePath))
{
$arrayStyleInfo = \LOADSTYLE\_loadStyleInfo($filePath);
if (!$compatibilityCheck
|| (
$compatibilityCheck
&& ($arrayStyleInfo['osbibversion'] == OSBIB_VERSION)
&& ($arrayStyleInfo['description'] !== NULL)
&& ($arrayStyleInfo['name'] !== NULL)
)
) {
$array[$arrayStyleInfo['name']] = $arrayStyleInfo['description'];
}
}
}
}
closedir($handle);
/**
* Sort alphabetically on the key.
*/
ksort($array);
}
return $array;
}
/**
* Extract info entries from a XML bibliographic style file
* and return an associative array of childnode's value of 'info' node.
*
* This function is taylored by hand to replace the generic parser simplexml_load_file.
* SimpleXml is very simple to use, but is so slow that parse each style file of Wikindx
* implies a waste of 100 ms in each load.
*
* This function is closed to a determined tree node as showed below:
*
* <?xml version="1.0" encoding="utf-8"?>
* <style xml:lang="en">
* <info>
* <name>IDSTYLE</name>
* <description>Identifier of my custom bibliographic Style (IDSTYLE)</description>
* <language>English</language>
* <osbibVersion>3.2</osbibVersion>
* </info>
* [...]
* </style>
*
* @author Stéphane Aulery
* @version 1
*
* @param string $file Location of a StyleFile
* @return associative array - keys = name, description, language, osbibversion
*
*/
function _loadStyleInfo($file)
{
$nodeStyle = NULL;
$nodeInfo = NULL;
$nodeName = NULL;
$nodeDescription = NULL;
$nodeLanguage = NULL;
$nodeOsbibVersion = NULL;
$nodeId = '';
$pXML = new \XMLReader();
if($pXML->open($file))
{
while ($pXML->read())
{
// Stop parsing when we are at the end of 'info' node
if($pXML->nodeType == \XMLReader::END_ELEMENT && mb_strtolower($pXML->name) == 'info')
break;
// When we are on a data that is not a begin of node, we skip it
elseif($pXML->nodeType != \XMLReader::ELEMENT)
continue;
// When we are on a data that is a begin of node, we memorize its name
// and sse if we can explore its childs or get its value
else
$nodeId = mb_strtolower($pXML->name);
// If we find 'style' root node, keep it in memory, we explore its child nodes now
if (!$nodeStyle && $nodeId == 'style')
{
$nodeStyle = TRUE;
continue;
}
else
{
// If we find 'info' node, keep it in memory, we explore its child nodes now
if (!$nodeInfo && $nodeId == 'info')
{
$nodeInfo = TRUE;
continue;
}
else
{
// Read each value needed
if (!$nodeName && $nodeId == 'name')
{
$pXML->read();
$nodeName = $pXML->value;
continue;
}
if (!$nodeDescription && $nodeId == 'description')
{
$pXML->read();
$nodeDescription = $pXML->value;
continue;
}
if (!$nodeLanguage && $nodeId == 'language')
{
$pXML->read();
$nodeLanguage = $pXML->value;
continue;
}
if (!$nodeOsbibVersion && $nodeId == 'osbibversion')
{
$pXML->read();
$nodeOsbibVersion = $pXML->value;
continue;
}
}
}
}
$pXML->close();
}
unset($pXML);
return array(
'name' => $nodeName,
'description' => $nodeDescription,
'language' => $nodeLanguage,
'osbibversion' => $nodeOsbibVersion,
);
}
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment