Okay, I'll install your plugin and try to help with real code.
Could you just give me some information of what is needed in config.php?
a) Here is what I see (and what I guess would be the best form element)
ForumTour.Title (string in TextBox)
ForumTour.Description (string in TextArea)
ForumTour.Xposition (integer in TextBox)
ForumTour.Yposition (integer in TextBox)
ForumTour.TooltipPosition (string: t('top,right,bottom,left') in DropDown)
ForumTour.XpositionType (string: px/% in DropDown)
ForumTour.YpositionType (string: px/% in DropDown)
Is that correct and are all those and only those information needed?
Given that you have two entries, would you need all of the informations mentioned above for each entry or should XPositionType be px or % for every entry?
Here's an example. Should it be like that
@R_J thanks a lot for all the time you spend helping me ^^ ! The information needed is all and only what you mentionned, and it needs to be step specific (like your first example).
In order to make things clear :
title -> step title (pretty obvious)
description -> step description
xPosition -> value used to define the position of the step indicator on the screen (x=0 is on the left side)
xPositionType -> sometimes it's better to use % than px, so I'd like to give users a choice. For example, if xPosition is set to 50 and xPositionType to %, the step indicator will have a CSS style : left : 50%;
TooltipPosition -> the position of the text relative to the step indicator. It's useful in order to improve layout/ease of use.
Sorry, I also have problems to store the desired information and now I do not have any more time to look at it. I attach what I have done so far. it doesn't solve your save problems, though... :-(
@R_J : I made some modification to my old code, and it's now shorter and easier to understand, using your method ! I'm now trying to make a delete function based on the code I found on "Pockets" plugin.
That would be quite easy. You would have to create function that loops through the config values and unsets the array value. You would have to create such a link like the link to the add/edit page so that the title is passed to the function.
[spoiler]
public function SettingsController_ForumTourDelete_Create($sender, $args) {
$sender->Permission('Garden.Settings.Manage');
$ForumTour = array();
$title = $sender->Request->get('title');
if ($title != '') {
// First, we fetch _all_ steps from the config.
$ForumTourConfig = c('ForumTour', array());
// Then we walk through the steps one by one
foreach ($ForumTourConfig as $key => $value) {
// Check if one title matches the title we wanted to change
if ($value['Title'] == $title) {
unset($ForumTourConfig[$key]);
}
}
// Write back the new values to the config
saveToConfig('ForumTour', $ForumTourConfig);
// "Redirect" to the list view to show the short and cleaned list
redirect(Gdn::request()->url('settings/forumtour'));
}
[/spoiler]
By now it is not possible to use the same title for more than one step. I hope that is no show stopper...
@R_J Everything is working just fine now (add/suppress/edit) ! I think I can release a stable version of the tool ! Would you like to be credited as one of the authors, because you did all the hard stuff after all ^^
And no, no need for credits. I just helped with the settings. It was your idea and you did the hardest part (the presentation layer) all alone!
If you like to, you could point to this discussion so that interested people could see how it did grow, but I do not think that anyone is really interested in that, so I guess you even skip that
Thx for the tips ! I'll clean my code asap, I've added some new features which I hope you guys will like ! What is the process required for a plugin to be "approved" ?
This is the first stable iteration I'm able to release ! I hope you guys enjoy it ! Please tell me if anything goes wrong for you, I'll try to fix it ! Same thing if you have ideas for new functionnalities/improvements !
I cleaned up my code, using PSR-2 instead of vanilla standard because PHP codesniffer crashed everytime I try to load this standard ...
Comments
Okay, I'll install your plugin and try to help with real code.
Could you just give me some information of what is needed in config.php?
a) Here is what I see (and what I guess would be the best form element)
ForumTour.Title (string in TextBox)
ForumTour.Description (string in TextArea)
ForumTour.Xposition (integer in TextBox)
ForumTour.Yposition (integer in TextBox)
ForumTour.TooltipPosition (string: t('top,right,bottom,left') in DropDown)
ForumTour.XpositionType (string: px/% in DropDown)
ForumTour.YpositionType (string: px/% in DropDown)
Is that correct and are all those and only those information needed?
Given that you have two entries, would you need all of the informations mentioned above for each entry or should XPositionType be px or % for every entry?
Here's an example. Should it be like that
or like that:
@R_J thanks a lot for all the time you spend helping me ^^ ! The information needed is all and only what you mentionned, and it needs to be step specific (like your first example).
In order to make things clear :
title -> step title (pretty obvious)
description -> step description
xPosition -> value used to define the position of the step indicator on the screen (x=0 is on the left side)
xPositionType -> sometimes it's better to use % than px, so I'd like to give users a choice. For example, if xPosition is set to 50 and xPositionType to %, the step indicator will have a CSS style : left : 50%;
TooltipPosition -> the position of the text relative to the step indicator. It's useful in order to improve layout/ease of use.
It would be great if you would fire some event. Then plugins could handle the event and register their own walkthroughs.
If the user doesn't have the tour plugin, no harm, no foul.
This wouldn't require a front-end either, assuming your registration function is nice.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Sorry, I also have problems to store the desired information and now I do not have any more time to look at it. I attach what I have done so far. it doesn't solve your save problems, though... :-(
This is much better than the first try! Look through the code and just ask if you have questions.
@R_J Wow ! This is by far much better than what I've done ! I'll look into the code right away ! Thank you so much !
@R_J : I made some modification to my old code, and it's now shorter and easier to understand, using your method ! I'm now trying to make a delete function based on the code I found on "Pockets" plugin.
That would be quite easy. You would have to create function that loops through the config values and
unset
s the array value. You would have to create such a link like the link to the add/edit page so that the title is passed to the function.[spoiler]
[/spoiler]
By now it is not possible to use the same title for more than one step. I hope that is no show stopper...
@R_J Everything is working just fine now (add/suppress/edit) ! I think I can release a stable version of the tool ! Would you like to be credited as one of the authors, because you did all the hard stuff after all ^^
Congratulations!
I would suggest you do a massive code cleanup before you publish it. You can find the coding standard here: http://docs.vanillaforums.com/developers/contributing/coding-standard/
And no, no need for credits. I just helped with the settings. It was your idea and you did the hardest part (the presentation layer) all alone!
If you like to, you could point to this discussion so that interested people could see how it did grow, but I do not think that anyone is really interested in that, so I guess you even skip that
Thx for the tips ! I'll clean my code asap, I've added some new features which I hope you guys will like ! What is the process required for a plugin to be "approved" ?
Get employed by Vanilla Inc.
Yeepee !
This is the first stable iteration I'm able to release ! I hope you guys enjoy it ! Please tell me if anything goes wrong for you, I'll try to fix it ! Same thing if you have ideas for new functionnalities/improvements !
I cleaned up my code, using PSR-2 instead of vanilla standard because PHP codesniffer crashed everytime I try to load this standard ...
@R_J thanks again (a lot) !!!