Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Dashboard Module


Go to End


84 Posts   27698 Views

Avatar
Mo

Community Member, 541 Posts

10 October 2009 at 1:48pm

Right, some quick announcements before I go to bed.

1. Mad_Clog, I Have added your patch, seems to be working fine.

2. I have added a jquery based popup for the edit file link. Seems to work ok, and kind of matches the default SS popup (more work on this to come :) ). This is based on Greybox Redux (found at http://jquery.com/demo/grey/) and is a pretty impressive, uber lightweight popup engine.

Both these changes should now be in the trunk.

Uncle Cheese: I can see what you are doing, and it is a good idea. But I am concerned that if you try to make this too modular, then you run the risk of breaking the layout.

It would also be wise, I feel, to maybe limit the number of plugins that can be active at one time. Otherwise you can end up with a massive list of modules that just becomes chaotic and inevitably defeats the idea of quick simple summary of your site.

I will try and have a look properly when I get some time. I want to try and close some existing bugs before doing such a drastic re-write.

Cheers to everyone so far for their input :)

Mo

Avatar
UncleCheese

Forum Moderator, 4102 Posts

10 October 2009 at 3:54pm

Yeah, it is a big change, but I think it's a lot cleaner, and to me, a dashboard, above all other views in an application, should be easy to customize. In an OS, your desktop is the one place you are really empowered to configure your machine the way it works for you, and I think a module like this needs to emulate that. It seems fairly arbitrary to me to dictate to a client what is deserving of representation on their overview page. Silverstripe news is interesting to me, but my clients would be better served by more relevant information, like perhaps upcoming events on their calendar page. Most of them don't have page comments, and I wouldn't be too comfortable with any of them clicking a download link for a new version of Silverstripe. Again, that's the sort of thing that is useful to me as a developer -- just not my client. Every project (and user, for that matter) is different.

I'm pretty psyched about the way this is moving along. If I can nail down that DOM bug, I'll be ready to start rolling this out on a trial basis to some of my clients.

Avatar
Mo

Community Member, 541 Posts

12 October 2009 at 2:03am

Right, I have updated the trunk to include some new functionality:

Basically, I have replaced Silverstripe Navigator with a new admin bar. To gain access to this new bar, you need to replace $Silverstripenavigator in your template with $SSNavigator.

I also styled the popup a bit more to match the default SS popup.

I have tested this quite a bit, and seems pretty stable, so I am versioning it 0.4.

For the next version I will attempt to integrate Uncle Cheese's Patch and make this more modular.

Thanks so much for all your assistance on this :)

Mo

Avatar
Mad_Clog

Community Member, 78 Posts

12 October 2009 at 8:13pm

Edited: 12/10/2009 8:35pm

Just tried to install the new version:
Fatal error: Class 'DOMDocument' not found in ***/dashboard/code/DashboardAdmin.php on line 162
Not everybody has these kinds of php extensions installed.
From from what i can gather you only use it to parse a list of hyperlinks.
I'd suggest using a less elegant, but more portable way, to parse the list.
You could for example use regular expressions.

Keep up the good work, really looking forward to the next version!

//Edit, patch which uses suggested solution

	public function GetUpdates() {
		// Initial variables about SVN location and Current version
		$verList = $aItems = array();
		$curVersion = LeftAndMain::CMSVersion();
		$curVersion = floor(str_replace(array('.','/'),'',$curVersion));

		// Get HTML from Silverstripe SVN browser, then pull out all A tags
		$sRequest = HTTP::sendRequest('svn.silverstripe.com', '/open/modules/sapphire/tags/', null);
		preg_match_all('#<a[^<]*>([^<]*)</a>#i', $sRequest, $aItems, PREG_SET_ORDER);


		// Loop trough all A tags and attempt to convert their value to Int. If success
		// add the value to $verList array.
		foreach($aItems as $aItem) {
			$result = $aItem[1];
			$strip = str_replace(array('.','/'), '', $result);

			if(floor($strip))
				array_push($verList,$result);
		}

		// Retrieve the last item in the $verList array and converty to int
		$latest = floor(str_replace(array('.','/'), '', $verList[count($verList) - 1]));

		// If latest version if later than current version, return an update message.
		if($latest > $curVersion)
			return 'Silverstripe ' . str_replace('/','',$verList[count($verList) - 1]) . ' is available. The latest version can be found <a href="' . self::$ss_link . '" title="Silverstripe download page">here</a>, or update your SVN.';

	}

Avatar
Mo

Community Member, 541 Posts

12 October 2009 at 11:10pm

Well I am using the Dom class in PHP 5. My understanding, and according to the php docs here: http://www.php.net/manual/en/dom.installation.php

Dom is pre-installed in PHP5, in fact, every time I have installed it, DOM has been a core class.

This is something that really bugs me about PHP, even things that are supposed to be core classes, sometimes aren't!

Avatar
Mad_Clog

Community Member, 78 Posts

13 October 2009 at 12:12am

We're running PHP Version 5.2.4
Although it seems to be manually disabled, this isn't the first time I came across not being able to use the DOM extension.
So for portability purposes I'd still recommend not using the DOM extension.
But then again, it's your module so it's all up to you ;)

Avatar
MarcusDalgren

Community Member, 288 Posts

13 October 2009 at 12:21am

There's a library called Simple HTML DOM Parser for working with the HTML DOM. It hasn't been updated for awhile but its been working really well in the projects that I've used it in. It uses a jQuery-like syntax for DOM manipulation so it's really easy to use.

As far as I know it doesn't depend on any special extensions in php so it should work for everyone who's running PHP 5.

Avatar
Mo

Community Member, 541 Posts

13 October 2009 at 1:00am

Smurkas: I will have a look at that, it might be use full in future. I love jqueries dom navigation, a similar thing in PHP would be awsome!

Mad_Clog: I have merged your code, and tagged a new version in SVN (0.4.5).

I will now be branching the trunk to work on Uncle Cheese's patch. Fingers crossed :).

Mo