Phpfox Register Page Plugin Call - plugins

Can someone please explain this piece of code works in phpfox {plugin call='user.template_default_block_register_step2_7'}
Thanks in advance.

plugins are works in phpfox as a hook.
to add your custom code with in default phpfox system without changing any file we used plugin.
{plugin call='user.template_default_block_register_step2_7'}
to use this plugin you must create a file name user.template_default_block_register_step2_7.php
in any module even in your custom module.
what ever you write in this file it's automatically added where this plugin call.
you can add multiple plugin with same name in different module.
plugin file path
module_name/include/plugin/

It will include a block file in the following location,that block file has the registration page.
www/projectname/Module/user/template/default/block/register/step2.html

Related

How to access per project / per preset configuration data in vue-cli 3.x?

I'm looking to create a vue-cli 3.x plugin that generates extra files in the project when invoked and templates these based on configuration info entered by the user.
It's rather easy to collect this information from user prompts but it'd be much nicer if users could put this info into some sort of configuration file and have the plugin read it from there.
I understand vue-cli now uses a vue.config.js file on the project level and ~/.vuerc on a more global (preset) level. However, it doesn't look like my generator function would have access to either one of those files.
"The entire preset" should be passed as the third argument to the function when invoking the plugin with module.exports = (api, options, rootOptions) => {} in ./generator/index.js, rootOptions is undefined.
Sililarly, the use of vue.config.js is discussed in the documentation when talking about service plugins, but there's no mention how to use it in a generator function.
Am I missing something obvious here or is there really no officially sanctioned way to do this? Nothing stops me from reading vue.config.js in my function, but this feels hacky. And I wouldn't even know how to find out which preset was used to create the project.
So your problem is that you can't find ~/.vuerc?
I had the same issue and I found the solution here.
The solution is to use the command line
vue config
to see .vuerc, and then use
vue config --delete presets.yourPresetName
to delete your preset.
As well, if you can't type in your preset name in the terminal because it contains a space or an apostrophe, you can use
vue config --edit
to open .vuerc with a text editor and just edit it there

How do I unload a module from Bing Maps?

Assume I have loaded a module like auto-suggest like,
Microsoft.Maps.loadModule('Microsoft.Maps.AutoSuggest', callback);
Is there any way available to unload this module? Thanks in advance.
No, but there is no need to. Loading it simply downloads the script needed for that part of the API. It's like loading any other JavaScript file into your application, once downloaded, there is no undownloading it.

nwjs migrating from 0.12 to 10.18

I am facing a problem upgrading from nw.js version 0.12 to 0.18.
I have a situation while I start from the index.html file from the .nw package. From the file, I navigate to my online version of the app by navigating to the link mytestapp.com/page1online.html. From the Online version of the page located at mytestapp.com/page1online.html, I want to navigate back to an HTML page in the .nw package called page1offline.html. The page1offline.html is located in the root of the .nw package.
In nw.js version 0.12, I used the app:// protocol to navigate to any page located inside the .nw package. Now, since it has been deprecated and instead chrome-extension:// was introduced this navigation is broken.
I tried the using chrome-extension:// instead to the app:// but it did not work. Tried the file:// option but that too did not yield the desired result. Also tried many other options but was disappointed.
Can somebody please help me how to navigate to a static HTML file located inside the .nw package from the live online page opened from the nw.js application.
Any help would be highly appreciated.
Thanks in advance.
Regards & Happy Thanksgiving.
The solution to use/navigate/redirect to an HTML resource in an NW package from a hosted HTML page is to have this entry in the package.json file.
"web_accessible_resources": [
"*.html"
]
}
Also, to reference the resource we should use the chrome-extension protocol as
window.location.href = "chrome-extension://" + chrome.runtime.id + "/mytestpage.html"
Wasted lot of my time on this. Hope this helps someone.
Maybe you got the local file path format wrong. It should be like this (3 forward slashes)...
file:///C:/abc.png
But if the file is inside your NW package then you should be able to access it directly by its name like this... (no need for a path)
SomeFrame.src='abc.png';

How can I expose plugin functions to docpad partials?

tldr; Is there a way to expose functions defined in one plugin for another plugin to use?
I'm trying to use the tagging plugin (https://github.com/rantecki/docpad-plugin-tagging) within a partial.
I have a Jade partial setup as follows:
.post-tags
| Posted in
each tag in tags
a(href=getTagUrl(tag))= tag + ' '
where getTagUrl is a function defined by the tagging plugin. The problem is that the partial has no knowledge and this partial does not render.
As v2.8.0+ of the partials plugin now includes the template data by default (you don't have to manually specify it's inclusion anymore), try running docpad update in your project's root directory and trying again. Otherwise, we'll probably have to see the source code of your project to help isolate the issue.
It's because partial do not have access by default to templateData, the object holding the getTagUrl helper. You have to pass it explicitly to the partial.
Here's a similar answer provided for the eco templating language :
https://stackoverflow.com/a/16631649/232943

How do I write an extension for Sinatra without packaging it as a gem?

I want to include the distance_of_time_in_words method in a sinatra app
I don't want to package and distribute a gem, which is what the Sintra docs direct you to do. I just want that method accessible in my view.
What's the easiest way to do this? Thanks.
On http://www.sinatrarb.com/intro.html look at Helpers section and define helper methods for use in route handlers and templates
Just place the file somewhere in your ruby load path ($LOAD_PATH) and require it. Or place the code directly in your app file.