By James Gardner on Wednesday, 13 April 2016
Replies 17
Likes 0
Views 1.1K
Votes 0
Hi

How do I change the order of the status updates buttons (i.e. create events, share files, share link, share photo etc)?

Thanks

James
Unfortunately that was not possible reorder story panel button in current system.
·
Wednesday, 13 April 2016 11:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok. Can you tell me which file calls these buttons so I can look into it?
·
Wednesday, 13 April 2016 17:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey James,

The file responsible to generate these buttons are located in /administrator/components/com_easysocial/includes/story/story.php under the method "prepare".
·
Wednesday, 13 April 2016 17:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks.

That file wasn't the one I was looking for. I'm looking for the class that defines the panel (the one that is called in /components/com_easysocial/themes/wireframe/story/default.php

I just want to re-order the foreach ($story->panels as $panel) for the panel buttons.

thanks
·
Thursday, 14 April 2016 16:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually that was correct file if you track back the code :

JoomlaFolder/components/com_easysocial/themes/wireframe/story/default.php (theme layout)
JoomlaFolder\administrator\components\com_easysocial\includes\story\story.php (html function > then it call the prepare function)


// StoryAttachment service
$panels = $dispatcher->trigger( $this->type , 'onPrepareStoryPanel' , $args );

if( $panels )
{
foreach( $panels as $panel )
{
if ( $panel instanceof SocialStoryPanel )
{
$this->panels[] = $panel;
$this->plugins[] = $panel;
}
}
}
·
Thursday, 14 April 2016 18:12
·
0 Likes
·
0 Votes
·
0 Comments
·
But I want to view the list of buttons i.e. post photo, create event etc. Where are these stored?

Thanks
·
Thursday, 14 April 2016 18:25
·
0 Likes
·
0 Votes
·
0 Comments
·
These are not stored in the database. When we render the apps, we will actually load the apps file and call a method from the app. If the app has a method to render a tab, then it will be listed as a "panel" as Arlex mentioned.
·
Thursday, 14 April 2016 21:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok, but I just want to know what file the list of story panel buttons are so I can change the order.
·
Thursday, 14 April 2016 23:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry but what your question is exactly? I have no idea what you are trying to ask here.
·
Thursday, 14 April 2016 23:39
·
0 Likes
·
0 Votes
·
0 Comments
·
The buttons on the image. I want to change the order of them
·
Thursday, 14 April 2016 23:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey James,

The file that is responsible to output these contents is already provided by my colleague earlier. Please see his reply below:

Arlex Wong wrote:

Actually that was correct file if you track back the code :

JoomlaFolder/components/com_easysocial/themes/wireframe/story/default.php (theme layout)
JoomlaFolder\administrator\components\com_easysocial\includes\story\story.php (html function > then it call the prepare function)


// StoryAttachment service
$panels = $dispatcher->trigger( $this->type , 'onPrepareStoryPanel' , $args );

if( $panels )
{
foreach( $panels as $panel )
{
if ( $panel instanceof SocialStoryPanel )
{
$this->panels[] = $panel;
$this->plugins[] = $panel;
}
}
}
·
Thursday, 14 April 2016 23:53
·
0 Likes
·
0 Votes
·
0 Comments
·
This doesn't give me the list of buttons. This only shows how it is output. I want to see the LIST i.e. the items as in the picture of the source code
·
Friday, 15 April 2016 00:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Please see the file /components/com_easysocial/themes/wireframe/story/default.php as Arlex has already pointed out above.
·
Friday, 15 April 2016 00:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok, that was the file I found but did not have what I have.

Nevermind I'll have to live with what I have.
·
Friday, 15 April 2016 01:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey James,

You need to understand that these lists are populated dynamically and we do not "hardcode" these tabs. You should take a look at the codes here from the theme file,

·
Friday, 15 April 2016 01:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

James I had the same problem because I wanted to have videos and images first when the responsive theme only shows three buttons.

since the list of panels is just an array of objects it theoretically can be ordered by custom order here is what I came up with for the above function from JoomlaFolder\administrator\components\com_easysocial\includes\story\story.php:


if( $panels )
{
$order = array('photos','videos','links','event','files','polls','broadcast');
usort($panels, function ($a, $b) use ($order) {
$pos_a = array_search($a->name, $order);
$pos_b = array_search($b->name, $order);
return $pos_a - $pos_b;
});
foreach( $panels as $panel )
{
if ( $panel instanceof SocialStoryPanel )
{
$this->panels[] = $panel;
$this->plugins[] = $panel;
}
}
}
return true;


the $order variable defines the order I prefer and the usort function sorts the array before returning the buttons. This may break if you have different types of buttons available but should be easily adaptable.

good luck!
·
Wednesday, 18 May 2016 16:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing Sascha
·
Wednesday, 18 May 2016 17:30
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post