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


PHP DSC类代码示例

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


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

示例1: popup

 /**
  * Displays a url in a lightbox
  *
  * @param $url
  * @param $text
  * @param array options(
  * 				'width',
  *				'height',
  * 				'top',
  * 				'left',
  * 				'class',
  * 				'update',
  * 				'img'
  * 				)
  * @return popup html
  */
 public static function popup($url, $text, $options = array())
 {
     $html = "";
     if (!empty($options['update'])) {
         JHTML::_('behavior.modal', 'a.modal', array('onClose' => '\\function(){Dsc.update();}'));
     } else {
         JHTML::_('behavior.modal');
     }
     // set the $handler_string based on the user's browser
     $handler_string = "{handler:'iframe',size:{x: window.innerWidth-80, y: window.innerHeight-80}, onShow:\$('sbox-window').setStyles({'padding': 0})}";
     $browser = DSC::getClass('DSCBrowser', 'library.browser');
     if ($browser->getBrowser() == DSCBrowser::BROWSER_IE) {
         // if IE, use
         $handler_string = "{handler:'iframe',size:{x:window.getSize().scrollSize.x-80, y: window.getSize().size.y-80}, onShow:\$('sbox-window').setStyles({'padding': 0})}";
     }
     $handler = !empty($options['img']) ? "{handler:'image'}" : $handler_string;
     if (!empty($options['width'])) {
         if (empty($options['height'])) {
             $options['height'] = 480;
         }
         $handler = "{handler: 'iframe', size: {x: " . $options['width'] . ", y: " . $options['height'] . "}}";
     }
     $id = !empty($options['id']) ? $options['id'] : '';
     $class = !empty($options['class']) ? $options['class'] : '';
     $linkclass = !empty($options['linkclass']) ? $options['linkclass'] : '';
     $linkclass = $linkclass . ' modal';
     $html = "<a class=\"" . $linkclass . "\" href=\"{$url}\" rel=\"{$handler}\" >\n";
     $html .= "<span class=\"" . $class . "\" id=\"" . $id . "\" >\n";
     $html .= "{$text}\n";
     $html .= "</span>\n";
     $html .= "</a>\n";
     return $html;
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:49,代码来源:url.php

示例2: footer

 /**
  * Displays the footer
  *
  * @return unknown_type
  */
 function footer()
 {
     // show a generous linkback, TIA
     $app = DSC::getApp();
     $input = JFactory::getApplication()->input;
     $show_linkback = $app->get('show_linkback', '1');
     $name = $app->getName();
     $model_name = $name . "ModelDashboard";
     $app->load($model_name, "models.dashboard");
     $model = new $model_name();
     $format = $input->getString('format');
     if ($show_linkback == '1' && $format != 'raw') {
         $view = $this->getView('dashboard', 'html');
         $view->hidemenu = true;
         $view->setTask('footer');
         $view->setModel($model, true);
         $view->setLayout('footer');
         $view->assign('style', '');
         $view->display();
     } elseif ($format != 'raw') {
         $view = $this->getView('dashboard', 'html');
         $view->hidemenu = true;
         $view->setTask('footer');
         $view->setModel($model, true);
         $view->setLayout('footer');
         $view->assign('style', 'style="display: none;"');
         $view->display();
     }
     return;
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:35,代码来源:site.php

示例3: getItems

 /**
  *
  */
 public static function getItems($option = '')
 {
     static $items;
     if (empty($option)) {
         $com = DSC::getApp();
         $option = 'com_' . $com->getName();
     }
     $app = JApplication::getInstance('site');
     $menus = $app->getMenu();
     if (empty($menus)) {
         return array();
     }
     if (empty($items)) {
         $items = array();
     }
     if (empty($items[$option])) {
         $component = JComponentHelper::getComponent($option);
         foreach ($menus->getItems('component', $option) as $item) {
             if (!is_object($item)) {
                 continue;
             }
             if ($item->component_id == $component->id || $item->componentid == $component->id || !empty($item->query['option']) && $item->query['option'] == $option) {
                 $items[$option][] = $item;
             }
         }
     }
     if (empty($items[$option])) {
         return array();
     }
     return $items[$option];
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:34,代码来源:route.php

示例4: 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

示例5: __construct

 function __construct($config = array())
 {
     $input = JFactory::getApplication()->input;
     $app = DSC::getApp();
     $this->_option = !empty($app) ? 'com_' . $app->getName() : $input->get('option');
     parent::__construct($config);
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:7,代码来源:view.php

示例6: display

 /**
  * Displays a layout file
  *
  * @param unknown_type $tpl
  * @return unknown_type
  */
 function display($tpl = null)
 {
     //including core JS because it needs to be included in modals and since we have so many including here keeps that from failing.
     JHTML::_('behavior.modal');
     JHTML::_('script', 'core.js', 'media/system/js/');
     DSC::loadBootstrap();
     DSC::loadJQuery('latest', true, 'tiendaJQ');
     JHTML::_('stylesheet', 'common.css', 'media/dioscouri/css/');
     parent::display($tpl);
 }
开发者ID:annggeel,项目名称:tienda,代码行数:16,代码来源:_base.php

示例7: display

 /**
  * Displays a layout file
  *
  * @param unknown_type $tpl
  * @return unknown_type
  */
 function display($tpl = null)
 {
     $doc = JFactory::getDocument();
     //including core JS because it needs to be included in modals and since we have so many including here keeps that from failing.
     JHTML::_('behavior.modal');
     JHtml::_('script', 'media/system/js/core.js', false, false);
     JHtml::_('script', 'media/citruscart/js/citruscart.js', false, false);
     //DSC::loadBootstrap();
     DSC::loadJQuery('latest', true, 'citruscartJQ');
     JHtml::_('stylesheet', 'media/citruscart/css/common.css');
     parent::display($tpl);
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:18,代码来源:_base.php

示例8: enable

    public static function enable($enable, $i, $prefix = '', $imgY = 'tick.png', $imgX = 'publish_x.png')
    {
        $img = $enable ? $imgY : $imgX;
        $task = $enable ? 'disable' : 'enable';
        $alt = $enable ? JText::_('Enabled') : JText::_('Disabled');
        $action = $enable ? JText::_('Disable Item') : JText::_('Enable Item');
        $href = '
		<a href="javascript:void(0);" onclick="return Dsc.listItemTask(\'cb' . $i . '\',\'' . $prefix . $task . '\')" title="' . $action . '">
		<img src="' . DSC::getURL('images') . $img . '" border="0" alt="' . $alt . '" />
		</a>';
        return $href;
    }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:12,代码来源:grid.php

示例9: display

 /**
  * First displays the submenu, then displays the output
  * but only if a valid _doTask is set in the view object
  *
  * @param $tpl
  * @return unknown_type
  */
 function display($tpl = null, $perform = true)
 {
     // these need to load before jquery to prevent joomla from crying
     JHTML::_('behavior.modal');
     JHTML::_('script', 'core.js', 'media/system/js/');
     DSC::loadJQuery('latest', true, 'tiendaJQ');
     if ($this->defines->get('use_bootstrap', '0')) {
         DSC::loadBootstrap();
     }
     JHTML::_('stylesheet', 'common.css', 'media/dioscouri/css/');
     if ($this->defines->get('include_site_css', '0')) {
         JHTML::_('stylesheet', 'tienda.css', 'media/com_tienda/css/');
     }
     parent::display($tpl);
 }
开发者ID:annggeel,项目名称:tienda,代码行数:22,代码来源:_base.php

示例10: display

 /**
  * First displays the submenu, then displays the output
  * but only if a valid _doTask is set in the view object
  *
  * @param $tpl
  * @return unknown_type
  */
 public function display($tpl = null)
 {
     // display() will return null if 'doTask' is not set by the controller
     // This prevents unauthorized access by bypassing the controllers
     if (empty($this->_doTask)) {
         return null;
     }
     $this->getLayoutVars($tpl);
     if (!JRequest::getInt('hidemainmenu') && empty($this->hidemenu)) {
         $this->displaySubmenu();
     }
     $app = DSC::getApp();
     $config = $app::getInstance();
     if ($config->get('include_site_css', '1')) {
         JHTML::_('stylesheet', 'site.css', 'media/' . $this->_option . '/css/');
     }
     parent::display($tpl);
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:25,代码来源:site.php

示例11: DSCHelperImage

 /**
  * Protected! Use the getInstance
  */
 protected function DSCHelperImage()
 {
     // Parent Helper Construction
     parent::__construct();
     $config = DSCConfig::getInstance();
     // Load default Parameters
     $this->product_img_height = $config->get('product_img_height');
     $this->product_img_width = $config->get('product_img_width');
     $this->category_img_height = $config->get('category_img_height');
     $this->category_img_width = $config->get('category_img_width');
     $this->manufacturer_img_width = $config->get('manufacturer_img_width');
     $this->manufacturer_img_height = $config->get('manufacturer_img_height');
     $this->product_img_path = DSC::getPath('products_images');
     $this->category_img_path = DSC::getPath('categories_images');
     $this->manufacturer_img_path = DSC::getPath('manufacturers_images');
     $this->product_thumb_path = DSC::getPath('products_thumbs');
     $this->category_thumb_path = DSC::getPath('categories_thumbs');
     $this->manufacturer_thumb_path = DSC::getPath('manufacturers_thumbs');
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:22,代码来源:image.php

示例12: __construct

 /**
  * constructor
  */
 function __construct($config = array())
 {
     parent::__construct($config);
     $input = JFactory::getApplication()->input;
     $com = $input->get('option');
     //$com = JRequest::get('option');
     if (!empty($config['com'])) {
         $com = $config['com'];
     }
     //do we really need to get the whole app to get the name or should we strip it from the option??
     $app = DSC::getApp();
     $this->_name = $app->getName();
     $this->_Pluginname = ucfirst($this->_name);
     $this->set('com', $com);
     $this->set('suffix', $this->get('default_view'));
     $this->list_url = "index.php?option=" . $this->get('com') . "&view=" . $this->get('suffix');
     // Register Extra tasks
     $this->registerTask('list', 'display');
     $this->registerTask('close', 'cancel');
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:23,代码来源:controller.php

示例13: display

 /**
  * First displays the submenu, then displays the output
  * but only if a valid _doTask is set in the view object
  *
  * @param $tpl
  * @return unknown_type
  */
 function display($tpl = null, $perform = true)
 {
     $doc = JFactory::getDocument();
     //$doc->addStyleSheet(JUri::root().'media/citruscart/css/citruscart_checkout_onepage.css');
     // these need to load before jquery to prevent joomla from crying
     JHTML::_('behavior.modal');
     $doc->addScript(JUri::root() . 'media/system/js/core.js');
     DSC::loadJQuery('latest', true, 'citruscartJQ');
     /*   if ($this->defines->get('use_bootstrap', '0'))
     	    {
     	    	DSC::loadBootstrap();
     	    } */
     //JHTML::_('stylesheet', 'common.css', 'media/citruscart/css/');
     $doc->addStyleSheet(JUri::root() . 'media/citruscart/css/common.css');
     if ($this->defines->get('include_site_css', '0')) {
         $doc->addStyleSheet(JUri::root() . 'media/citruscart/css/citruscart.css');
         //JHtml::_('stylesheet', 'media/citruscart/css/citruscart.css');
     }
     parent::display($tpl);
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:27,代码来源:_base.php

示例14: popupbootstrap

 /**
  * TODO Push this upstream once tested
  * 
  * @param unknown_type $url
  * @param unknown_type $text
  * @param unknown_type $options
  */
 public static function popupbootstrap($url, $text, $options = array())
 {
     $version = isset($options['version']) ? $options['version'] : 'default';
     DSC::loadBootstrap();
     JHTML::_('script', 'bootstrap-modal.js', 'media/dioscouri/bootstrap/' . $version . '/js/');
     $time = time();
     $modal_id = isset($options['modal_id']) ? $options['modal_id'] : 'modal-' . $time;
     $button_class = isset($options['button_class']) ? $options['button_class'] : 'btn';
     $label = 'label-' . $time;
     $button = '<a href="' . $url . '" data-target="#' . $modal_id . '" role="button" class="' . $button_class . '" data-toggle="modal">' . $text . '</a>';
     $modal = '';
     $modal .= '<div id="' . $modal_id . '" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="' . $label . '" aria-hidden="true">';
     $modal .= '    <div class="modal-header">';
     $modal .= '        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
     $modal .= '        <h3 id="' . $label . '">' . $text . '</h3>';
     $modal .= '    </div>';
     $modal .= '    <div class="modal-body">';
     $modal .= '    </div>';
     $modal .= '</div>';
     return $button . $modal;
 }
开发者ID:annggeel,项目名称:tienda,代码行数:28,代码来源:url.php

示例15:

 *   - 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


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