当前位置: 首页>>代码示例>>PHP>>正文


PHP DSC::load方法代码示例

本文整理汇总了PHP中DSC::load方法的典型用法代码示例。如果您正苦于以下问题:PHP DSC::load方法的具体用法?PHP DSC::load怎么用?PHP DSC::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DSC的用法示例。


在下文中一共展示了DSC::load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayWithLeftMenu

 /**
  * Displays a layout file with room for a left menu bar
  * @param $tpl
  * @return unknown_type
  */
 public function displayWithLeftMenu($tpl = null, $menuname)
 {
     // TODO This is an ugly, quick hack - fix it
     echo "<table width='100%'>";
     echo "<tr>";
     echo "<td style='width: 180px; padding-right: 5px; vertical-align: top;' >";
     DSC::load('DSCMenu', 'library.menu');
     if ($menu = DSCMenu::getInstance($menuname)) {
         $menu->display('leftmenu', $menu);
     }
     $modules = JModuleHelper::getModules($this->_name . "_left");
     $document = JFactory::getDocument();
     $renderer = $document->loadRenderer('module');
     $attribs = array();
     $attribs['style'] = 'xhtml';
     foreach ($modules as $mod) {
         echo $renderer->render($mod, $attribs);
     }
     echo "</td>";
     echo "<td style='vertical-align: top;' >";
     parent::display($tpl);
     echo "</td>";
     echo "</tr>";
     echo "</table>";
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:30,代码来源:admin.php

示例2: _

 /**
  * Format and convert a number according to currency rules
  *
  * @param unknown_type $amount
  * @param unknown_type $currency
  * @return unknown_type
  */
 public static function _($amount, $currency = '', $options = '')
 {
     // default to whatever is in config
     $config = DSC::getApp();
     $options = (array) $options;
     $default_currencyid = $config->get('default_currencyid', '1');
     $num_decimals = isset($options['num_decimals']) ? $options['num_decimals'] : $config->get('currency_num_decimals', '2');
     $thousands = isset($options['thousands']) ? $options['thousands'] : $config->get('currency_thousands', ',');
     $decimal = isset($options['decimal']) ? $options['decimal'] : $config->get('currency_decimal', '.');
     $pre = isset($options['pre']) ? $options['pre'] : $config->get('currency_symbol_pre', '$');
     $post = isset($options['post']) ? $options['post'] : $config->get('currency_symbol_post', '');
     // Now check the session variable to see if there is a currency setting there
     $session_currency = DSCHelper::getSessionVariable('currency_id', 0);
     if ($session_currency) {
         // Let the code below deal with currency loading
         $currency = $session_currency;
     }
     // if currency is an object, use it's properties
     if (is_object($currency)) {
         $table = $currency;
         $num_decimals = $table->currency_decimals;
         $thousands = $table->thousands_separator;
         $decimal = $table->decimal_separator;
         $pre = $table->symbol_left;
         $post = $table->symbol_right;
         if ($default_currencyid != $table->currency_id) {
             $convertTo = $table->currency_code;
         }
     } elseif (!empty($currency) && is_numeric($currency)) {
         // TODO if currency is an integer, load the object for its id
         JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_sample' . DS . 'tables');
         $table = JTable::getInstance('Currencies', 'DSCTable');
         $table->load((int) $currency);
         if (!empty($table->currency_id)) {
             $num_decimals = $table->currency_decimals;
             $thousands = $table->thousands_separator;
             $decimal = $table->decimal_separator;
             $pre = $table->symbol_left;
             $post = $table->symbol_right;
             if ($default_currencyid != $currency) {
                 $convertTo = $table->currency_code;
             }
         }
     } elseif (!empty($currency)) {
         // TODO if currency is a string (currency_code) load the object for its code
         JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_sample' . DS . 'tables');
         $table = JTable::getInstance('Currencies', 'DSCTable');
         $keynames = array();
         $keynames['currency_code'] = (string) $currency;
         $table->load($keynames);
         if (!empty($table->currency_id)) {
             $num_decimals = $table->currency_decimals;
             $thousands = $table->thousands_separator;
             $decimal = $table->decimal_separator;
             $pre = $table->symbol_left;
             $post = $table->symbol_right;
             if ($default_currencyid != $table->currency_id) {
                 $convertTo = $table->currency_code;
             }
         }
     }
     // if the currency code we're using is diff from the store-wide currency, then we need to convert the amount
     if (!empty($convertTo)) {
         JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_sample' . DS . 'tables');
         $table = JTable::getInstance('Currencies', 'DSCTable');
         $table->load((int) $default_currencyid);
         DSC::load('DSCHelperCurrency', 'helpers.currency');
         $amount = DSCHelperCurrency::convert($table->currency_code, $convertTo, $amount);
     }
     $return = $pre . number_format($amount, $num_decimals, $decimal, $thousands) . $post;
     return $return;
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:79,代码来源:currency.php

示例3: load

 /**
  * Method to intelligently load class files in the framework
  *
  * @param string $classname   The class name
  * @param string $filepath    The filepath ( dot notation )
  * @param array  $options
  * @return boolean
  */
 public static function load($classname, $filepath = 'controller', $options = array('site' => 'admin', 'type' => 'components', 'ext' => 'com_mysite'))
 {
     return parent::load($classname, $filepath, $options);
 }
开发者ID:beingsane,项目名称:mysite,代码行数:12,代码来源:defines.php

示例4:

 *   - added JPEG compression quality setting. Thanks Vad</li>
 *  <li><b>v 0.14</b> 14/03/2005<br>
 *   - reworked the class file to allow parsing with phpDocumentor</li>
 *  <li><b>v 0.13</b> 07/03/2005<br>
 *   - fixed a bug with {@link image_ratio}. Thanks Justin.<br>
 *   - added {@link image_ratio_no_zoom_in} and {@link image_ratio_no_zoom_out} </li>
 *  <li><b>v 0.12</b> 21/01/2005<br>
 *   - added {@link image_ratio} to resize within max values, keeping image ratio</li>
 *  <li><b>v 0.11</b> 22/08/2003<br>
 *   - update for GD2 (changed imageresized() into imagecopyresampled() and imagecreate() into imagecreatetruecolor())</li>
 * </ul>
 *
 * @package   cmf
 * @subpackage external
 */
DSC::load('DSCImage', 'library.image');
class DSCUpload extends DSCImage
{
    /**
     * Class version
     *
     * @access public
     * @var string
     */
    var $version;
    /**
     * Uploaded file name
     *
     * @access public
     * @var string
     */
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:upload.php

示例5: getEmailContent

 /**
  * Returns
  *
  * @param object
  * @param mixed Boolean
  * @param mixed Boolean
  * @return array
  */
 private function getEmailContent($data, $type = 'order')
 {
     $mainframe = JFactory::getApplication();
     $type = strtolower($type);
     $lang = JFactory::getLanguage();
     $lang->load('com_sample', JPATH_ADMINISTRATOR);
     $return = new stdClass();
     $return->body = '';
     $return->subject = '';
     // get config settings
     $config = DSCConfig::getInstance();
     $sitename = $config->get('sitename', $mainframe->getCfg('sitename'));
     $siteurl = $config->get('siteurl', JURI::root());
     // get the placeholders array here so the switch statement can add to it
     $placeholders = $this->getPlaceholderDefaults();
     switch ($type) {
         case "subscription_expiring":
             $return->subject = JText::_('EMAIL_EXPIRING_SUBSCRIPTION_SUBJECT');
             $return->body = JText::_('EMAIL_EXPIRING_SUBSCRIPTION_BODY');
             if ($this->use_html) {
                 $return->body = nl2br($return->body);
             }
             $placeholders['user.name'] = $data->user_name;
             $placeholders['product.name'] = $data->product_name;
             break;
         case "subscription_expired":
             $return->subject = JText::_('EMAIL_EXPIRED_SUBSCRIPTION_SUBJECT');
             $return->body = JText::_('EMAIL_EXPIRED_SUBSCRIPTION_BODY');
             if ($this->use_html) {
                 $return->body = nl2br($return->body);
             }
             $placeholders['user.name'] = $data->user_name;
             $placeholders['product.name'] = $data->product_name;
             break;
         case "subscription_new":
         case "new_subscription":
         case "subscription":
             $user = JFactory::getUser($data->user_id);
             $link = JURI::root() . "index.php?option=com_sample&view=orders&task=view&id=" . $data->order_id;
             $link = JRoute::_($link, false);
             if (count($data->history) == 1) {
                 // new order
                 $return->subject = sprintf(JText::_('EMAIL_NEW_ORDER_SUBJECT'), $data->order_id);
                 // set the email body
                 $text = JText::_('EMAIL_DEAR') . " " . $user->name . ",\n\n";
                 $text .= JText::_("EMAIL_THANKS_NEW_SUBSCRIPTION") . "\n\n";
                 $text .= JText::_("EMAIL_CHECK") . " " . $link . "\n\n";
                 $text .= JText::_("EMAIL_RECEIPT_FOLLOWS") . "\n\n";
                 if ($this->use_html) {
                     $text = nl2br($text);
                 }
                 // get the order body
                 DSC::load('DSCHelperOrder', 'helpers.order');
                 $text .= DSCHelperOrder::getOrderHtmlForEmail($data->order_id);
             } else {
                 // Status Change
                 $return->subject = JText::_('EMAIL_SUBSCRIPTION_STATUS_CHANGE');
                 $last_history = count($data->history) - 1;
                 $text = JText::_('EMAIL_DEAR') . " " . $user->name . ",\n\n";
                 $text .= sprintf(JText::_("EMAIL_ORDER_UPDATED"), $data->order_id);
                 if (!empty($data->history[$last_history]->comments)) {
                     $text .= sprintf(JText::_("EMAIL_ADDITIONAL_COMMENTS"), $data->history[$last_history]->comments);
                 }
                 $text .= JText::_("EMAIL_CHECK") . " " . $link;
                 if ($this->use_html) {
                     $text = nl2br($text);
                 }
             }
             $return->body = $text;
             $placeholders['user.name'] = $user->get('name');
             break;
         case "new_order":
         case "order":
         default:
             //$user = JUser::getInstance($data->user_id);
             $user = JFactory::getUser($data->user_id);
             $link = JURI::root() . "index.php?option=com_sample&view=orders&task=view&id=" . $data->order_id;
             $link = JRoute::_($link, false);
             if ($type == 'new_order') {
                 // new order
                 $return->subject = sprintf(JText::_('EMAIL_NEW_ORDER_SUBJECT'), $data->order_id);
                 // set the email body
                 $text = JText::_('EMAIL_DEAR') . " " . $user->name . ",\n\n";
                 $text .= JText::_("EMAIL_THANKS_NEW_ORDER") . "\n\n";
                 $text .= JText::_("EMAIL_CHECK") . " " . $link . "\n\n";
                 $text .= JText::_("EMAIL_RECEIPT_FOLLOWS") . "\n\n";
                 if ($this->use_html) {
                     $text = nl2br($text);
                 }
                 // get the order body
                 DSC::load('DSCHelperOrder', 'helpers.order');
                 $text .= DSCHelperOrder::getOrderHtmlForEmail($data->order_id);
//.........这里部分代码省略.........
开发者ID:joomlacorner,项目名称:citruscart,代码行数:101,代码来源:email.php


注:本文中的DSC::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。