예제 #1
0
 protected function _setData()
 {
     global $lC_Database, $lC_Language;
     if (!$this->enabled) {
         $this->_data = '';
     } else {
         $this->_data = '<div class="four-columns six-columns-tablet twelve-columns-mobile clear-both">' . '  <h2 class="relative thin">' . $this->_title . '</h2>' . '  <ul class="list spaced">';
         $counter = 0;
         foreach (lc_toObjectInfo(lC_ErrorLog_Admin::getAll())->get('entries') as $log) {
             $counter++;
             $this->_data .= '    <li>' . '      <span class="list-link icon-warning icon-red" title="' . $lC_Language->get('orders') . '">' . '        <strong>' . lc_output_string_protected($log['date']) . '</strong> ' . lc_output_string_protected(substr($log['message'], 0, 20)) . '      </span>' . '    </li>';
             if ($counter == 6) {
                 break;
             }
         }
         $this->_data .= '  </ul>' . '</div>';
     }
 }
예제 #2
0
 public static function updateRates($service)
 {
     global $lC_Database;
     $result = array();
     $updated_string = '';
     $not_updated_string = '';
     foreach (lc_toObjectInfo(self::getAll(-1))->get('entries') as $currency) {
         $rate = call_user_func('quote_' . $service . '_currency', $currency['code']);
         if (!empty($rate)) {
             $Qupdate = $lC_Database->query('update :table_currencies set value = :value, last_updated = now() where currencies_id = :currencies_id');
             $Qupdate->bindTable(':table_currencies', TABLE_CURRENCIES);
             $Qupdate->bindValue(':value', $rate);
             $Qupdate->bindInt(':currencies_id', $currency['currencies_id']);
             $Qupdate->setLogging($_SESSION['module'], $currency['currencies_id']);
             $Qupdate->execute();
             $updated_string .= $currency['title'] . ' (' . $currency['code'] . '), ';
         } else {
             $not_updated_string .= $currency['title'] . ' (' . $currency['code'] . '), ';
         }
     }
     if (!empty($updated_string)) {
         $updated_string = substr($updated_string, 0, -2);
     }
     if (!empty($not_updated_string)) {
         $not_updated_string = substr($not_updated_string, 0, -2);
     }
     $result['updatedString'] = $updated_string;
     $result['notUpdatedString'] = $not_updated_string;
     lC_Cache::clear('currencies');
     return $result;
 }
예제 #3
0
 public static function drawMenu()
 {
     foreach (lc_toObjectInfo(lC_Configuration_Admin::getAllGroups())->get('entries') as $group) {
         $menu .= '<li class="message-menu" id="cfgGroup' . (int) $group['configuration_group_id'] . '">' . '  <span class="message-status" style="padding-top:14px;">' . '     <a href="javascript:void(0);" onclick="showGroup(\'' . (int) $group['configuration_group_id'] . '\', \'' . lc_output_string_protected($group['configuration_group_title']) . '\');" class="new-message" title=""></a>' . '   </span>' . '   <a id="cfgLink' . (int) $group['configuration_group_id'] . '" href="javascript:void(0);" onclick="showGroup(\'' . (int) $group['configuration_group_id'] . '\', \'' . str_replace("/", "-", lc_output_string_protected($group['configuration_group_title'])) . '\');">' . '     <br><strong>' . lc_output_string_protected($group['configuration_group_title']) . '</strong>' . '   </a>' . ' </li>';
     }
     return $menu;
 }
예제 #4
0
 public static function export($id, $groups, $include_language_data = true)
 {
     global $lC_Database;
     $language = self::get($id);
     $export_array = array();
     if ($include_language_data === true) {
         $export_array['language']['data'] = array('title-CDATA' => $language['name'], 'code-CDATA' => $language['code'], 'locale-CDATA' => $language['locale'], 'character_set-CDATA' => $language['charset'], 'text_direction-CDATA' => $language['text_direction'], 'date_format_short-CDATA' => $language['date_format_short'], 'date_format_long-CDATA' => $language['date_format_long'], 'time_format-CDATA' => $language['time_format'], 'default_currency-CDATA' => lC_Currencies_Admin::getData($language['currencies_id'], 'code'), 'numerical_decimal_separator-CDATA' => $language['numeric_separator_decimal'], 'numerical_thousands_separator-CDATA' => $language['numeric_separator_thousands']);
         if ($language['parent_id'] > 0) {
             $export_array['language']['data']['parent_language_code'] = lC_Languages_Admin::get($language['parent_id'], 'code');
         }
     }
     foreach (lc_toObjectInfo(self::getDefinitions($id, $groups))->get('entries') as $def) {
         $export_array['language']['definitions']['definition'][] = array('key' => $def['definition_key'], 'value-CDATA' => $def['definition_value'], 'group' => $def['content_group']);
     }
     $lC_XML = new lC_XML($export_array, $language['charset']);
     $xml = $lC_XML->toXML();
     header('Content-disposition: attachment; filename=' . $language['code'] . '.xml');
     header('Content-Type: application/force-download');
     header('Content-Transfer-Encoding: binary');
     header('Content-Length: ' . strlen($xml));
     header('Pragma: no-cache');
     header('Expires: 0');
     echo $xml;
     exit;
 }