コード例 #1
0
ファイル: dragdrop.php プロジェクト: francomaaanz/learningci
 public function submit()
 {
     check_if_post();
     $selected_data = json_decode($this->input->post('checkpost'));
     dsm($selected_data);
     echo anchor('dragdrop', 'Back');
 }
コード例 #2
0
 function dispatchEmail($to, $sendermail, $subject, $message, $files = array())
 {
     // Debugging verbosity
     if (strpos($_SERVER['REQUEST_URI'], '-DEBUG-DISPATCHEMAIL-STARTFIN-WATCH-') !== false) {
         dsm("dispatchEmail triggered");
     }
     // State if this message is comming from an REI environment or not
     if (function_exists('version_awareness_environment_isproduction') && version_awareness_environment_isproduction() !== true) {
         $message = '<span style="color: red;">NOTICE: The following message was dispatched from the ' . version_awareness_env() . ' environment.<br/>' . 'This notice will not be prepended when the message comes from the production/staging environment</span>' . '<br/><hr/><br/>' . $message;
     }
     ini_set('sendmail_from', $sendermail);
     // email fields: to, from, subject, and so on
     $from = "BusinessUSA <" . $sendermail . ">";
     $headers = "From: {$sendermail}";
     if (!function_exists('version_awareness_environment_isproduction') || version_awareness_environment_isproduction() === true) {
         if (strpos(request_uri(), '-DEBUG-EMAIL-NOADDITIONALHEADERS-') === false) {
             $headers .= "\r\nReply-To: {$sendermail}";
             $headers .= "\r\nX-Mailer: PHP/" . phpversion();
             $headers .= "\r\nReturn-Path: {$sendermail}";
         }
     }
     // boundary
     $semi_rand = md5(time());
     $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
     // headers for attachment
     $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
     // multipart boundary
     $message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n";
     // preparing attachments
     for ($i = 0; $i < count($files); $i++) {
         if (is_file($files[$i])) {
             $message .= "--{$mime_boundary}\n";
             $fp = @fopen($files[$i], "rb");
             $data = @fread($fp, filesize($files[$i]));
             @fclose($fp);
             $data = chunk_split(base64_encode($data));
             $message .= "Content-Type: application/octet-stream; name=\"" . basename($files[$i]) . "\"\n" . "Content-Description: " . basename($files[$i]) . "\n" . "Content-Disposition: attachment;\n" . " filename=\"" . basename($files[$i]) . "\"; size=" . filesize($files[$i]) . ";\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
         }
     }
     $message .= "--{$mime_boundary}--";
     if (!function_exists('version_awareness_environment_isproduction') || version_awareness_environment_isproduction() !== true) {
         $returnpath = "-f" . $sendermail;
     }
     // Dispatch email - debugging and verbosity
     $debug['mail-arguments'] = array('to' => $to, 'subject' => $subject, 'message' => $message, 'headers' => $headers, 'returnpath' => $returnpath);
     // Dispatch email - trigger the native PHP function: mail()
     $ok = @mail($to, $subject, $message, $headers, $returnpath);
     $debug['mail-return'] = $ok;
     // Further debug and verbosity
     if (strpos($_SERVER['REQUEST_URI'], '-DEBUG-DISPATCHEMAIL-VERBOSE-') !== false) {
         dsm($debug);
     }
     if (strpos($_SERVER['REQUEST_URI'], '-DEBUG-DISPATCHEMAIL-STARTFIN-WATCH-') !== false) {
         dsm("dispatchEmail will return {$ok}");
     }
     return $debug;
 }
コード例 #3
0
 /**
  * Implements FacetapiQueryTypeInterface::execute().
  */
 public function execute($query)
 {
     dsm($this->facet);
     /*
        $this->adapter->addFacet($this->facet, $query);
        if ($active = $this->adapter->getActiveItems($this->facet)) {
          // Check the first value since only one is allowed.
          $filter = self::mapFacetItemToFilter(key($active), $this->facet);
          if ($filter) {
            $this->addFacetFilter($query, $this->facet['field'], $filter);
          }
        }
     */
 }
コード例 #4
0
ファイル: twitter.lib.php プロジェクト: ullasjos/squirrel
 public function get_request_token($params = array())
 {
     $oauth_callback = variable_get('twitter_oauth_callback_url', TWITTER_OAUTH_CALLBACK_URL);
     $url = variable_get('twitter_api', TWITTER_API) . '/oauth/request_token';
     try {
         $params = array_merge($params, array('oauth_callback' => url($oauth_callback, array('absolute' => TRUE))));
         $response = $this->auth_request($url, $params);
     } catch (TwitterException $e) {
         watchdog('twitter', '!message', array('!message' => $e->__toString()), WATCHDOG_ERROR);
         return FALSE;
     }
     dsm($params);
     parse_str($response, $token);
     $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
     return $token;
 }
コード例 #5
0
 /**
  * Implements \Drupal\Core\Block\BlockBase::blockBuild().
  */
 public function build()
 {
     //  case 'News':
     //      $blocks['subject'] = t('Photo\'s on News');
     //      $blocks['content'] = array(
     //        '#markup' => '<div id="News_images"> </div>',
     //        '#attached' => array(
     //          'js' => array(
     //            'data' => drupal_get_path('module', 'dd_tools') . '/js/News.js',
     //            array(
     //              'data' => array(
     //                'dd_tools' => array(
     //                  'block_items' => variable_get('News_items', 13),
     //                ),
     //              ),
     //              'type' => 'setting',
     //            ),
     //          ),
     //        ),
     //      );
     $query = db_select('node', 'n')->fields('n')->addTag('node_access')->range(0, $this->configuration['block_count']);
     $result = $query->execute();
     dpm($result);
     foreach ($result as $row) {
         dsm($row);
         var_dump($row);
     }
     $elements = array();
     if ($node_title_list = node_title_list($result)) {
         $elements['forum_list'] = $node_title_list;
         //      $elements['forum_more'] = array(
         //        '#type' => 'more_link',
         //        '#url' => Url::fromRoute('forum.index'),
         //        '#attributes' => array('title' => $this->t('Read the latest forum topics.')),
         //      );
     }
     $build = array();
     $build['elements']['#markup'] = $elements;
     $build['elements']['#markup'] = 'sdfsdafsd';
     $build['container']['#markup'] = '<div id="News_images">sdcsadvsdvsd </div>';
     //    $test = \Drupal::config('nognix.settings')->get('doh_you');
     //    $build['stuff2']['#markup'] = $this->configuration['content'];
     //    $build['#attached']['library'][] = 'dd_tools/News';
     $build['#attached']['library'][] = 'dd_tools/misc';
     return $build;
 }
コード例 #6
0
 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     dsm($item);
     $instance = is_object($item->data) ? $item->data : (object) unserialize($item->data);
     $visibility = array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.'));
     $pages = $instance->pages != substr($instance->pages, 0, 40) ? substr($instance->pages, 0, 40) . '...' : substr($instance->pages, 0, 40);
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     // Show element, style, visibility and pages.
     $this->rows[$name]['data'][] = array('data' => check_plain($instance->element));
     $this->rows[$name]['data'][] = array('data' => check_plain($instance->style));
     $this->rows[$name]['data'][] = array('data' => $visibility[$instance->visibility]);
     $this->rows[$name]['data'][] = array('data' => check_plain($pages));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
コード例 #7
0
function setEventSearchString($searchFilters)
{
    $queryString = "";
    $keyword = htmlspecialchars($searchFilters['keyword']);
    $applySubmit = htmlspecialchars($searchFilters['applySubmit']);
    if ($keyword && !$applySubmit) {
        $queryString = "(bundle:event AND spell:" . solrEscapeQuery($keyword);
    } else {
        $field_event_type = $searchFilters['field_event_type'];
        $field_program_industry = $searchFilters['field_program_industry'];
        $field_program_org_tht_owns_prog = $searchFilters['field_program_org_tht_owns_prog'];
        $field_event_state = $searchFilters['field_event_state'];
        $queryString = "(bundle:event";
        //All the following variables come from the extract call
        foreach ($field_event_type as $index => $event_type) {
            $queryString .= " OR ts_field_event_type:" . solrEscapeQuery(htmlspecialchars($event_type));
        }
        foreach ($field_program_industry as $index => $industry) {
            $queryString .= " OR ts_field_program_industry:" . solrEscapeQuery(htmlspecialchars($industry));
        }
        foreach ($field_program_org_tht_owns_prog as $index => $organization) {
            $queryString .= " OR ts_field_program_org_tht_owns_prog:" . solrEscapeQuery(htmlspecialchars($organization));
        }
        foreach ($field_event_state as $index => $state) {
            $queryString .= " OR ts_field_event_state:" . solrEscapeQuery(htmlspecialchars($state));
        }
        $startDate = htmlspecialchars($searchFilters['startDate']);
        $endDate = htmlspecialchars($searchFilters['endDate']);
        if (!$startDate) {
            $queryString .= ' AND ds_field_event_date:[NOW TO *]';
        } else {
            $startDate = new DateTime($startDate);
            $endDate = new DateTime($endDate);
            if (!$endDate) {
                $endDate = $startDate->modify('+1 day');
            }
            $startDate = $startDate->format('Y-m-d') . 'T00:00:01Z';
            $endDate = $endDate->format('Y-m-d') . 'T23:59:59Z';
            $queryString .= " AND ds_field_event_date:[{$startDate} TO {$endDate}]";
        }
    }
    $queryString .= ")";
    dsm($queryString);
    return $queryString;
}
コード例 #8
0
function metroblocks_form_alter(&$form, &$form_state, $form_id)
{
    dsm($form);
    switch ($form_id) {
        case 'system_theme_settings':
            $form['theme_settings_general'] = array('#type' => 'vertical_tabs');
            $form_elements = element_children($form);
            foreach ($form_elements as $element) {
                if (isset($form[$element]['#type']) && $form[$element]['#type'] == 'fieldset' && !isset($form['#element']['#group'])) {
                    $form[$element]['#group'] = 'theme_settings_general';
                    $form[$element]['#attached'] = array('js' => array(drupal_get_path('module', 'themesettings_verticaltabs') . '/themesettings_verticaltabs.js'));
                }
            }
            // extra submit callback
            array_unshift($form['#submit'], '_themesettings_verticaltabs_submit');
            // remove unnecessary CSS class, fixes whitespace problem
            unset($form['logo']['#attributes']['class']);
    }
}
/** array associateWizardTagsWithNodesInDrupalDatabase()
 *
 * Triggers associateWizardTagsWithNodesInDrupalDatabase() for each wizard in BusinessUSA
 *
 * Returns an associative array of wizard-excelsheet-paths (parameter given to associateWizardTagsWithNodesInDrupalDatabase()) as the key, and 
 * the return of associateWizardTagsWithNodesInDrupalDatabase() as the values.
 */
function associateWizardTagsWithNodesInDrupalDatabaseForAllWizards($returnSummaryOnly = false)
{
    // Dont let this process run if it has already ran within the past 12 hours
    $secondsIn12Hours = 43200;
    if (time() < variable_get('associateWizardTagsWithNodes_lastRun', 0) + $secondsIn12Hours) {
        error_log(__FUNCTION__ . " will not execute its functionality, it has ran too recently, Coder Bookmark: CB-NOGJX2V-BC.");
        return;
    }
    // Note that this process has "last run" at this time
    variable_set('associateWizardTagsWithNodes_lastRun', time());
    // The return buffer, this array will be what the function returns when it terminates
    $toReturn = array();
    //$node_type = 'wizard_result_reference_for_solr';
    //$mySqlLink = connectMySQL();
    $result = db_query("delete FROM node WHERE type='wizard_result_reference_for_solr'");
    //mysql_query($result, $mySqlLink);
    // Select the nodes that we want to delete.
    /*$result = db_select('node', 'n')
            ->fields('n', array('nid'))
            ->condition('type', $node_type, '=')
            ->execute();
    
        foreach ($result as $record) {
            node_delete($record->nid);
    
        }*/
    // Build a list of all WizardResult-Excel files used, across all wizards in BusinessUSA
    $busaWizardResultExcels = array('sites/all/pages/access-financing/wizard-results.xls', 'sites/all/pages/begin-exporting/wizard-results.xls', 'sites/all/pages/disaster-assistance/wizard-results.xls', 'sites/all/pages/expand-exporting/wizard-results.xls', 'sites/all/pages/find-opportunities/wizard-results.xls', 'sites/all/pages/healthcare/wizard-results.xls', 'sites/all/pages/jobcenter-wizard/wizard-results.xls', 'sites/all/pages/rural-exporting/wizard-results.xls', 'sites/all/pages/select-usa/wizard-results.xls', 'sites/all/pages/start-a-business/wizard-results.xls', 'sites/all/pages/taxes-and-credits/wizard-results.xls', 'sites/all/pages/veterans/wizard-results.xls');
    // For each Swimlane-Page node (foreach wizard)
    foreach ($busaWizardResultExcels as $busaWizardResultExcel) {
        if (file_exists($busaWizardResultExcel)) {
            dsm($busaWizardResultExcel);
            $report = associateWizardTagsWithNodesInDrupalDatabase($busaWizardResultExcel, $returnSummaryOnly);
            $toReturn[$busaWizardResultExcel] = $report;
        }
    }
    // Return $toReturn, the return buffer
    return $toReturn;
}
コード例 #10
0
ファイル: bad.php プロジェクト: GitError404/favrskov.dk
/**
 * Debugging functions are discouraged.
 */
function test27()
{
    $var = array(1, 2, 3);
    dsm($var);
    dpm($var);
}
コード例 #11
0
        header('Content-Type: text/html');
        // Spit out the HTML retrieved by views_embed_view()
        print $viewHTML;
        // Terminate this PHP thread
        exit;
    }
}
?>

<div class="not-admin-only">
    <b>Sign in as a administrator to view usage and dev-notes.</b>
</div>

<div class="admin-only">
    <?php 
dsm('Note: This functionality is stored in the file: ' . __FILE__);
?>
    This script is used to get a rendered View's HTML and return it in an AJAX session
    <br/>
    Note that this page returns data from the views_embed_view() function.
    You can review the Drupal documentation for this function from:
    <a href="https://api.drupal.org/api/views/views.module/function/views_embed_view/7">
        views_embed_view()
    </a>
    <br/>
    Only when the $_GET[view] and $_GET[display] parameters are given will this script will return/execute its functionality
    Refer to <a href="/sys/ajax/views_embed_view?view=closes_resource_center_retheme&display=resource_centers&param1=38.925872&param2=-77.389841&param3=100">
    this example</a>.<br/>
    <br/>
    You can easily pull data from the above example with jQuery/AJAX by executing:<br/>
    <textarea style="width: 100%; min-height: 120px;">
コード例 #12
0
ファイル: php.php プロジェクト: badri/dot-emacs-dot-d
/**
 * Implements hook_form_alter().
 *
 * TODO (msmith): Add documentation.
 */
function php_form_alter(&$form, &$form_state, $form_id)
{
    dsm($form_id);
    return $form;
}
コード例 #13
0
 /**
  * Submits an API request through the iATS SOAP API Toolkit.
  *
  * @param $request
  *   The request object or array containing the parameters of the requested services.
  *
  * @return
  *   The response object from the API with properties pertinent to the requested
  *     services.
  */
 function request($credentials, $payment)
 {
     // Attempt the SOAP request and log the exception on failure.
     $method = $this->method['method'];
     if (empty($method)) {
         dsm($this->method);
         return FALSE;
     }
     // do some massaging of parameters for badly behaving iATS methods ($method is now the iATS method, not our internal key)
     switch ($method) {
         case 'CreateCreditCardCustomerCode':
         case 'UpdateCreditCardCustomerCode':
             $dummy_date = date('c', time());
             // now
             foreach (array('beginDate', 'endDate') as $key) {
                 if (empty($request_params[$key])) {
                     $request_params[$key] = $dummy_date;
                 }
             }
             break;
     }
     $message = $this->method['message'];
     $response = $this->method['response'];
     // always log requests to my own table, start by making a copy of the original request
     // note: this is different from the drupal watchdog logging that only happens if userframework logging and debug are enabled
     if (!empty($payment['invoiceNum'])) {
         $logged_request = $payment;
         // mask the cc numbers
         $this->mask($logged_request);
         // log: ip, invoiceNum, , cc, total, date
         // dpm($logged_request);
         $cc = isset($logged_request['creditCardNum']) ? $logged_request['creditCardNum'] : (isset($logged_request['ccNum']) ? $logged_request['ccNum'] : '');
         $ip = $logged_request['customerIPAddress'];
         $query_params = array(1 => array($logged_request['invoiceNum'], 'String'), 2 => array($ip, 'String'), 3 => array(substr($cc, -4), 'String'), 4 => array('', 'String'), 5 => array($logged_request['total'], 'String'));
         CRM_Core_DAO::executeQuery("INSERT INTO civicrm_iats_request_log\n        (invoice_num, ip, cc, customer_code, total, request_datetime) VALUES (%1, %2, %3, %4, %5, NOW())", $query_params);
         if (!$this->is_ipv4($ip)) {
             $payment['customerIPAddress'] = substr($ip, 0, 30);
         }
         // save the invoiceNum so I can log it for the response
         $this->invoiceNum = $logged_request['invoiceNum'];
     }
     // the agent user and password only get put in here so they don't end up in a log above
     try {
         /* until iATS fixes it's box verify, we need to have trace on to make the hack below work */
         $soapClient = new SoapClient($this->_wsdl_url, array('trace' => 1, 'soap_version' => SOAP_1_2));
         /* build the request manually as per the iATS docs */
         $xml = '<' . $message . ' xmlns="' . $this->_wsdl_url_ns . '">';
         $request = array_merge($this->request, (array) $credentials, (array) $payment);
         // Pass CiviCRM tag + version to iATS
         $request['comment'] = 'CiviCRM: ' . CRM_Utils_System::version() . ' + ' . 'iATS Extension: ' . $this->iats_extension_version();
         $tags = !empty($this->_tag_order) ? $this->_tag_order : array_keys($request);
         foreach ($tags as $k) {
             if (isset($request[$k])) {
                 $xml .= '<' . $k . '>' . $request[$k] . '</' . $k . '>';
             }
         }
         $xml .= '</' . $message . '>';
         if (!empty($this->options['log'])) {
             watchdog('civicrm_iatspayments_com', 'Method info: !method', array('!method' => $method), WATCHDOG_NOTICE);
             watchdog('civicrm_iatspayments_com', 'XML: !xml', array('!xml' => $xml), WATCHDOG_NOTICE);
         }
         $soapRequest = new SoapVar($xml, XSD_ANYXML);
         if (!empty($this->options['log'])) {
             watchdog('civicrm_iatspayments_com', 'Request !request', array('!request' => print_r($soapRequest, TRUE)), WATCHDOG_NOTICE);
         }
         $soapResponse = $soapClient->{$method}($soapRequest);
         if (!empty($this->options['log']) && !empty($this->options['debug'])) {
             $request_log = "\n HEADER:\n";
             $request_log .= $soapClient->__getLastRequestHeaders();
             $request_log .= "\n BODY:\n";
             $request_log .= $soapClient->__getLastRequest();
             $request_log .= "\n BODYEND:\n";
             watchdog('civicrm_iatspayments_com', 'Request: !request', array('!request' => '<pre>' . $request_log . '</pre>'), WATCHDOG_NOTICE);
             $response_log = "\n HEADER:\n";
             $response_log .= $soapClient->__getLastResponseHeaders();
             $response_log .= "\n BODY:\n";
             $response_log .= $soapClient->__getLastResponse();
             $response_log .= "\n BODYEND:\n";
             watchdog('civicrm_iatspayments_com', 'Response: !response', array('!response' => '<pre>' . $response_log . '</pre>'), WATCHDOG_NOTICE);
         }
     } catch (SoapFault $exception) {
         if (!empty($this->options['log'])) {
             watchdog('civicrm_iatspayments_com', 'SoapFault: !exception', array('!exception' => '<pre>' . print_r($exception, TRUE) . '</pre>'), WATCHDOG_ERROR);
             $response_log = "\n HEADER:\n";
             $response_log .= $soapClient->__getLastResponseHeaders();
             $response_log .= "\n BODY:\n";
             $response_log .= $soapClient->__getLastResponse();
             $response_log .= "\n BODYEND:\n";
             watchdog('civicrm_iatspayments_com', 'Raw Response: !response', array('!response' => '<pre>' . $response_log . '</pre>'), WATCHDOG_NOTICE);
         }
         return FALSE;
     }
     // Log the response if specified.
     if (!empty($this->options['log'])) {
         watchdog('civicrm_iatspayments_com', 'iATS SOAP response: !request', array('!request' => '<pre>' . print_r($soapResponse, TRUE) . '</pre>', WATCHDOG_DEBUG));
     }
     if (isset($soapResponse->{$response}->any)) {
         $xml_response = $soapResponse->{$response}->any;
         return new SimpleXMLElement($xml_response);
     } else {
         // deal with bad iats soap, this will only work if trace (debug) is on for now
         $hack = new stdClass();
         $hack->FILE = strip_tags($soapClient->__getLastResponse());
         return $hack;
     }
 }
コード例 #14
0
print $user_dat->field_fornavn['und'][0]['value'] . " " . $user_dat->field_efternavn['und'][0]['value'];
}



                            ?>
                               </div>

                               <?php print $content['mc1']; ?>
                         </span>

                         <span class="form_box right">
                         	    <label>PASSASJER</label>
                         	    <div class="input2boxrickshaw">
                         	    <?php
                                               	  dsm($node);

$nodepassager1 = node_load($node->field_tur_beboer['und'][0]['target_id']);
$nodepassager2 = node_load($node->field_tur_beboer['und'][1]['target_id']);
if(empty($nodepassager2))
{
print $nodepassager1->title;
}
else
{
print $nodepassager1->title;
print "<br />";
print $nodepassager2->title;
}
                          //	 print $node->field_tur_beboer(0)("1");
                        // 	 print $passagers->[1]['target_id'];
コード例 #15
0
ファイル: SaveLayout.php プロジェクト: kazunoko85/drupal8
 public function submitForm(array &$form, array &$form_state)
 {
     //$form_object = $this->getFormObject($form_state);
     //$form_object->submitForm($form, $form_state);
     dsm('Running my own custom ->submitForm');
 }
コード例 #16
0
<?php

dsm($order);
echo form_open('notification/update_order');
echo form_textarea('comment', $order['comments']);
echo form_label();
echo form_submit('submit', 'Save', 'class="btn btn-primary"');
コード例 #17
0
ファイル: theme-settings.php プロジェクト: sajt/bootstrap
function bootstrap_settings($saved_settings)
{
    $defaults = array('layout_front_display_page_title' => 1, 'layout_front_display_page_content' => 1, 'layout_front_offcanvas_sidebar' => 1, 'mobile_contact_btns_icons' => 1, 'layout_staff_directory_layout' => 'grid', 'mobile_breadcrumb_btn_text' => 'Where am I?', 'mobile_offcanvas_btn_text' => 'What else is in this section?');
    $settings = array_merge($defaults, $saved_settings);
    // Staff directory layout
    $staff_directory_layout = array('rows' => t('rows'), 'grid' => t('grid'));
    // Form processing
    if ($file = file_save_upload('bootstrap_touch_icon_default_upload', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $file->filename;
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $settings['bootstrap_touch_icon_default_path'] = $file->filepath;
        } else {
            dsm('Failed to upload the default touch icon.');
        }
    }
    if ($file = file_save_upload('bootstrap_touch_icon_ipad_upload', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $file->filename;
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $settings['bootstrap_touch_icon_ipad_path'] = $file->filepath;
        } else {
            dsm('Failed to upload the iPad touch icon.');
        }
    }
    if ($file = file_save_upload('bootstrap_touch_icon_iphone_r_upload', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $file->filename;
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $settings['bootstrap_touch_icon_iphone_r_path'] = $file->filepath;
        } else {
            dsm('Failed to upload the iPhone Retina touch icon.');
        }
    }
    if ($file = file_save_upload('bootstrap_touch_icon_ipad_r_upload', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $file->filename;
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $settings['bootstrap_touch_icon_ipad_r_path'] = $file->filepath;
        } else {
            dsm('Failed to upload the iPad Retina touch icon.');
        }
    }
    if ($file = file_save_upload('bootstrap_touch_icon_windows_metro_upload', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $file->filename;
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $settings['bootstrap_touch_icon_windows_metro_path'] = $file->filepath;
        } else {
            dsm('Failed to upload the iPad Retina touch icon.');
        }
    }
    if ($file = file_save_upload('mobile_logo_upload', array('file_validate_is_image' => array()))) {
        $parts = pathinfo($file->filename);
        $filename = $file->filename;
        if (file_copy($file, $filename, FILE_EXISTS_REPLACE)) {
            $settings['mobile_logo_path'] = $file->filepath;
        } else {
            dsm('Failed to upload the mobile logo.');
        }
    }
    // Mobile
    $form['mobile'] = array('#type' => 'fieldset', '#title' => t('Mobile'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Mobile header
    $form['mobile']['mobile_nav_bg'] = array('#type' => 'textfield', '#title' => t('Override header background color'), '#size' => 6, '#description' => t('The 6 digit hexidecimal color value. Do not include hash (#).'), '#default_value' => $settings['mobile_nav_bg']);
    // Mobile breadcrumb button text
    $form['mobile']['mobile_breadcrumb_btn_text'] = array('#type' => 'textfield', '#title' => t('Breadcumb toggle text'), '#description' => t('Change the text on the breadcrumb toggle button.'), '#default_value' => $settings['mobile_breadcrumb_btn_text']);
    // Mobile offcanvas toggle button text
    $form['mobile']['mobile_offcanvas_btn_text'] = array('#type' => 'textfield', '#title' => t('Sidebar toggle text'), '#description' => t('Change the text on the sidebar toggle button.'), '#default_value' => $settings['mobile_offcanvas_btn_text']);
    // Custom contact action buttons
    $form['mobile']['mobile_contact_btns'] = array('#type' => 'fieldset', '#title' => t('Mobile contact buttons'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mobile']['mobile_contact_btns']['mobile_contact_btns_icons'] = array('#type' => 'checkbox', '#title' => t('Display icons?'), '#default_value' => $settings['mobile_contact_btns_icons']);
    // Custom mobile logo
    $form['mobile']['mobile_logo'] = array('#type' => 'fieldset', '#title' => t('Mobile logo'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['mobile']['mobile_logo']['mobile_logo_markup'] = array('#type' => 'markup', '#value' => t('<p>Optional. Upload a logo to replace the default on small devices.</p>'));
    $form['mobile']['mobile_logo']['mobile_logo_use'] = array('#type' => 'checkbox', '#title' => t('Replace logo with mobile logo on small devices?'), '#default_value' => $settings['mobile_logo_use']);
    $form['mobile']['mobile_logo']['mobile_logo_path'] = array('#type' => 'textfield', '#title' => t('Path to logo'), '#value' => $settings['mobile_logo_path'], '#default_value' => '');
    $form['mobile']['mobile_logo']['mobile_logo_upload'] = array('#type' => 'file', '#title' => t('Upload image'));
    // If file exists then show image
    if (!empty($settings['mobile_logo_path'])) {
        $form['mobile']['mobile_logo']['mobile_logo_preview'] = array('#type' => 'markup', '#value' => !empty($settings['mobile_logo_path']) ? theme('image', $settings['mobile_logo_path']) : '');
    }
    /*
     * Form components
     */
    // Touch icons fieldset
    $form['touch_icons'] = array('#type' => 'fieldset', '#title' => t('Touch icons'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default touch icon fieldset
    $form['touch_icons']['default_touch_icon'] = array('#type' => 'fieldset', '#title' => t('Default icon'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    $form['touch_icons']['default_touch_icon']['bootstrap_touch_icon_default_description'] = array('#type' => 'markup', '#value' => t('The default touch icon used for older Apple and Android devices.<br />Size: 57x57px.'));
    // Use  apple touch icon
    $form['touch_icons']['default_touch_icon']['bootstrap_touch_icon_default_use'] = array('#type' => 'checkbox', '#title' => t('Use default  touch icon?'), '#default_value' => $settings['bootstrap_touch_icon_default_use']);
    // Default  touch icon path
    $form['touch_icons']['default_touch_icon']['bootstrap_touch_icon_default_path'] = array('#type' => 'textfield', '#title' => t('Path to touch icon'), '#value' => $settings['bootstrap_touch_icon_default_path'], '#default_value' => '');
    // Default touch icon file upload
    $form['touch_icons']['default_touch_icon']['bootstrap_touch_icon_default_upload'] = array('#type' => 'file', '#title' => t('Upload image'));
    // Default  touch icon preview
    // If file exists then show image
    if (!empty($settings['bootstrap_touch_icon_default_path'])) {
        $form['touch_icons']['default_touch_icon']['bootstrap_touch_icon_default_preview'] = array('#type' => 'markup', '#value' => !empty($settings['bootstrap_touch_icon_default_path']) ? theme('image', $settings['bootstrap_touch_icon_default_path']) : '');
    }
    // ipad touch icon fieldset
    $form['touch_icons']['ipad_touch_icon'] = array('#type' => 'fieldset', '#title' => t('iPad icon'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    // Use ipad touch icon
    $form['touch_icons']['ipad_touch_icon']['bootstrap_touch_icon_ipad_use'] = array('#type' => 'checkbox', '#title' => t('Use iPad touch icon?'), '#default_value' => $settings['bootstrap_touch_icon_ipad_use']);
    // ipad icon path
    $form['touch_icons']['ipad_touch_icon']['bootstrap_touch_icon_ipad_path'] = array('#type' => 'textfield', '#title' => t('Path to iPad touch icon'), '#value' => $settings['bootstrap_touch_icon_ipad_path'], '#default_value' => '');
    // ipad icon file upload
    $form['touch_icons']['ipad_touch_icon']['bootstrap_touch_icon_ipad_upload'] = array('#type' => 'file', '#title' => t('Upload image'));
    // ipad icon preview
    // If file exists then show image
    if (!empty($settings['bootstrap_touch_icon_ipad_path'])) {
        $form['touch_icons']['ipad_touch_icon']['bootstrap_apple_touch_icon_ipad_preview'] = array('#type' => 'markup', '#value' => !empty($settings['bootstrap_touch_icon_ipad_path']) ? theme('image', $settings['bootstrap_touch_icon_ipad_path']) : '');
    }
    // iPhone Retina touch icon fieldset
    $form['touch_icons']['iphone_r_touch_icon'] = array('#type' => 'fieldset', '#title' => t('iPhone Retina icon'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    // Use iPhone Retina touch icon
    $form['touch_icons']['iphone_r_touch_icon']['bootstrap_touch_icon_iphone_r_use'] = array('#type' => 'checkbox', '#title' => t('Use iPhone retina touch icon?'), '#default_value' => $settings['bootstrap_touch_icon_iphone_r_use']);
    // iPhone Retina icon path
    $form['touch_icons']['iphone_r_touch_icon']['bootstrap_touch_icon_iphone_r_path'] = array('#type' => 'textfield', '#title' => t('Path to iPhone Retina touch icon'), '#value' => $settings['bootstrap_touch_icon_iphone_r_path'], '#default_value' => '');
    // iPhone Retina icon file upload
    $form['touch_icons']['iphone_r_touch_icon']['bootstrap_touch_icon_iphone_r_upload'] = array('#type' => 'file', '#title' => t('Upload image'));
    // iPhone Retina icon preview
    // If file exists then show image
    if (!empty($settings['bootstrap_touch_icon_iphone_r_path'])) {
        $form['touch_icons']['iphone_r_touch_icon']['bootstrap_apple_touch_icon_iphone_r_preview'] = array('#type' => 'markup', '#value' => !empty($settings['bootstrap_touch_icon_iphone_r_path']) ? theme('image', $settings['bootstrap_touch_icon_iphone_r_path']) : '');
    }
    // iPad Retina touch icon fieldset
    $form['touch_icons']['ipad_r_touch_icon'] = array('#type' => 'fieldset', '#title' => t('iPad Retina icon'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    // Use iPad Retina touch icon
    $form['touch_icons']['ipad_r_touch_icon']['bootstrap_touch_icon_ipad_r_use'] = array('#type' => 'checkbox', '#title' => t('Use iPad retina touch icon?'), '#default_value' => $settings['bootstrap_touch_icon_ipad_r_use']);
    // iPad Retina icon path
    $form['touch_icons']['ipad_r_touch_icon']['bootstrap_touch_icon_ipad_r_path'] = array('#type' => 'textfield', '#title' => t('Path to iPad Retina touch icon'), '#value' => $settings['bootstrap_touch_icon_ipad_r_path'], '#default_value' => '');
    // iPad Retina icon file upload
    $form['touch_icons']['ipad_r_touch_icon']['bootstrap_touch_icon_ipad_r_upload'] = array('#type' => 'file', '#title' => t('Upload image'));
    // iPad Retina icon preview
    // If file exists then show image
    if (!empty($settings['bootstrap_touch_icon_ipad_r_path'])) {
        $form['touch_icons']['ipad_r_touch_icon']['bootstrap_apple_touch_icon_ipad_r_preview'] = array('#type' => 'markup', '#value' => !empty($settings['bootstrap_touch_icon_ipad_r_path']) ? theme('image', $settings['bootstrap_touch_icon_ipad_r_path']) : '');
    }
    // Windows metro touch icon fieldset
    $form['touch_icons']['windows_metro_touch_icon'] = array('#type' => 'fieldset', '#title' => t('Windows metro tile'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    // Use Windows metro touch icon
    $form['touch_icons']['windows_metro_touch_icon']['bootstrap_touch_icon_windows_metro_use'] = array('#type' => 'checkbox', '#title' => t('Use Windows metro touch icon?'), '#default_value' => $settings['bootstrap_touch_icon_windows_metro_use']);
    // Use Windows metro touch color
    $form['touch_icons']['windows_metro_touch_icon']['bootstrap_touch_icon_windows_metro_color'] = array('#type' => 'textfield', '#title' => t('Hex color value'), '#size' => 6, '#description' => t('The 6 digit hexidecimal color value. Do not include hash (#).'), '#default_value' => $settings['bootstrap_touch_icon_windows_metro_color']);
    // Windows metro icon path
    $form['touch_icons']['windows_metro_touch_icon']['bootstrap_touch_icon_windows_metro_path'] = array('#type' => 'textfield', '#title' => t('Path to Windows metro icon'), '#value' => $settings['bootstrap_touch_icon_windows_metro_path'], '#default_value' => '');
    // Windows metro icon file upload
    $form['touch_icons']['windows_metro_touch_icon']['bootstrap_touch_icon_windows_metro_upload'] = array('#type' => 'file', '#title' => t('Upload image'));
    // Windows metro icon preview
    // If file exists then show image
    $windows_metro_icon = '<div style="width:144px; height: 144px; padding: 20px 20px; background-color: #' . $settings['bootstrap_touch_icon_windows_metro_color'] . ';"><img src="/' . $settings['bootstrap_touch_icon_windows_metro_path'] . '"></div>';
    if (!empty($settings['bootstrap_touch_icon_windows_metro_path'])) {
        $form['touch_icons']['windows_metro_touch_icon']['bootstrap_apple_touch_icon_windows_metro_preview'] = array('#type' => 'markup', '#value' => $windows_metro_icon);
    }
    // Layout
    $form['layout'] = array('#type' => 'fieldset', '#title' => t('Layout'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Layout - Front
    $form['layout']['layout_front'] = array('#type' => 'fieldset', '#title' => t('Front'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['layout']['layout_front']['layout_front_display_page_title'] = array('#type' => 'checkbox', '#title' => t('Show page title?'), '#description' => t('Some designs dont require the page title to be visible. Uncheck if its not needed.'), '#default_value' => $settings['layout_front_display_page_title']);
    $form['layout']['layout_front']['layout_front_display_page_content'] = array('#type' => 'checkbox', '#title' => t('Show page content?'), '#description' => t('Some designs dont require the page content. Uncheck if its not needed.'), '#default_value' => $settings['layout_front_display_page_content']);
    $form['layout']['layout_front']['layout_front_offcanvas_sidebar'] = array('#type' => 'checkbox', '#title' => t('Stop off canvas sidebar?'), '#description' => t('By default, the left sidebar will hide off the screen on small devices. Check box to stop this on the front page.'), '#default_value' => $settings['layout_front_offcanvas_sidebar']);
    // Layout - Staff directory
    $form['layout']['layout_staff_directory'] = array('#type' => 'fieldset', '#title' => t('Staff directory'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['layout']['layout_staff_directory']['layout_staff_directory_layout'] = array('#type' => 'select', '#title' => t('Layout'), '#default_value' => $settings['layout_staff_directory_layout'], '#options' => $staff_directory_layout);
    return $form;
}
コード例 #18
0
 public function userAlbums($username)
 {
     $return = $this->api->getUserPlaylists($username);
     dsm($return);
 }
コード例 #19
0
 private function populate()
 {
     $json = $this->notation;
     $json_array = drupal_json_decode($json);
     dsm($json_array);
     //object_type
     if (isset($json_array['objectType']) && $json_array['objectType'] == 'SubStatement') {
         $this->object_type = 'SubStatement';
         if (isset($json_array['version'])) {
             unset($json_array['version']);
         }
         if (isset($json_array['id'])) {
             unset($json_array['id']);
         }
         if (isset($json_array['stored'])) {
             unset($json_array['version']);
         }
         if (isset($json_array['authority'])) {
             unset($json_array['version']);
         }
     } else {
         $this->object_type = 'Statement';
     }
     //version
     if (isset($json_array['version'])) {
         $this->version = $json_array['version'];
     } else {
         if ($this->object_type != 'SubStatement') {
             $this->version = '1.0.0';
         }
     }
     //id
     if (isset($json_array['id'])) {
         $this->statement_id = $json_array['id'];
     } else {
         // generate uuid for the statement
         if ($this->object_type != 'SubStatement' && $this->statement_id == '') {
             $this->statement_id = uuid_generate();
         }
     }
     //timestamp
     // need to do something about saving the datetime values tincan api expects into mysql....
     if (isset($json_array['timestamp'])) {
         $this->timestamp = $json_array['timestamp'];
     }
     // stored
     if (isset($json_array['stored'])) {
         $this->stored = $json_array['stored'];
     } else {
         if ($this->object_type != 'SubStatement') {
             $this->stored = date('c');
             //must be in iso 8601 format;
         }
     }
     // Actor
     if (isset($json_array['actor'])) {
         $this->tincan_actor = array();
         $this->populateActor($json_array['actor']);
     }
     // Verb
     if (isset($json_array['verb'])) {
         $this->tincan_verb = array();
         $this->populateVerb($json_array['verb']);
     }
     // Object
     if (isset($json_array['object'])) {
         $this->tincan_object = array();
         $this->populateObject($json_array['object']);
     }
     // Result
     if (isset($json_array['result'])) {
         $this->tincan_result = array();
         $this->populateResult($json_array['result']);
     }
     // Authority
     if (isset($json_array['authority'])) {
         $this->tincan_authority = array();
         $this->populateAuthority($json_array['authority']);
     } else {
         //figure out authorize default
         if ($this->object_type != 'SubStatement') {
         }
     }
     if (isset($json_array['context'])) {
         $this->tincan_context = array();
         $this->populateContext($json_array['context']);
     }
 }
コード例 #20
0
function dsm_post($die = false)
{
    $CI =& get_instance();
    dsm($CI->input->post(), $die, false);
}
  <h3><?php 
    print $title;
    ?>
</h3>
<?php 
}
// dsm($rows);
// dsm($view);
// Get all the flags for the user.
$flagged = flag_get_user_flags('node');
// dsm($flagged);
// Build a grid that we can use for our table.
foreach ($rows as $id => $row) {
    $results[$view->result[$id]->node_data_field_session_day_field_session_day_value][$view->result[$id]->node_data_field_session_room_field_session_time_value][$view->result[$id]->node_data_field_session_day_field_session_room_value] = array('content' => $row, 'nid' => $view->result[$id]->nid, 'id' => 'node-' . $view->result[$id]->nid);
}
dsm($results);
// Sorting so that time goes ASC.
ksort($results['saturday']);
ksort($results['sunday']);
// Gather the room cck field values for the table headers
$field_rooms = content_fields('field_session_room');
$allowed = content_allowed_values($field_rooms);
$saturday_header = array($allowed[1], $allowed[2], $allowed[3], $allowed[4], $allowed[5], $allowed[8]);
$sunday_header = array($allowed[2], $allowed[3], $allowed[4], $allowed[5], $allowed[8]);
// Add some js magic to catch a vote request and then update the td class
drupal_add_js("\$(document).ready(function() {\n    \$(window).bind('flagGlobalAfterLinkUpdate', function(e, data) {\n      var selector = '#node-' + data.contentId;\n      if (data.flagStatus == 'flagged') {\n        \$(selector).addClass('flagged').removeClass('not-flagged');\n      }\n      else {\n        \$(selector).addClass('not-flagged').removeClass('flagged');\n      }\n    });\n  });", 'inline');
// dsm($results);
?>

<?php 
if (user_access('manage schedule')) {
コード例 #22
0
        }
    </style>
</head>

<?php 
if (!empty($_GET['nid'])) {
    if (empty($_GET['tid'])) {
        print 'You forgot to supply a tid (Term ID)';
        return;
    }
    if (empty($_GET['operation'])) {
        print 'You forgot to supply an operation (set this value to either accept or reject)';
        return;
    }
    $targNode = node_load(intval($_GET['nid']));
    dsm($targNode);
    switch ($_GET['operation']) {
        case 'accept':
            // loop through the $targNode->field_pending_tags['und'] to find the target tid
            foreach ($targNode->field_pending_tags['und'] as $index => $val) {
                //dsm( $val );
                if (intval($val['tid']) === intval($_GET['tid'])) {
                    unset($targNode->field_pending_tags['und'][$index]);
                    // Foudn the tid, remove it
                    drupal_set_message('updated');
                    $field_tagged_terms_cnt = count($targNode->field_tagged_terms['und']);
                    $targNode->field_tagged_terms['und'][$field_tagged_terms_cnt]['tid'] = $val['tid'];
                }
            }
            node_save($targNode);
            // add this value to $targNode->field_tagged_terms['und']
コード例 #23
0
<?php

$slideshows = array();
$slideshows[] = array(array("left-title" => "Tour Headline 1A", "description" => "This message is stored in tour/.page.php, you can edit these emssages there. If desiered you can hilight features of this site on this page.", "slide-title" => "Slide 1A Title", "snippet" => "Slide 1A subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/1a.jpg"), array("left-title" => "Tour Headline 1B", "description" => "You can edit the images shown to present screen-shots of this site as desiered from the tourImgs directory in sites/all/themes/bizusa/images. If you edit these images and do not see the images updating within your browser, then you need to flush your browser cache.", "slide-title" => "Slide 1B Title", "snippet" => "Slide 1B subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/1b.jpg"), array("left-title" => "Tour Headline 1C", "description" => "If you have no need for a Tour page, then you will want to delete the tour directoy from sites/all/page, and then you remove the tour page from the footer/menu.", "slide-title" => "Slide 1C Title", "snippet" => "Slide 1C subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/1c.jpg"), array("left-title" => "Tour Headline 1D", "description" => "If you have no need for a Tour page, then you will want to delete the tour directoy from sites/all/page, and then you remove the tour page from the footer/menu.", "slide-title" => "Slide 1D Title", "snippet" => "Slide 1D subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/1d.jpg"));
$slideshows[] = array(array("left-title" => "Tour Headline 2A", "description" => "This message is stored in tour/.page.php, you can edit these emssages there. If desiered you can hilight features of this site on this page.", "slide-title" => "Slide 2A Title", "snippet" => "Slide 2A subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/2a.jpg"), array("left-title" => "Tour Headline 2B", "description" => "You can edit the images shown to present screen-shots of this site as desiered from the tourImgs directory in sites/all/themes/bizusa/images. If you edit these images and do not see the images updating within your browser, then you need to flush your browser cache.", "slide-title" => "Slide 2B Title", "snippet" => "Slide 2B subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/2b.jpg"), array("left-title" => "Tour Headline 2C", "description" => "If you have no need for a Tour page, then you will want to delete the tour directoy from sites/all/page, and then you remove the tour page from the footer/menu.", "slide-title" => "Slide 2C Title", "snippet" => "Slide 2C subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/2c.jpg"), array("left-title" => "Tour Headline 2D", "description" => "If you have no need for a Tour page, then you will want to delete the tour directoy from sites/all/page, and then you remove the tour page from the footer/menu.", "slide-title" => "Slide 2D Title", "snippet" => "Slide 2D subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/2d.jpg"));
$slideshows[] = array(array("left-title" => "Tour Headline 3A", "description" => "This message is stored in tour/.page.php, you can edit these emssages there. If desiered you can hilight features of this site on this page.", "slide-title" => "Slide 3A Title", "snippet" => "Slide 3A subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/3a.jpg"), array("left-title" => "Tour Headline 3B", "description" => "You can edit the images shown to present screen-shots of this site as desiered from the tourImgs directory in sites/all/themes/bizusa/images. If you edit these images and do not see the images updating within your browser, then you need to flush your browser cache.", "slide-title" => "Slide 3B Title", "snippet" => "Slide 3B subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/3b.jpg"), array("left-title" => "Tour Headline 3C", "description" => "If you have no need for a Tour page, then you will want to delete the tour directoy from sites/all/page, and then you remove the tour page from the footer/menu.", "slide-title" => "Slide 3C Title", "snippet" => "Slide 3C subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/3c.jpg"), array("left-title" => "Tour Headline 3D", "description" => "If you have no need for a Tour page, then you will want to delete the tour directoy from sites/all/page, and then you remove the tour page from the footer/menu.", "slide-title" => "Slide 3D Title", "snippet" => "Slide 3D subtitle", "slide-img-src" => "/sites/all/themes/bizusa/images/tourImgs/3d.jpg"));
/* Expose the php-variable tourSlides to a JavaScript variable */
$jsonSlideshows = json_encode($slideshows);
drupal_add_js("jsonSlideshows = " . $jsonSlideshows . ";", array('weight' => 100, 'type' => 'inline', 'group' => JS_THEME));
if (strpos(request_uri(), '-DEBUG-') !== false) {
    dsm(array('slideshows' => $slideshows, 'jsonSlideshows' => $jsonSlideshows));
}
?>
 <div class="busaalltours-mastercontainer-denied">
    This page is not available on your tablet or mobile size
    screens. <?php 
print l(t('Go Back Home'), '<front>');
?>
</div>
<div class="busaalltours-mastercontainer">
    <?php 
foreach ($slideshows as $slideshowIndex => $slideshow) {
    ?>
    <div class="busatour-mastercontainer busatour-mastercontainer-<?php 
    print $slideshowIndex;
    ?>
">

        <!-- LEFT AREA -->
        <div class="busatour-leftarea">
            <div class="busatour-leftarea-title">
コード例 #24
0
<?php

// $Id: views-view-row-node.tpl.php,v 1.3 2008/07/09 18:31:26 merlinofchaos Exp $
/**
 * @file views-view-row-node.tpl.php
 * Default simple view template to display a single node.
 *
 * Rather than doing anything with this particular template, it is more
 * efficient to use a variant of the node.tpl.php based upon the view,
 * which will be named node-view-VIEWNAME.tpl.php. This isn't actually
 * a views template, which is why it's not used here, but is a template
 * 'suggestion' given to the node template, and is used exactly
 * the same as any other variant of the node template file, such as
 * node-NODETYPE.tpl.php
 *
 * @ingroup views_templates
 */
dsm(get_defined_vars());
print $node;
if ($comments) {
    ?>
  <?php 
    print $comments;
}
コード例 #25
0
ファイル: block-og-0.tpl.php プロジェクト: nicwn/open_hippel
<?php

// $Id: block.tpl.php,v 1.1.2.1 2010/01/11 00:08:12 sociotech Exp $
dsm($block);
?>
<div id="block-<?php 
print $block->module . '-' . $block->delta;
?>
" class="block block-<?php 
print $block->module;
?>
 <?php 
print $block_zebra;
?>
 <?php 
print $position;
?>
 <?php 
print $skinr;
?>
">
  <div class="inner clearfix">
    <?php 
if (isset($edit_links)) {
    ?>
    <?php 
    print $edit_links;
    ?>
    <?php 
}
?>
コード例 #26
0
print $content['mc1'];
print $content['mc2'];
print $content['mc3'];
print $content['mc4'];
print $content['mc5'];
print $content['mc6'];
print $content['mc7'];
$nodeturid = $_GET["n"];
$node = node_load($nodeturid);
$startdatetur = str_replace("-", "/", format_date($node->field_tur_dato['und'][0]['value'], 'dateonly'));
$starttidtur = str_replace("-", "/", format_date($node->field_tur_dato['und'][0]['value'], 'timeonly'));
$startdatetur2 = str_replace("-", "/", format_date($node->field_tur_dato['und'][0]['value2'], 'dateonly'));
$starttidtur2 = str_replace("-", "/", format_date($node->field_tur_dato['und'][0]['value2'], 'timeonly'));
$nodepassager1 = node_load($node->field_tur_beboer['und'][0]['target_id']);
$nodelokation = node_load($node->field_testlokation['und'][0]['target_id']);
dsm($nodelokation);
$lokationnavn = $nodelokation->title;
if (empty($node->field_tur_beboer['und'][1]['target_id'])) {
    $passager = $nodepassager1->title;
} else {
    $nodepassager2 = node_load($node->field_tur_beboer['und'][1]['target_id']);
    $passager = $nodepassager1->title . " og " . $nodepassager2->title;
}
$another_user = user_load($node->field_tur_frivillig['und'][0]['uid']);
$rickshawname = $another_user->field_fornavn['und'][0]['value'];
?>
</div>

  <script type="text/javascript">
  
    (function ($) {
コード例 #27
0
 $address = '';
 if (!empty($relatedNode->field_event_state['und'][0]['value'])) {
     $address .= $relatedNode->field_event_city['und'][0]['value'];
 }
 if (!empty($relatedNode->field_event_state['und'][0]['value'])) {
     if ($address !== '') {
         $address .= ', ';
     }
     $address .= acronymToStateName($relatedNode->field_event_state['und'][0]['value']);
 }
 print $address;
 ?>
                         </div>
                         <div class="event-calendarlinks">
                             <?php 
 dsm($relatedNode);
 $nodeTitle = urlencode($relatedNode->title);
 $linkToNode = urlencode("http://business.usa.gov/node/{$relatedNode->nid}");
 $address = '';
 $address .= empty($relatedNode->field_event_address_1['und'][0]['value']) ? '' : $relatedNode->field_event_address_1['und'][0]['value'] . ', ';
 $address .= empty($relatedNode->field_event_address_2['und'][0]['value']) ? '' : $relatedNode->field_event_address_2['und'][0]['value'] . ', ';
 $address .= empty($relatedNode->field_event_city['und'][0]['value']) ? '' : $relatedNode->field_event_city['und'][0]['value'] . ', ';
 $address .= empty($relatedNode->field_event_state['und'][0]['value']) ? '' : $relatedNode->field_event_state['und'][0]['value'] . ', ';
 $address = urlencode($address);
 $snippet = strip_tags($relatedNode->field_event_detail_desc['und'][0]['value']);
 $snippet = trim(str_replace(array("\n", "\r", "\f", "\t"), "", $snippet));
 $snippet = urlencode(truncate_utf8($snippet, 250, true, true));
 $eventsStartDt = new DateTime($relatedNode->field_event_date['und'][0]['value'] . ' UTC');
 $eventsEndDt = new DateTime($relatedNode->field_event_date['und'][1]['value'] . ' UTC');
 $gDates = $eventsStartDt->format("Ymd\\This") . 'Z/' . $eventsStartDt->format("Ymd\\This") . 'Z';
 $yDateStart = $eventsStartDt->format("Ymd\\This");
コード例 #28
0
    ?>
 </a> 
            </li>
        <?php 
}
?>

        <!--  PDF Links  -->
        <?php 
if (count($node->field_tradelead_mul_url['und']) > 0) {
    ?>
            <li class="list-group-item field-pdf">
                <label>PDF Links : </label>
                <?php 
    $links = $node->field_tradelead_mul_url['und'];
    dsm($links);
    foreach ($links as $link) {
        ?>
                     <a href="<?php 
        print $link['value'];
        ?>
" target="_blank"> <?php 
        print $link['value'];
        ?>
 </a>
                 <?php 
    }
    ?>
            </li>
        <?php 
}
コード例 #29
0
* - $is_admin: Flags true when the current user is an administrator.
*
* Field variables: for each field instance attached to the node a corresponding
* variable is defined; for example, $node->body becomes $body. When needing to
* access a field's raw values, developers/themers are strongly encouraged to
* use these variables. Otherwise they will have to explicitly specify the
* desired field language; for example, $node->body['en'], thus overriding any
* language negotiation rule that was previously applied.
*
* @see template_preprocess()
* @see template_preprocess_node()
* @see template_process()
*
* @ingroup themeable
*/
dsm($content['field_excelpoint_ongoing_events']['#items'][0]['value']);
?>

<div id="node-<?php 
print $node->nid;
?>
" style="margin-top:30px;" class="<?php 
print $classes;
?>
 clearfix post large" <?php 
print $attributes;
?>
>
    <div class="post-img media">
      <div class='mediaholder'>
        <?php 
コード例 #30
0
 private function populate()
 {
     $json = $this->notation;
     $json_array = drupal_json_decode($json);
     dsm($json_array);
     // Object Type
     if (isset($json_array['objectType'])) {
         if ($json_array['objectType'] == 'Activity') {
         } else {
             // some kind of validation error
         }
     } else {
         $this->object_type = 'Activity';
     }
     // activity_id
     if (isset($json_array['id'])) {
         $this->activity_id = $json_array['id'];
     }
     // Definition
     if (isset($json_array['definition'])) {
         // Name
         if (isset($json_array['definition']['name'])) {
             // full name language map as json
             $this->name_json = drupal_json_encode($json_array['definition']['name']);
             // US English name
             if (isset($json_array['definition']['name']['en-US'])) {
                 $this->name_en_us = $json_array['definition']['name']['en-US'];
             }
         }
         // Description
         if (isset($json_array['definition']['description'])) {
             // full description language map as json
             $this->description_json = drupal_json_encode($json_array['definition']['description']);
             // US English description
             if (isset($json_array['definition']['description']['en-US'])) {
                 $this->description_en_us = $json_array['definition']['description']['en-US'];
             }
         }
         // type
         if (isset($json_array['definition']['type'])) {
             $this->type = $json_array['definition']['type'];
         }
         // more_info
         if (isset($json_array['definition']['moreInfo'])) {
             $this->more_info = $json_array['definition']['moreInfo'];
         }
         // extensions
         if (isset($json_array['definition']['extensions'])) {
             $this->type = drupal_json_encode($json_array['definition']['extensions']);
         }
         //interaction_type
         if (isset($json_array['definition']['interactionType'])) {
             $this->interaction_type = $json_array['definition']['interactionType'];
         }
         // correct_responses_pattern
         if (isset($json_array['definition']['correctResponsesPattern'])) {
             $this->correct_responses_pattern = drupal_json_encode($json_array['definition']['correctResponsesPattern']);
         }
         //Next the interaction fields
         $this->interaction_components_json = '';
         $intact_type = array('choices', 'scale', 'source', 'steps', 'target');
         foreach ($intact_type as $type) {
             if (isset($json_array['definition'][$type]) && is_array($json_array['definition'][$type])) {
                 if (!isset($json_array['definition'][$type][0])) {
                     $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][0]['json'] = drupal_json_encode($json_array['definition'][$type]);
                     $this->interaction_components_json .= ' ' . drupal_json_encode($item) . ' ';
                     if (isset($json_array['definition'][$type]['id'])) {
                         $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][0]['id'] = $json_array['definition'][$type]['id'];
                     }
                     if (isset($json_array['definition'][$type]['description'])) {
                         $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][0]['description'] = drupal_json_encode($json_array['definition'][$type]['description']);
                     }
                     if (isset($json_array['definition'][$type]['description']['en-US'])) {
                         $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][0]['description_en_us'] = $json_array['definition'][$type]['description']['en-US'];
                     }
                 } else {
                     $count = 0;
                 }
                 foreach ($json_array['definition'][$type] as $key => $item) {
                     $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][$count]['json'] = drupal_json_encode($item);
                     $this->interaction_components_json .= ' ' . drupal_json_encode($item) . ' ';
                     if (isset($item['id'])) {
                         $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][$count]['id'] = $item['id'];
                     }
                     if (isset($item['description'])) {
                         $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][$count]['description'] = drupal_json_encode($item['description']);
                     }
                     if (isset($item['description']['en-US'])) {
                         $this->{'tincan_interaction_com_' . $type}[LANGUAGE_NONE][$count]['description_en_us'] = $item['description']['en-US'];
                     }
                     $count += 1;
                 }
                 //end else
             }
             //end if isset(type)
         }
         // end foreach type
     }
     //end if isset(definition)
 }