This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lnCount: integer; | |
| begin | |
| Result := false; | |
| for lnCount := 0 to ComponentCount - 1 do | |
| begin | |
| if Components[lnCount] is TLabeledEdit then | |
| if TLabeledEdit(Components[lnCount]).Text = '' then | |
| begin | |
| MessageDlg('Existe campo obrigatorio em branco!', mtInformation, [mbOK], 0); | |
| Result := true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @file | |
| * User Profile2 MYPROFILE2TYPE. | |
| */ | |
| /** | |
| * Page callback for user profile2 MYPROFILE2TYPE form. | |
| */ | |
| function MYMODULE_load_profile2_MYPROFILE2TYPE_form($form, &$form_state, $user = NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_menu(). | |
| */ | |
| function MYMODULE_menu() { | |
| // MYCUSTOMPATH can't be the world 'profile' | |
| $items['user/%user/MYCUSTOMPATH'] = array( | |
| 'title' => 'Profile', | |
| 'description' => 'User Profile2', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @file | |
| * AJAX Miscellaneous Topics. | |
| */ | |
| /** | |
| * Demonstrates a clickable AJAX-enabled link using the 'use-ajax' class. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_menu(). | |
| * | |
| * Sets up calls to drupal_get_form() for all our example cases. | |
| * | |
| * @see menu_example.module | |
| * @see menu_example_menu() | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="view view-openlayers-maps view-id-openlayers_maps view-display-id-page_7 view-dom-id-85890fd4b4fd686fe8b9d22b6e9303d4"> | |
| <div class="view-filters"> | |
| <form class="ctools-auto-submit-full-form" action="/trip-planner/transport" method="get" id="views-exposed-form-openlayers-maps-page-7" accept-charset="UTF-8"><div><div class="views-exposed-form"> | |
| <div class="views-exposed-widgets clearfix"> | |
| <div id="edit-type-wrapper" class="views-exposed-widget views-widget-filter-name"> | |
| <label for="edit-type"> | |
| Type </label> | |
| <div class="views-widget"> | |
| <div class="form-item form-type-select form-item-type"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| options = { 'cow' : animal, 'cat' : animal, 'earth' : planet, | |
| 'venus' : planet, 'lettuce' : vegetable, 'apple' : fruit } | |
| def animal(): | |
| print 'This is an animal' | |
| def fruit(): | |
| print 'This is a fruit' | |
| def vegetable(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def my_switch_case(value): | |
| return { | |
| 'cow' : 'This is an animal', | |
| 'apple' : 'This is a fruit', | |
| 'lettuce' : 'This is a vegetable', | |
| }.get(value, 'I dont know what that is') | |
| my_switch_case('cow') | |
| # This is an animal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This class provides the functionality we want. You only need to look at | |
| # this if you want to know how this works. It only needs to be defined | |
| # once, no need to muck around with its internals. | |
| class switch(object): | |
| def __init__(self, value): | |
| self.value = value | |
| self.fall = False | |
| def __iter__(self): | |
| """Return the match method once, then stop""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Structered array for convertion into XML. | |
| $data_array = array( | |
| array( | |
| '#xml_tag' => 'a', | |
| '#xml_value' => '', | |
| '#tag_attributes' => array( | |
| array( | |
| 'name' => 'a_attr_name', | |
| 'value' => 'a_attr_value', |