Typo3 and own script in FlexForms - typo3-6.2.x

Is it possible to use my own PHP in flexform?
I need to read data from a txt file that I upload in the same FlexForm.
I guess I need to reload the flexform after uploading, but how do I read the context of the txt file and list it in the Flexform?

You can use user type of field as described in TCA docs.
Unfortunately I haven't any sample now, but there should be not problem to implement what you need. Tip: good IDE with some debugger will be your friend :)

I made it with itemsProcFunc
<itemsProcFunc>tx_getDataFromXlsxFile->addFields</itemsProcFunc>
And the a claas.getDataFromXlsxFile.php file

Related

any PDF plugin for cakePHP?

I need to implement in a page/view of a form an option to generate a PDF file; looking for information I have seen that cakepdf exists, but there is hardly any information on how to implement/install it and it seems to be outdated.
Are there other options compatible with CakePHP?
Best option to use is https://wkhtmltopdf.org/ via https://github.com/mikehaertl/phpwkhtmltopdf ... we use this to generate PDF documents in our CakePHP solution.

Save comments in config.yml with api spigot/bukkit

I have a config.yml file that has some comments like:
#Thats the message when someone joins to the server
Message: Hello User
But when I save the config.yml file and open again it vanishes and can't be saved.
I tried to search some api for this problem but could not find.
I dont want to use
saveDefaultConfig();
or
getConfig().options.copydefault(true);
saveConfig();
because I dont want to save this trough code. I want to save this with api.
What api should I use?
I would recommend you to use the Spigot API, on my opinion it's the better one
Both API's only support ONE comment in the header section of the config. If you want to save more than one comment you should code your own YAMLConfiguration
To save this one header you should try
getConfig().options().header("Your Comment");
getConfig().options().copyHeader(true)
You can seperate the comment with \n into mutliple lines
You can create a config.yml inside your src folder which will be included into the jar. You can set your default values and any comments by editing this file in your IDE. All you have to do in your main class is calling saveDefaultConfig(); in your onEnable(). After that, you can use getConfig() to access your configuration.
Thats sadly not possible when using the given Tools!
You need to manually write your own ConfigManager where you can do that!
Here is what I got: https://mega.nz/#!lsIkVYhD!knZr5DBmbvPyJh8ONeNx4pfb7Q0C9yuIp6FHiyJmhBw
It may however have a few bugs :D
As stated, the Yaml API provided with Bukkit will strip comments when it is written to. So you can comment your resource config file but comments are lost when it is saved or re-written by the API.
My preferred Yaml handler is SimplixStorage. It handles comments well both at the top and anywhere inside a yaml file. I also found SimpleConfig which allows you to add header, add comments (which are not removed on file saves), as well as add to config with your code.

LimeSurvey - Uploading a PDF

I've been using LimeSurvey to create a survey. There is a question type called File Upload that allows a user to upload a file instead of answering a question. As far as I can tell, the question type does not allow the user to upload a PDF. Is anyone aware of a workaround for this problem?
Its mostly you do not have the directories "upload" and "tmp" with write permissions. Make this necessary change and it should all be fine.
amit
If you click on the 'advanced settings' for the file upload question, there's an entry for file type that's just a comma-separated list of extensions to allow.

Joomla: Allowing a user to upload an image

Alright so I learned that to have an upload button on a page, what you do is basically call a php file (call is upload.php) that would upload a file to the server. I have no idea where I am supposed to put the php file inside the server so I can call it.
I feel stupid because I can't find any answers online. I am getting very frustrated and confused because I am told I need to create a database but I have no idea how to edit a database in Joomla. I took a class in SQL so I don't have to learn about that. I just don't know where it is. I was also told I need to make a component. But this is confusing because all I want to do is have an upload button that will upload an image to the server.
I understand your frustration. I've got the basic idea on what you are trying to do. Here are a couple of options:
You might wanna take a look at Joomla! Extensions Directory ™. You might just find there a component or a module that already does this for you.
If you want to do it on your own, than you need to create a small module or a component inside Joomla! Please refer to the Joomla! Documentation or tutorials on this topic. Please note that you won't get this working instantly, because you first need to understand how Joomla! works. So your upload.php file will go in your module / component files. I don't think you need to do any SQL.
Now the part with "allowing a user" is a bit confusing... you want to "allow" any user to upload things to your server or just let's say, registered users? Generally uploading scripts need to be very strong from the security point of view. If this is the case, that you need to do a search for Joomla! ACL
You can simply create a form and add the "media" field type.
http://docs.joomla.org/Standard_form_field_types
You can also opt for the "file" field types to allow different types of fields.
Both fields can be added using the Joomla Component Creator: http://www.notwebdesign.com/joomla-component-creator/
And you might also want to take a look at K2 which has an excellent image upload functionality that allows scaling of images into three different sizes.

Mock of Ext JS 4 documentation

I have been researching for various type of documentation options for our products. I thought it would be cool to have Ext JS 4 Docs type of look&feel rather than Twiki.
But I am having tough time to understand the current docs page in Ext JS 4.0.7. Each and every directory has README.js & README.md. If I am not wrong, I have to create my custom documentation in README.md, but I am failing to understand how that would be converted into README.js.
Could someone let me know how to .md file can be converted into .js?
They are using a self made tool, which is called JSDuck
I guess you need to run it over your .md files and it will generate the .js files for you.
JsDuck is the way to go. I'm using it to build some custom documentation.
To get the guides:
just create a json file. I usually call it guides.json and write out the structure. It is well defined in the link below.
Create a folder in the same location as the guides file and in it:
create a folder for each entry in the json. (each entry has a name field and this should be the name of the folder)
Create the file readme.md
Add an icon to it. It should be names icon-lg.png
When using jsduck from the command line, add the following to the arguments:
--guides=[the path to your guides.json file]
More information can be found here:
https://github.com/senchalabs/jsduck/wiki/Advanced-Usage (go to the guides section)
Also, to get more information on the commandline parameters, use the command
jsduck-3.2.1 --help=full
Hope this works for you.