About the default value issue in UAAppReviewManager - ios

I just wondering where the default value setting?
UAAppReviewManager.h
/*
* Get/Set your Apple generated software id.
* This is the only required setup value. No default.
*/
+ (NSString *)appID;
+ (void)setAppID:(NSString *)appID;
/*
* Get/Set the App Name to use in the prompt
* Default value is your localized display name from the info.plist
*/
+ (NSString *)appName;
+ (void)setAppName:(NSString *)appName;
/*
* Get/Set the title to use on the review prompt.
* Default value is a localized "Rate <appName>"
*/
+ (NSString *)reviewTitle;
+ (void)setReviewTitle:(NSString *)reviewTitle;
/*
* Get/Set the message to use on the review prompt.
* Default value is a localized
* "If you enjoy using <appName>, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!"
*/
Above is a piece of code in UAAppReviewManager.h and it says that default value is your localized display name from the info.plist,
But I didn't find any info.plist including those setting(Default value)
So where's it?

It is referring to your project info .

Related

How to get format settings of field in drupal 8?

I have a drupal 8 project and I was requested by my customer to get format settings of field in content type to respond to an api for mobile app. I created a new module, and trying to get data of format settings. But haven't succeed. I just get all setting of a field, but not display settings of field in content type.
On picture below, I want get all data of format column, and show it as a json. Please help me. Thanks so much!
If you want to extract the formatter settings for a specific field, you can use this option:
/** #var \Drupal\Core\Entity\EntityDisplayRepository $entityDisplayRepository */
$entityDisplayRepository = \Drupal::service('entity_display.repository');
$productViewDisplay = $entityDisplayRepository->getViewDisplay('node', 'page', 'teaser' /* optional */);
$all_formatters_settings = $productViewDisplay->get('content');
$formatter_settings = $all_formatters_settings['field_my_field'];
If you need to get the settings for the widget, you can similarly call the function getFormDisplay in the repository instead of getViewDisplay:
/** #var \Drupal\Core\Entity\EntityDisplayRepository $entityDisplayRepository */
$entityDisplayRepository = \Drupal::service('entity_display.repository');
$productViewDisplay = $entityDisplayRepository->getFormDisplay('node', 'page', 'teaser' /* optional */);
$all_formatters_settings = $productViewDisplay->get('content');
$formatter_settings = $all_formatters_settings['field_my_field'];
There is another way to get the formatter settings.
$formatter_settings = \Drupal::entityTypeManager()
->getStorage('entity_view_display')
->load("entity_type_id.entity_bundle.view_mode")
->getRenderer('field_logo_kataloga')
->getSettings();

Response code Null (0) today, app was working yesterday (API Integration)

I have integrated Asana task lists into my company's website for our development team. All was going well until today - the page I created now errors out with a response code of NULL (or 0). In my very limited experience, this is an issue with the Asana connection, correct? Is this something I can fix on my side or is Asana API currently down (considering this worked up until today)?
We are using the API key, not OAuth, as everyone who has access to this task list is on the same workspace.
Edit:
I have 2 api keys that I am working with - 1 for production, 1 for development. I switch them out when I hand over a branch for my boss to merge in.
Testing API key works just fine.
Production API key does not work - always a response code null when trying to pull back tasks.
I am brand new to API development and I do not know how to use curl to make these calls. I am using a library found here:
https://github.com/ajimix/asana-api-php-class/blob/master/asana.php
More specifically, here is my code:
/*
* We are only interested in the JVZoo workspace
* Unless we are testing, in which we will use Faith In Motion workspace
*/
$JVZ_workspace_id = 18868754507673;
$FIM_workspace_id = 47486153348950;
/*
* Which one are we using right now?
*/
$workspace = $FIM_workspace_id;
/*
* Now lets do the same thing with Projects
* There should only be one project - JVZoo.com
* Unless we are testing - More JVZoo Testing
*
* We do need to dynamically show the project name
* This will help on confusion if we are accidently in the
* wrong project
*
* Then start building an array with these pieces
*/
$JVZ_project = array();
$JVZ_project['id'] = 53244927972665;
$JVZ_project['name'] = "JVZoo.com";
$FIM_project = array();
$FIM_project['id'] = 54787074465868;
$FIM_project['name'] = "More JVZoo Testing";
/*
* Which one are we using?
*/
$project = $FIM_project;
/*
* In order to help reduce load time even more,
* we are not going to return the project name
*
* This way we do not need to ask Asana for the project information
* This does change the layout of the view, however
*
* And finally grab all tasks for each project
* Connection check
*
* Return all tasks from this workspace and hand-filter
* to show both assigned and followed tasks
*/
$tasksJson = $asana->getProjectTasks($project['id']);
if ($asana->responseCode != '200' || is_null($tasksJson))
{
$this->session->set_flashdata('error', 'Error while trying to get tasks from Asana, response code: ' . $asana->responseCode);
redirect_and_continue_processing('/dashboard');
return;
}
FIM is my test environment.
JVZ is my production environment.
/**
* Returns all unarchived tasks of a given project
*
* #param string $projectId
* #param array $opt Array of options to pass
* (#see https://asana.com/developers/documentation/getting-started/input-output-options)
*
* #return string JSON or null
*/
public function getProjectTasks($projectId, array $opts = array())
{
$options = http_build_query($opts);
return $this->askAsana($this->taskUrl . '?project=' . $projectId . '&' . $options);
}
I did a PR on the parameter passed in to line that is returned above. In my FIM environment, I get this:
https://app.asana.com/api/1.0/tasks?project=54787074465868&
For my production environment:
https://app.asana.com/api/1.0/tasks?project=53244927972665&

Doxygen comments not running in Xcode

I read that since Xcode 5 doxygen comments are recognized automatically. I have Xcode 6.3 and not appears these comments.
Have I to enable any option in Xcode??
I commented my methods as:
/**
* bla bla bla
*/
Thanks
You have to add * when you start a new line. For example:
/**
* Description
*
* #param param1 param1 description
* #param param2 param2 description
*
* #return return value description
*/
- (id) myMethodWithParam:(id)param1 andParam:(id)param2
I recommand you to add VVDocumenter-Xcode plugin.
You are right, it works without *. But you need to add the prototype of your method into your header file.

how to validate and check if a entered URL is valid or not in Drupal 6

Without using any third party modules, is it possible to validate and check at the same time if any URL entered in a text-box is valid or not in Drupal 6 ? Some sample code will be appreciated.
menu_valid_path() function in menu.inc (which is part of Drupal Core) does just that.
To answer your specific question:
Without using any third party modules, is it possible to validate and check at the same time if any URL entered in a text-box is valid or not in Drupal 6
Yes.
You will, however, need to create a simple custom module.
Let's assume:
Your form id is my_form_1
The field name in question is my_path_field_1
In your MODULENAME.module file:
<?php
/**
* Modifies the existing form element 'my_path_field_1' to add
* 'MODULENAME_path_validate' function to validation array.
*
* (MYMODULE_path_validate is defined below)
*/
function MODULENAME_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'my_form_1' :
$form['my_path_field_1']['#element_validate'] = array('MODULENAME_path_validate');
break;
}
// Note, you could use hook_form_FORM_ID_alter(&$form, &$form_state)
// instead of the above to simplify things if the only thing this module
// does is validite one field for a valid path.
/**
* Validates the my_path_field_1 using Drupal's built-in menu_valid_path()
* function. Returns a form error if the field does not contain a valid path
* or the current user does not have access to the path's permission.
*/
function MODULENAME_path_validate($element, &$form_state) {
if (!menu_valid_path($element)) {
form_error($element, t('The path entered does not exist or you do not have permission to access it.'));
}
}

Symfony embedRelation options - setting sub-form field visibility

The prototype of embedRelation makes reference to an 'options' array (passed as $formArguments/$formargs).
Is it possible to pass an options array:
embedRelation("Model","ModelForm",$options_arr);
Where the options_arr contains form validator/widgets/etc to set for the relation?
$formargs['something']['publish_date'] = new sfWidgetFormInputText();
Or is it possible to limit the form fields displayed for a relation in a way like this?
$formargs['something']['use_fields'] = array('publish_date');
From sfFormDoctrine.class.php
...
* Embed a Doctrine_Collection relationship in to a form
*
* [php]
* $userForm = new UserForm($user);
* $userForm->embedRelation('Groups AS groups');
*
* #param string $relationName The name of the relation and an optional alias
* #param string $formClass The name of the form class to use
* #param array $formArguments Arguments to pass to the constructor (related object will be shifted onto the front)
* #param string $innerDecorator A HTML decorator for each embedded form
* #param string $decorator A HTML decorator for the main embedded form
*
* #throws InvalidArgumentException If the relationship is not a collection
*/
public function embedRelation($relationName, $formClass = null, $formArgs = array(), $innerDecorator = null, $decorator = null)
...
The closest I've been able to get to a spec for the $formArgs array() is from sfFormPropel.class.php (I'm using doctrine 1.2):
* `title`: The title of the collection form once embedded. Defaults to the relation name.
* `embedded_form_class`: The class name of the forms to embed. Uses the model name by default (a form based on a collection of Book objects embeds BookForm objects).
* `collection_form_class`: Class of the collection form to return. Defaults to sfFormPropelCollection.
* `hide_on_new`: If true, the relation form does not appear for new objects. Defaults to false.
* `add_empty`: Whether to allow the user to add new objects to the collection. Defaults to true.
* `add_delete`: Whether to add a delete widget for each object. Defaults to true.
* `remove_fields`: The list of fields to remove from the embedded object forms
* `item_pattern`: The pattern used to name each embedded form. Defaults to '%index%'.
If `add_empty` is set to `true`, the following additional options are available:
* `empty_label`: The label of the empty form. Defaults to 'new' + the relation name.
* `add_link`: The text of the JavaScript link that displays the empty form. Defaults to `Ann new`
* `max_additions`: The max number of additions accepted on the client side. Defaults to 0 (no limit)
If `add_delete` is set to `true`, the following additional options are available:
* `delete_name`: Name of the delete widget. Defaults to 'delete'.
* `delete_widget`: Optional delete widget object. If left null, uses a `sfWidgetFormDelete` instance, which is a checkbox widget with a Javascript confirmation.
* `alert_text`: The text of the Javascript alert to show.
* `hide_parent`: Whether to hide the deleted form when clicking the checkbox. Defaults to true.
* `parent_level`: The number of times parentNode must be called to reach the parent to hide. As a widget doesn't know if it's merged or embedded, this setting allows the JavaScript code used to hide the parent to find it. Recommended values: 6 for embedded form (default), 7 for merged form.
Any insight would be greatly appreciated.
I think that if you put say array('toto' => 'pwet') as form args, you will be able to retrieve 'pwet' in your form using $this->getOption('toto'); From there everything is possible (setting widgets and validators)
Why don't you go another way:
$o = $this->isNew() ? new Model() : $this->getObject()->getModel();
$model_form = new ModelForm($o);
//now configure widgets and validators
$model_form->setWidget('publish_date', new sfWidgetFormInputText());
$model_form->useFields(array('publish_date'));
$this->embedForm('Model', $model_form);

Resources