New revs

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1005, on September 17th, 2011, 11:59 PM »
rev 1005
(4 files, 12kb)

! Fixed topic page layout for IE6 and IE7 (which don't support display:table, and honestly I don't care much about these browsers.) There are various things that are still broken, such as the mini-menus. Will deal with that later. (index.ie6.css, index.ie7.css)

* Minor tweaks to menu notifications. (index.css)

* Spacinazi. (Subs-Charset.php)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs
« Reply #1006, on September 18th, 2011, 02:44 PM »
(Added:6 Deleted:2 Modified:33, 119KB)

Revision: 1006
Author: arantor
Date: 13:41:10, 18 September 2011
Message:
+ First usable build of the add-on manager. This has many related changes:
+ Actually add the folder. Includes a default htaccess file to block archives from being downloaded from there but potentially all other files might be. (Addons/*)

+ Add the add-on manager. (ManageAddons.*, replacing switch_on.png and switch_off.png with smaller sized images)

! create_table can now add columns and indexes (but not unique or primary indexes) if the table already exists when passed to this function. It also has rudimentary support for new datatypes, namely the floating types (float, real, double) and SET and ENUM, but this isn't properly tested and is likely buggy. (Class-DBPackages.php)

! Attempt to detect if an add-on caused an error and set the error type accordingly. (Doesn't bother to attempt to change the label to just the mod's name or similar, just attempts to locate and update for now) (Errors.php)

! Menu changes for the add-on manager. Some of this is temporary code and it leaves the old package manager available for testing with a naughty non-language-string entry. As Wedge's add-on manager matures this won't be a problem. (Admin.php, Admin.english.php, PackageGet.php, Packages.php, index language file)

! Added a setting for setting the path and URL to the Addons area. (Settings.php, install.php, ManageServer.php, Admin language file)

! Removed Modifications language file (Modifications language file, index.php, SSI.php, Load.php)

! On startup, identify the add-ons currently enabled and add their hooks into the current process' stack, as well as making sure we have the paths and URLs to these for later. (Load.php)

! Language editor can now load the language strings of add-ons and access them directly, much as SD 2.0 does. (ManageServer.php, Admin.template.php)

! New hook loader purely for language files (Subs.php)

! New hooks. (Profile-View.php, Subs-BBC.php, Subs-BoardIndex.php, Who.php (lang only), SSI.php, index.php)

! Make sure that hooked files in loaders are loaded correctly. (Profile.php, ScheduledTasks.php, Subs-Template.php, Subs.php)

! Provide facilities for add-ons to declare CSS and JS to be cached through the caching subsystem. (Subs-Cache.php)

! If icons in menu items are full URLs, don't touch them, useful for add-ons. (Subs-Menu.php)

@ This isn't even complete, there are multiple known items still to do:
- The DB changer in the add-on area cannot add columns to existing non-add-on tables (e.g. new column in members table), nor can it add indexes. Also needs more testing anyway.
- The DB changer also does not run any enable-time scripts (nor disable-time scripts, for that matter)
- There's no ability to upload new add-ons, nor any ability to remove any existing ones (including clean-up)
- Dependency management isn't accounted for either.
- The exact process for updating a given add-on is also to be figured out and implemented. I'm thinking it would actually be a process of unpacking the new one into a new folder, disabling the old one, enabling the new one if possible, then removing the old one. Proper in-place updating is a road to madness.
- File edits need to be accounted for.
- Oh, and permission handling both in terms of permissions being required to enable an add-on (e.g. 'this add-on makes file edits, proceed?') and for when file edits are used, permissions on files, preferably ones that won't screw up a lot of servers.
----
Added : /trunk/Addons
Added : /trunk/Addons/.htaccess
Added : /trunk/Addons/index.php
Modified : /trunk/SSI.php
Modified : /trunk/Sources/Admin.php
Modified : /trunk/Sources/Class-DBPackages.php
Modified : /trunk/Sources/Errors.php
Modified : /trunk/Sources/Load.php
Added : /trunk/Sources/ManageAddons.php
Modified : /trunk/Sources/ManageServer.php
Modified : /trunk/Sources/PackageGet.php
Modified : /trunk/Sources/Packages.php
Modified : /trunk/Sources/Profile-View.php
Modified : /trunk/Sources/Profile.php
Modified : /trunk/Sources/ScheduledTasks.php
Modified : /trunk/Sources/Subs-BBC.php
Modified : /trunk/Sources/Subs-BoardIndex.php
Modified : /trunk/Sources/Subs-Cache.php
Modified : /trunk/Sources/Subs-Menu.php
Modified : /trunk/Sources/Subs-Template.php
Modified : /trunk/Sources/Subs.php
Modified : /trunk/Sources/Who.php
Modified : /trunk/Themes/default/Admin.template.php
Added : /trunk/Themes/default/ManageAddons.template.php
Modified : /trunk/Themes/default/images/admin/switch_off.png
Modified : /trunk/Themes/default/images/admin/switch_on.png
Modified : /trunk/Themes/default/languages/Admin.english.php
Added : /trunk/Themes/default/languages/ManageAddons.english.php
Modified : /trunk/Themes/default/languages/ManageMedia.english.php
Deleted : /trunk/Themes/default/languages/Modifications.english.php
Deleted : /trunk/Themes/default/languages/Modifications.french.php
Modified : /trunk/Themes/default/languages/index.english.php
Modified : /trunk/Themes/default/languages/index.french.php
Modified : /trunk/Themes/default/skins/admin.css
Modified : /trunk/index.php
Modified : /trunk/other/Settings.php
Modified : /trunk/other/Settings_bak.php
Modified : /trunk/other/install.php
Modified : /trunk/other/install.sql
Modified : /trunk/other/tools/wedge_api.php
Modified : /trunk/other/xml/detailed-version.php
Posted: September 18th, 2011, 02:43 PM

Forgot to add that there's also the loadAddon functions in Load.php now that are used for loading add-on source, template and language files as needed.
Posted: September 18th, 2011, 02:43 PM

Oh, and also note that the create_table version here also fixes an SMF bug whereby the default value of a column isn't determined correctly for a pre-existing table.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1007, on September 18th, 2011, 06:38 PM »
rev 1007
(20 files +5-3, 63kb)

+ For the very first time in a year, we wrote and committed the very same feature on the same day, months after we last discussed implementing it. Fixed the conflicts in index.php, and the default index system now accepts a default value ($modSettings['default_index']) without going through hooks. Set it to the name of a source file ('Homepage' for instance) that you want to be the default homepage, or set it to 'boardX', where X is the number of a board, if you want a default board as your entry point. Added a Homepage file, as an example. (index.php, Homepage.php, Homepage.template.php)

* Renamed boardindex action to boards, and BoardIndexInfoCenter to just InfoCenter -- in case we want to use it elsewhere. Related commenazi, too. (index.php, unit test, detailed-version.php, Boards.php, Collapse.php, Display.php, PrintPage.php, Subs-BoardIndex.php, Subs-Calendar.php, Subs.php, Boards.template.php, InfoCenter.template.php, Wireless.template.php, Xml.template.php, ManagePermissions.english.php)

* JumpTo now uses action=boards for redirecting to category URLs. Added compatibility code for Pretty URLs. (Ajax.php, script.js, Xml.template.php)

! Don't attempt loading a block if its target layer doesn't exist. (Subs-Template.php)

! Reverted a small error in rev 1006. (Settings.php)

* Minor commenazi/spacinazi. (Admin.php, ManageMedia.php, Subs-Template.php, Who.php, SSI.php)

@ Note: I still need to convert all #category links to use action=boards... I could use the opportunity to limit the output to just the category we requested? What do you think?
Re: New revs
« Reply #1008, on September 18th, 2011, 07:40 PM »
rev 1008
(15 files, 24kb)

+ Added info center to the Homepage sample, also demonstrating the usage of layer and block manipulation. (Homepage.php, Homepage.template.php)

! Make sure default_action hooks return a callable function, and disable $modSettings['default_index'] in Wireless mode (it's unlikely the admin will write a custom homepage just for Wap2, so their template would like look awful...) (index.php)

! loadBlock('', '', 'add') was being added to the beginning of the layer, rather than the end. Oops. (Subs-Template.php)

* Adding layers to the context layer was forbidden until now. The homepage code made me realize a good reason to allow them, so I did it. However, given the fact that a layer can easily be emulated through manually adding '_above' and '_below' blocks in this case, I'm still not sure whether it's best to allow them. (Subs-Template.php)

- Removed support for the ':side' hint. After some consideration, I think it may be confusing to themers and sidebars should only use the 'sidebar' layer, whatever the situation. Layer hints should represent something that can't be determined by Wedge itself, such as a position in the page. (index.php, Admin.php, Calendar.php, Display.php, Aeva-Gallery.php, MessageIndex.php, Subs-Menu.php, Subs-Template.php, Unread.php, UnreadReplies.php, index.template.php, Warm/skin.xml)

* Indenazi. (Boards.php)
Re: New revs
« Reply #1009, on September 18th, 2011, 11:13 PM »
rev 1009
(11 files, 11kb)

+ Added the 'c' query string variable to action=boards, allowing to specify a single category that should be shown in the board list (à la Noisen). Considering changing it to '?cat=' later, for consistency, although it'll require updating pretty URLs as well. (Boards.php, Load.php, MessageIndex.php, Subs-BoardIndex.php, Recent.php, Search2.php, Unread.php, UnreadReplies.php, ModerationCenter.template.php, Xml.template.php)

* Category collapse action should redirect to the board list instead of reloading it silently from the collapse action URL. (Collapse.php)
Re: New revs
« Reply #1010, on September 18th, 2011, 11:55 PM »
rev 1010
(20 files, 15kb)

* Replaced WIRELESS_PROTOCOL with the 'wap2' string. I don't see us supporting any other wireless protocol in the future. (index.php, Boards.php, Display.php, Errors.php, FindMember.php, Load.php, Login.php, Login2.php, ManageBans.php, MessageIndex.php, PersonalMessage.php, Post.php, Profile.php, Security.php, Post.php, Profile.php, Security.php, Subs.php, Unread.php, UnreadReplies.php)

! Fixed menu layout in IE6 and IE7. Still glitchy, but more usable. (GenericMenu.template.php, index.ie6/ie7.css)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs
« Reply #1011, on September 19th, 2011, 01:47 AM »
(3 files, 10 KB)

Revision: 1011
Author: arantor
Date: 00:46:20, 19 September 2011
Message:
+ Add-on manager can now call for a script to execute when enabling or disabling an add-on. (ManageAddons.php, ManageAddons.english.php)

+ New hook in the help popup, lang_help, so that the help popup can make use of an add-on's language files without the add-on having to do anything too complicated like hijacking the help action, or having to load a file just to contain a single load call. (Help.php, ManageAddons.php)
----
Modified : /trunk/Sources/Help.php
Modified : /trunk/Sources/ManageAddons.php
Modified : /trunk/Themes/default/languages/ManageAddons.english.php

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs
« Reply #1012, on September 19th, 2011, 11:18 AM »
rev 1012
(13 files, 16kb)

+ Added removeBlock() and removeLayer() shortcuts. removeLayer() protects all of the context's direct parents, so you can't remove the main layer through this. (Subs-Template.php)

! loadBlock shouldn't be replacing sidebar blocks, only adding to them. I still don't know if I should make it the default for non-context blocks, but it might confuse themers and modders... (Admin.php, Boards.php, Calendar.php, Display.php, Aeva-Gallery.php, MessageIndex.php, Profile.php, Unread.php, UnreadReplies.php)

! Don't set a block to use a layer that was removed, even if its hint is still there. (Subs-Template.php)

* Changed the way Wedge deals with non-existing target layers in loadBlock(). Mods will now have to specify a fallback layer (logically, 'context') if it's vital for their block to be shown, as 'context' is the only layer that's guaranteed to be shown. Unless some other mod played with unset($context['layers']['context']) like crazy, ah ah. Well, shoot them on sight. (Subs-Template.php)

* If the skeleton array doesn't have at least the context layer, launch a fatal error because an add-on is screwing up. (Subs-Template.php)

! I'm not exactly sure why I used to prevent layer functions (above and below) from being overloaded or overridden... This is fixed now. You can create your template_layer_above_after functions all you want. Well, I think. (Subs-Template.php)

! Menu removal code was still using the old layer system. (Subs-Menu.php)

* Random weak translation. (Help.french.php)

* Pete likes having space in his notifications. (index.css)


@ Need to write a multi-language error for the context layer error... Would you care to write it, Pete? I lack inspiration to do something that can be understood by normal users and not overly dramatic at the same time :P
Re: New revs
« Reply #1013, on September 19th, 2011, 11:54 PM »
rev 1013
(18 files, 22kb)

* Category URLs now use "?category=", and also have their own pretty URL. (index.php, Boards.php, Load.php, PrettyUrls-Filters.php, QueryString.php, Recent.php, Search2.php, Subs-BoardIndex.php, Subs-Template.php, Unread.php, UnreadReplies.php, ModerationCenter.template.php)

! IE9 doesn't support -ms-border-radius, only the prefix-free version, and as a result it didn't show any rounded corners. So, fixed that. (Subs-Cache.php)

+ Added support for notifications in non-main menus. (Subs-Menu.php, GenericMenu.template.php)

! Fixed main menu layout breaking when menu was split into several lines, especially with notifications shown. (index.css)

* The Media menu item now uses menu notifications for its number of unseen items. (Subs.php)

* Code cleanup. (PrettyUrls-Filters.php)


@ Funny note: notifications in non-main menus work in IE6, 7 and 8... But not in IE9 or IE10! Ahah. Well, the layout is broken but it's still usable. Whatever.

@ Also, used 'category' instead of 'cat' because 'cat' is being reserved for blog categories, potentially. Well, it's a weak reason... Feel free to change it.
Re: New revs
« Reply #1014, on September 20th, 2011, 11:53 AM »
rev 1014
(13 files, 19kb)

! Rewrote language code to always load $context['languages'] if userLanguage is enabled [1]. Also made folder traversing faster. This allows to fix language flags not always showing up in the header. (Load.php, ManageServer.php, Register.php, index.template.php)

* Renamed context layer to default layer, as I suspected I'd do. Probably makes more sense to themers. Also added translations for the default_layer_missing error, and removed the ':main' hint, because it's always going to be hardcoded to 'default' anyway. (Homepage.php, Profile.php, Security.php, Subs-Template.php, index.template.php, Errors.language.php, Warm/skin.xml)

! Fixed a small hideChrome bug. (PrintPage.php, Reports.php)
 1. Although I suppose it will fail if it's disabled but there are still multiple languages available and a board defines a non-default language. Need to look into that. Pete, do you remember anything about that?
Re: New revs
« Reply #1015, on September 20th, 2011, 05:30 PM »
rev 1015
(16 files, 13kb)

* Turned (new Date).getTime() into +new Date(), which is shorter. So what? I like shorter. (install.php, restore_backup.php, upgrade.php, Profile.template.php, Register.template.php, Themes.template.php, script.js, suggest.js)

* Spacinazi, mainly empty lines with tabs. (ManageAddons.php, ManageMemberOptions.php, ManagePaid.php, Subs-Scheduled.php, Subs-Template.php, Subs.php, ManageAddons.template.php, index.css)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs
« Reply #1016, on September 21st, 2011, 02:41 AM »
4 files, 12KB

Revision: 1016
Author: arantor
Date: 01:40:20, 21 September 2011
Message:
! Fix some bugs in the error detection in add-ons, namely fixing paths in Windows (as debug_backtrace reports filenames with forward slashes, regardless of DIRECTORY_SEPARATOR), fixing the DB column to actually be wide enough and to display it usefully. Note that, at present, the "using filter" part still uses the add-on's full id, as opposed to the part right of the :, but it does something similar with normal filtering, it doesn't use the nice description but basically the same as what you put in the URL. I'll fix that sometime, but for now, it's an improvement. (install.sql, Errors.php, Load.php, ManageErrors.php)
----
Modified : /trunk/Sources/Errors.php
Modified : /trunk/Sources/Load.php
Modified : /trunk/Sources/ManageErrors.php
Modified : /trunk/other/install.sql


(Yes, this now actually works properly, it's sorting out WedgeDesk errors nicely.)
Re: New revs
« Reply #1017, on September 21st, 2011, 12:20 PM »
1 file, 4KB

Revision: 1017
Author: arantor
Date: 11:20:19, 21 September 2011
Message:
! The admin menu should be able to load add-on files too. (Admin.php)
----
Modified : /trunk/Sources/Admin.php
Re: New revs
« Reply #1018, on September 21st, 2011, 12:36 PM »
1 file, 4KB

Revision: 1018
Author: arantor
Date: 11:36:26, 21 September 2011
Message:
! Make sure the absolute path to add-on JavaScript files is passed to the cacher, not the relative path even when we had already figured out the absolute one. (Subs-Cache.php)
----
Modified : /trunk/Sources/Subs-Cache.php
Re: New revs
« Reply #1019, on September 21st, 2011, 02:24 PM »
1 file, 3KB

Revision: 1019
Author: arantor
Date: 13:24:24, 21 September 2011
Message:
! The language hook loader did not differentiate hooks properly, screwing up the path it was supposed to be using. (Subs.php)
----
Modified : /trunk/Sources/Subs.php