Is there a way to add a tool to osCommerce without having to edit any file? Just simply place files in some dir maybe?
I need to write addon for administrator of osC that lets them print something for every order.
No there isn't.
If you want to extend the admin of osCommerce, you'll have to get dirty and edit some lines of code for the existing files.
This is separate to things like the payment and shipping modules where you can just drop in some files and have it available for install.
Related
I'm using macvim to code rails project.
I used some plugins, which is specific to rails(like vim-rails) and will be loaded only in a rails' app folder.
After I entered a rails's folder, I run mvim and everything goes fine.
However, when I use command + T to open a new tab. the function of those plugins disabled..seems they are not loaded..
How to load them when I open a new tab?
If these plugins use the similar code to that one fugitive does, then putting something like
augroup LaunchFugitiveForAllBuffers
autocmd!
autocmd BufNew :doautocmd fugitive BufRead .
augroup END
(replace fugitive with actual event group name [1]). You can find this name by either grepping plugin files for BufRead (note: case does not really matter) or walking through the output of au BufRead like I did (there should not be many items). Note that things may be more complicated: for example your plugins attach to Filetype event and changing the above to doautocmd fugitive Filetype ruby may not help. Also note that you can purge out word fugitive at all leaving just a space, but it is potentially destructive operation and can be used only for testing (potentially very destructive in case of Filetype event and some others).
[1] Note: event group, not plugin name. These groups are likely to have the name that is a derivative of plugin name, but they are not forced to be equal to it.
Update: It seems that you need railsPluginDetect group for Tim Pope’s rails plugin. I do not have any rails project so I can’t say this for sure, but autocommand looks very similar to fugitive one. It is better though that you go to plugin bug tracker and add a request there (do not forget to search for an existing one).
Additional informations may be needed but I think that's because the new tab creates an empty virtual buffer.
Because your RoR-related plugins only work in a Rails folder and you are not in a Rails folder -- you are probably in ~, check :pwd to know what the working directory is -- those plugins don't work.
I love Rails.vim but I have a problem with using it in some projects. I have two places for controllers in one of my apps:
app/controllers
app/controllers/v1/api
Can I configure (perhaps in config/rails.vim?) this extra path somehow? I'd like to use both of them.
I can navigate by hand like this:
:Rcontroller v1/api/messages_controller.rb
but :Rmodel from this controller does not work, it tries to jump to models/v1/api/model.rb
This isn't tied into the rails.vim add-on, but you can add an additional command to do this for you. I believe this would be far easier than trying to modify the rails.vim source.
I actually wrote a blog post about something similar. For your purposes, you'd want to put something like this in your vimrc:
command -nargs=? RcontrollerApi e \path\to\your\project\app\controllers\v1\api\<args>_controller.rb
You could then call it like this:
:RcontrollerApi messages
You wouldn't have the extra rails.vim sweetness that goes along with the native functionality, though (Like typing :Rcontroller in a view to automatically go to that file).
Here's an idea that may (or may not) work. I don't believe it will allow you to access the aforementioned functionality but it very well may point you in the right direction.
command -nargs=? RcontrollerApi Rcontroller v1/api/<args>_controller.rb
Your database has not been created yet. Please create the database, then install the tables and data using the information above before proceeding.
Use a ftp/sftp/scp app like WinSCP to examine your directory.
There's usually a readme file in the directory.
Read it and do what it says. It'll likely say to run a script, visit an admin page (and then remove it when you're done), etc.. Or it may say to create your database, and enter the relevant info (hostname, directory, userid/pwd) into a .config file or something.
Oh, and you probably need to have a database created on the host before you do this. Sites like dreamhost and pair have control panels where you create the database, and give the admin/dba userid/passwords. Then it comes back with the server host name/directory where you will point your config to.
My idea is that it's much easier to edit related code when it sits in single "work" file. E.g. in Rails application when you implementing some functionality you may edit 1 function per file in the following files: integration test, controller test, controller, model, controller helper. So if it would be possible to 1) mark this code fragments 2) automatically collect them in "work" file 3) edit them togather 4) the tool synchronizes (puts back) the changes; it could simplify development process in many cases. Especially if you need to go through many tweek-and-try iterations.
Vim works fine for this. Install the Rails.vim(1) plugin and with the command :AV you can open a vertical split with the accompanied tests/specs, or :RV to open related files like migrations and views (depending on whether you're viewing model or controller). When you're workspace becomes to cluttered, use :only to go back to one file. Splits are the best way to manage multiple related files IMHO. You can even open the same file twice to see two parts of the same file. It's not exactly the same as you are describing, but it comes close.
1: http://rails.vim.tpope.net/
Just open up Vim and open some windows. What's the problem?
Can someone tell me how to set file permissions in Delphi 2006? I am using TINIFile.Create to create INI files in my application. The problem is that if I create the file while logged onto Windows as an administrator and then try to run the application as just a standard user and overwrite the INI file, I do not have permission to do so. I put the file in the AllUsers\ApplicationData\MyProduct folder. I'd like to set the permissions to this folder. I need AllUsers to have Full permissions to the MyProduct folder. If its possible to do this through a WindowsAPI that'd be great because I also need to do this in C++ and C#. I'd really appreciate any help. Thanks!
Although you can do all sorts of permission changes with the right code in Delphi (as admin) a better application structure is to NOT assume that your App has any privileges (you say you want it to run in user mode). Instead, use the installer that will install your App (e.g Inno Setup) to copy a suitable Ini file template into your required data folder. You can specify the permissions that you want using "Permissions: user-modify" on the file copy line.
You can use JEDI library for this. Here is a blog "Setting file security with JWSCL" from posted by Christian Wimmer
The correct answer on "how to do that" is "don't do it at all".
If you set "allow to write for anyone" for your MyProduct folder or ini-file - this will be violating security. Because now any user can affect other users - this is not what they should be allowed to do.
Any user must affect only his world. He should not affect worlds of other users. This power is reserved for administrators.
Why is this bad? Obsiosly.
That's why the correct way will be approx. like this:
Installer of your application MAY put an ini-file into AllUsers folder, but DO NOT alter file's permissions. This file will be default read-only options.
Your application should read settings from AllUsers folder and from current user folder. If it needs to save settings - it should write to user folder, not AllUsers. That way, each user will have their own preferences/settings.
If you want that "someone powerfull" should have ability to enforce settings for all users - he should be an administrator. He can edit file in AllUsers, thus affecting settings of all users.
Note, that you also need to decide, which setting have higher priority (global or local). So, you can have both at same time: (a) local settings for each user and (b) ability to enforce/override user's settings.
Most probably you create your ini file into the application folder, don't you? You should avoid such practice. Instead create ini files into users\YourUser\AppData\Roaming\YourProduct.
I am having a similar problem.
Since you need to do this also in other environments I have a suggestion for you.
Use an external installer to install your application. It has many benefits and one of them is that it will configure for you a File\Directory\Registry permissions during the installation. Of course you would have to run the installation on administrative account but then your users will have the permissions required by your application.
I can recommend you a great installer which is called Inno Setup.