Once the manifest is obtained by using host.processManifest , necessary changes can be made. How can one pass the manifest to the player after this?
Your function needs to return the manifest as a string value.
Related
I have my tag ${file.name} in a jsp file to display a name of file to download
name containt a full file name,include file extension. for example
testfile.png
a-file.zip
testfile-test505454654.png
a-filenum5468.docx
other_file_with_a_name_very_very_very_larrrrrrrrrrrrrrrrrrrrrge.pdf
Files with very long names, crash my layout.
I think the way to format the file name to shorten it but include the extention. Maybe
testfile.png
a-file.zip
testfile-test505454....png *
a-filenum5468.docx
other_file_with_a_na....pdf *
How I can do?
in href no problem because it is done by id ${file.id}
If file is a POJO, you may add a getter-method to the POJO (something like String getShortName(){}) that returns a short version of the file name. And then use the method in your EL expression: ${file.shortName}.
I would write and register a custom tag that would take care of shortening the output to a maximum length
<custom:short value="${file.name}" var="shortFileName" />
The tag would take care of shortening based on defaults or values you specify in the element and putting it the result in a request attribute you can use anywhere after that declaration.
Since the requirements can be used many times so You should go with CUSTOM Tag solution like #Sotirios Delimanolis suggested.
JSTL function ( Like c:fn ) is another solution. Using jstl function get better performance than Custom tag ( simple / classic model )
Link: http://www.noppanit.com/how-to-create-a-custom-function-for-jstl/
I have a (currently working) plugin which creates a user on a third party system when a user registers. This is working fine so far.
I'm trying now to add a param to the user to store the third party id but this doesn't seem to be working:
function onUserAfterSave($user,$isNew,$success,$msg=''){
if(!$isNew || ! $success){
return;
}
jimport('joomla.log.log');
$res = someThirdPartyCall();
//Res is valid here
JLog::add("Res ".print_r($res,true), JLog::WARNING, 'jerror');
$userOb = JUser::getInstance($user['id']);
$userOb->setParam('sugarid', $res['id']);
//User ob is valid here
JLog::add("UserOb ".print_r($userOb,true), JLog::WARNING, 'jerror');
$saveRes = $userOb->save();
//Result is true. Error array is empty.
JLog::add("Result ".print_r($saveRes,true), JLog::WARNING, 'jerror');
JLog::add("Errors ".print_r($userOb->getErrors(),true), JLog::WARNING, 'jerror');
}
Everything looks great, no errors or the like. The only thing not working is that the params aren't set in the db. Is this because I'm trying to save the user in onUserAfterSave?
You have forgot to import the user library in to your plugin to use setParam. So At the beginning of your file do not forget to include user library. Use this line of code.
jimport( 'joomla.user.user' );
Hope this will help.
If save is finished you can't go back and add to it, the save is finished and door is shut. You need to do set things up when you set up the paramters by making a form plugin to add another field to the params. Then you don't need to save at all because params will just save as part of the normal process. I'm assuming this is not something that needs to be encrypted, right? It's just the user name?
Also I should mention that there is Juser::defParam($key, $value) that lets you add parameters via code.
Here is my BrandController.php
https://gist.github.com/a958926883b9e7cc68f7#file-brandcontroller-php-L53
I've gone through all my files of my custom module, and compared them to the one given from the custom module maker, and I couldn't find much differences.
Are you attempting to upload multiple files? If you're using multiple fileupload elements with the same name you'll get an array of items.
So when the following line is called,
//this way the name is saved in DB
$data['filename'] = $_FILES['filename']['name'];
It will have the value
["name"]=>array(2) {
[0]=>string(9)"file0.txt"
[1]=>string(9)"file1.txt"
}
you'll need to update the code to loop through each $_FILES['filename']['name'] and upload and save the files separately.
You may unknowingly uploaded multiple files. If you that is not your intention, you may check your in your HTML and check the name attribute of the tag. It must not be an array (like this).
<input type="file" name="my_files[]" />
If you only see Array() in your database, it means you are indeed uploading a multiple files. You can process them by using loops.
If you are really sure that you are uploading 1 image, you may follow #Palanikumar's suggestion. Use a print_r() and display the $_FILES and paste it here. IF you don't want to use that, You can use
json_encode($the-data-you-are-going-to-insert-to-the-database);
If you don't know where to put the print_r() function, you may put it after line 56 of this file.
https://gist.github.com/desbest/a958926883b9e7cc68f7#file-brandcontroller-php-L53
if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
print_r($_FILES);
die;
If saveAction() is being called inside an ajax function you need to log the ajax response. Assuming you are using jquery..
$ajaxResponse = $.POST({...});
console.log($ajaxResponse.responseText);
Then, you you can view it inside a browser's console. If nothing appears, you may use a non-async request
$ajaxResponse = $.POST({
// your options,
// your another option,
async: FALSE
});
Usually file upload will return in array format. So that each uploaded file will have the information like name, type, size, temporary name, error. You can get the file information using print function (print_r($_FILES)). So if you want to display name of the file you have to use something like this $_FILES['filename']['name']
Use print function and debugging tool then save file information using loops.
For more info please check here.
You aren't setting the enctype of the form so the image will never be sent. updated the code to
$form = new Varien_Data_Form(array( 'enctype' => 'multipart/form-data'));
We are beginning to allow multi-national registrations and have the requirement to split the phone number entry in the OnePage checkout billing.
We want to add Country Code and split the rest into Area Code Number and Extension fields. Then we will need to concatenate them into one before storing them.
How would I accomplish that?
Could you not just use a hidden field and javascript? So add 2 fields, then use onchange="phonecat()" on each to trigger a function that concatenates then values and assigns them to the pre-existing telephone field, which you have changed to be type="hidden".
Something like the following in JQuery:
function phonecat() {
$(function(){
newphone = jQuery("#initialphone").val() + jQuery("#latterphone").val();
jQuery("#billing\\:telephone").val(newphone);
}(this.jQuery));
}
I've not tested this exact solution, but I've used something similar in the cart. Only the (now hidden) proper field will be passed and used.
File is .../persistent/checkout/onepage/billing/phtml in 1.6 (without persistent/ earlier). And you'll need to define the function somewhere too.
I am trying to add two localization resource files into my MVC3 App_GlobalResources.
I add Global.resx and then Gloabl.fr.resx. However, only the first one generates code in .designer.cs. The second one just generate an empty file.
Can anybody help me out?
Thanks a lot.
That is how its supposed to work. The .designer.cs class is a strongly typed class so that you can type.
#Global.mystring and it will return a localised (depending on the UICulture) string.
The designer file doesn't actually contain the localised strings, it just contains a bunch of properties which (in turn) return the localised string.. this is why you wouldn't need more than one class.
Perhaps you are trying to find a way of retrieving the resources for different cultures e.g. fr?
You need to set the UICulture to "fr". Either manually or by setting the following element in the web config:
<globalization culture="auto" uiCulture="auto"/>
This would do it automatically based on your browser settings