• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JS类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _addJS

 function _addJS($order, $resource, $is_file, $minify, $header)
 {
     $order = intval($order);
     $resources = array();
     if (array_key_exists($order, $this->js_resources)) {
         $resources = $this->js_resources[$order];
     }
     $js = new JS($resource, $is_file);
     $js->setMinified($minify);
     $js->setInHead($header);
     $resources[] = $js;
     $this->js_resources[$order] = $resources;
 }
开发者ID:ravinderphp,项目名称:revitalise,代码行数:13,代码来源:HeadAssets.php


示例2: getCover

    /**
     * Вывод обложки для file manager
     * @param int $id идентификатор модели
     * @param string $name имя модели
     * @param string $link ссылка, если задана, то выводится ссылка, иначе галерея
     * @param string $noImage если изображение не найдено
     * @param string $type тип изображения, которое хотим получить
     * @return string
     */
    public static function getCover($id, $name, $link = '', $type = 'thumbnail', $noImage = '')
    {
        Yii::import('application.modules.file.models.FileManager');
        $data = FileManager::model()->find('model_name=:model_name AND model_id = :model_id AND cover = 1', array(':model_id' => $id, ':model_name' => $name));
        if ($data === null) {
            $noImage = '<img alt = "" class = "j-lazy" src = "/images/' . Yii::app()->getModule('file')->noImage . '"/>';
            if ($link == '') {
                $view = $noImage;
            } else {
                $view = '<a href = "' . $link . '">' . $noImage . '</a>';
            }
        } else {
            $file = Yii::getPathOfAlias('webroot') . DS . 'upload' . DS . Yii::app()->getModule('file')->uploadFolder . DS . $data->folder . DS . $type . DS . $data->file;
            if (Yii::app()->cFile->set($file)->exists) {
                $img = '<img alt = "' . strip_tags($data->description) . '" class = "j-lazy" src = "/upload/' . Yii::app()->getModule('file')->uploadFolder . '/' . $data->folder . '/' . $type . '/' . $data->file . '"/>';
            } else {
                $img = '<img alt = "' . strip_tags($data->description) . '" class = "j-lazy" src = "/images/' . Yii::app()->getModule('file')->noImage . '/>';
            }
            if ($link == '') {
                $view = '<ul id= "j-photobox_gallery_cover" class = "b-images_view b-image_cover j-photobox_gallery">
						<li class = "l-inline_block">
							<a href = "/upload/' . Yii::app()->getModule('file')->uploadFolder . '/' . $data->folder . '/original/' . $data->file . '">' . $img . '</a>
						</li>
					</ul>';
                if (!Yii::app()->request->isAjaxRequest) {
                    Yii::app()->clientScript->registerPackage('photobox');
                }
                JS::add('photobox_init', "\$('.j-photobox_gallery').photobox('a',{ 'time':0, 'loop':false, 'afterClose': function(){}});");
            } else {
                $view = '<a href = "' . $link . '">' . $img . '</a>';
            }
        }
        return $view;
    }
开发者ID:blrtromax,项目名称:seobility,代码行数:43,代码来源:Helper.php


示例3: getData

 /**
  * Get the replacement content for the placeholder
  * @param string $placeholder
  * @return string
  */
 function getData($placeholder)
 {
     global $objDatabase;
     \JS::activate("shadowbox", array('players' => array('html', 'iframe')));
     $matter = substr($placeholder, 6, -1);
     if ($matter == "OVERVIEW") {
         return $this->getOverview();
     }
     // get the data id for the placeholder
     $query = "\n            SELECT type, ref_id\n              FROM " . DBPREFIX . "module_data_placeholders\n             WHERE placeholder='{$matter}'";
     $objRs = $objDatabase->Execute($query);
     if ($objRs && $objRs->RecordCount()) {
         $id = $objRs->fields['ref_id'];
         if ($objRs->fields['type'] == "cat") {
             $this->_arrLanguages = $this->createLanguageArray();
             $this->arrCategories = $this->createCategoryArray();
             if ($this->arrCategories[$id]['action'] == "subcategories") {
                 return $this->getSubcategories($id);
             }
             return $this->getCategory($id);
         } else {
             return $this->getDetail($id);
         }
     }
     return '';
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:31,代码来源:DataBlocks.class.php


示例4: initUploader

    /**
     * Init the uploader which is directly included in the webpage
     *
     * @return integer the uploader id
     */
    protected function initUploader()
    {
        \JS::activate('cx');
        // the uploader needs the framework
        $uploader = new \Cx\Core_Modules\Uploader\Model\Entity\Uploader();
        //create an uploader
        $uploadId = $uploader->getId();
        $uploader->setCallback('fileSharingUploader');
        $uploader->setOptions(array('id' => 'fileSharing_' . $uploadId, 'style' => 'display:none;'));
        $folderWidget = new \Cx\Core_Modules\MediaBrowser\Model\Entity\FolderWidget($_SESSION->getTempPath() . '/' . $uploadId, true);
        $folderWidgetId = $folderWidget->getId();
        $extendedFileInputCode = <<<CODE
<script type="text/javascript">
    cx.ready(function() {
            var field = jQuery('#contactForm #file_upload');
            //called if user clicks on the field
            var inputClicked = function() {
                jQuery('#fileSharing_{$uploadId}').trigger('click');
                return false;
            };

            jQuery('#fileSharing_{$uploadId}').hide();
            field.bind('click', inputClicked).removeAttr('disabled');
    });

    //uploader javascript callback function
    function fileSharingUploader(callback) {
            angular.element('#mediaBrowserfolderWidget_{$folderWidgetId}').scope().refreshBrowser();
    }
</script>
CODE;
        $this->objTemplate->setVariable(array('UPLOADER_CODE' => $uploader->getXHtml(), 'FILE_INPUT_CODE' => $extendedFileInputCode, 'FOLDER_WIDGET_CODE' => $folderWidget->getXHtml()));
        return $uploadId;
        // return the upload id
    }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:40,代码来源:FileSharingLib.class.php


示例5: render

 /**
  * Outputs the code and content for the accordion
  * @return string
  */
 public function render()
 {
     global $SITE, $CONFIG;
     JS::loadjQuery();
     JS::raw('$(function() {$(".ui-accordion-container").accordion({ header: "h3" ' . ($this->params ? ',' . $this->params : '') . '});});');
     Head::add($CONFIG->UI->jQuery_theme . '/jquery-ui-*', 'css-lib');
     Head::add('.ui-accordion-container li {width: 100%;}', 'css-raw');
     $r = '<ol class="ui-accordion-container">';
     $mode = 0;
     $title = false;
     $selected = false;
     $i = 0;
     foreach ($this->tabs as $arg) {
         if ($mode == 0) {
             $title = $arg;
             $mode = 1;
         } else {
             $r .= '
                 <li>
                     <h3><a href="#">' . $title . '</a></h3>
                     <div>' . $arg . '</div>
                 </li>';
             $mode = 0;
             $selected = false;
             $title = false;
             $i++;
         }
     }
     return $r . '</ol>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:34,代码来源:Accordion.php


示例6: run

 public function run()
 {
     $config = $this->config();
     if (empty($config['action'])) {
         throw new CException('File Upload: param "action" cannot be empty.');
     }
     unset($config['element']);
     $this->publishAssets();
     $postParams = array('PHPSESSID' => session_id(), 'YII_CSRF_TOKEN' => Yii::app()->request->csrfToken);
     if (isset($this->postParams)) {
         $postParams = array_merge($postParams, $this->postParams);
     }
     $postParams['sizeLimit'] = $this->sizeLimit;
     if (!isset($postParams['cover'])) {
         $postParams['cover'] = true;
     }
     if (!key_exists('file_type', $postParams)) {
         $postParams['file_type'] = 'image';
     }
     $setup = array('element' => 'js:document.getElementById("' . $this->id . '")');
     $setup = array_merge($setup, $config);
     $setup['params'] = $postParams;
     $setup = CJavaScript::encode($setup);
     JS::add('ajaxFileUpload' . $this->id, "var FileUploader_" . $this->id . " = new qq.FileUploader(" . $setup . ");");
     $view = '<div id="' . $this->id . '"><noscript><p>' . Yii::t('admin', 'In order to use the plugin, enable javascript') . '</p></noscript></div>';
     if ($this->multiple == true) {
         $view .= '<p class = "l-hint">' . Yii::t('admin', 'You can upload multiple files simultaneously holding down the shift or ctrl when selecting') . '</p>';
     }
     $view .= '<div id = "j-error_message" class = "l-system_message"></div>';
     echo $view;
 }
开发者ID:blrtromax,项目名称:seobility,代码行数:31,代码来源:UploadWidget.php


示例7: __construct

 /**
  * Checks environment and build defaults 
  * 
  */
 protected function __construct()
 {
     // Instantiate Feature Manager
     FeatureManager::getInstance();
     // Instantiate Context Manager
     ContextManager::getInstance();
     // Instantiate URLs Manager
     UrlManager::getInstance();
     // Instantiate Paths Manager & set Bebop root directory
     PathManager::getInstance()->set('bebop', __DIR__);
     // Set default Media Mvc Model modifications on the Bebop HTTP API
     Media::onContext('api', function ($media) {
         $media->cacheAllImageSizes();
     });
     // Set default views directory
     View::setViewsDir(PathManager::getInstance()->get('theme', 'views'));
     // Instantiate CSS Manager
     CSS::getInstance();
     // Instantiate JS Manager
     JS::getInstance();
     // Instantiate UI
     UI::getInstance();
     // Instantiate Api
     self::Api();
     // Instantiate Config
     Config::getInstance();
     // Shortcode support for in editor use
     add_shortcode('Bebop', array($this, '__bebopShortcodes'));
 }
开发者ID:ponticlaro,项目名称:bebop-core,代码行数:33,代码来源:Bebop.php


示例8: getPage

 /**
  * Reads the act and selects the right action
  */
 function getPage()
 {
     if (empty($_GET['cmd'])) {
         $_GET['cmd'] = '';
     } else {
         $this->strCmd = '&amp;cmd=' . intval($_GET['cmd']);
     }
     \JS::activate('shadowbox');
     if (isset($_GET['pId']) && !empty($_GET['pId'])) {
         if (isset($_POST['frmGalComAdd_PicId'])) {
             $this->addComment();
             \Cx\Core\Csrf\Controller\Csrf::header('location:' . CONTREXX_DIRECTORY_INDEX . '?section=Gallery' . html_entity_decode($this->strCmd, ENT_QUOTES, CONTREXX_CHARSET) . '&cid=' . intval($_POST['frmGalComAdd_GalId']) . '&pId=' . intval($_POST['frmGalComAdd_PicId']));
             exit;
         }
         if (isset($_GET['mark'])) {
             $this->countVoting($_GET['pId'], $_GET['mark']);
             \Cx\Core\Csrf\Controller\Csrf::header('location:' . CONTREXX_DIRECTORY_INDEX . '?section=Gallery' . html_entity_decode($this->strCmd, ENT_QUOTES, CONTREXX_CHARSET) . '&cid=' . intval($_GET['cid']) . '&pId=' . intval($_GET['pId']));
             exit;
         }
         if ($this->arrSettings['enable_popups'] == "on") {
             $this->showPicture(intval($_GET['pId']));
         } else {
             $this->showPictureNoPop(intval($_GET['pId']));
         }
     } else {
         $_GET['cid'] = isset($_GET['cid']) ? intval($_GET['cid']) : intval($_GET['cmd']);
         $this->showCategoryOverview($_GET['cid']);
     }
     return $this->_objTpl->get();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:33,代码来源:Gallery.class.php


示例9: load

 /**
  * Load your component.
  * 
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $subMenuTitle, $_CORELANG, $objTemplate;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             $objKnowledge = new Knowledge(\Env::get('cx')->getPage()->getContent());
             \Env::get('cx')->getPage()->setContent($objKnowledge->getPage());
             if (!empty($objKnowledge->pageTitle)) {
                 \Env::get('cx')->getPage()->setTitle($objKnowledge->pageTitle);
                 \Env::get('cx')->getPage()->setContentTitle($objKnowledge->pageTitle);
                 \Env::get('cx')->getPage()->setMetaTitle($objKnowledge->pageTitle);
             }
             break;
         case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
             $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
             $objTemplate = $this->cx->getTemplate();
             if (file_exists($this->cx->getClassLoader()->getFilePath($this->getDirectory() . '/View/Style/backend.css'))) {
                 \JS::registerCSS(substr($this->getDirectory(false, true) . '/View/Style/backend.css', 1));
             }
             \Permission::checkAccess(129, 'static');
             $subMenuTitle = $_CORELANG['TXT_KNOWLEDGE'];
             $objKnowledge = new KnowledgeAdmin();
             $objKnowledge->getPage();
             break;
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:31,代码来源:ComponentController.class.php


示例10: initFrontendEditing

 /**
  * Init the frontend editing.
  *
  * Register the javascripts and css files
  * Adds the used language variables to contrexx-js variables, so the toolbar has access to these variables
  *
  * @param ComponentController $componentController
  */
 public function initFrontendEditing(\Cx\Core_Modules\FrontendEditing\Controller\ComponentController $componentController)
 {
     global $_ARRAYLANG;
     // get necessary objects
     $objInit = \Env::get('init');
     $page = $this->cx->getPage();
     // add css and javascript file
     $jsFilesRoot = substr(ASCMS_CORE_MODULE_FOLDER . '/' . $componentController->getName() . '/View/Script', 1);
     \JS::registerCSS(substr(ASCMS_CORE_MODULE_FOLDER . '/' . $componentController->getName() . '/View/Style/Main.css', 1));
     \JS::registerJS($jsFilesRoot . '/Main.js');
     \JS::activate('cx');
     // not used for contrexx version 3.1
     //        \JS::registerJS($jsFilesRoot . '/CKEditorPlugins.js');
     // activate ckeditor
     \JS::activate('ckeditor');
     \JS::activate('jquery-cookie');
     // load language data
     $_ARRAYLANG = $objInit->loadLanguageData('FrontendEditing');
     $langVariables = array('TXT_FRONTEND_EDITING_SHOW_TOOLBAR' => $_ARRAYLANG['TXT_FRONTEND_EDITING_SHOW_TOOLBAR'], 'TXT_FRONTEND_EDITING_HIDE_TOOLBAR' => $_ARRAYLANG['TXT_FRONTEND_EDITING_HIDE_TOOLBAR'], 'TXT_FRONTEND_EDITING_PUBLISH' => $_ARRAYLANG['TXT_FRONTEND_EDITING_PUBLISH'], 'TXT_FRONTEND_EDITING_SUBMIT_FOR_RELEASE' => $_ARRAYLANG['TXT_FRONTEND_EDITING_SUBMIT_FOR_RELEASE'], 'TXT_FRONTEND_EDITING_REFUSE_RELEASE' => $_ARRAYLANG['TXT_FRONTEND_EDITING_REFUSE_RELEASE'], 'TXT_FRONTEND_EDITING_SAVE' => $_ARRAYLANG['TXT_FRONTEND_EDITING_SAVE'], 'TXT_FRONTEND_EDITING_EDIT' => $_ARRAYLANG['TXT_FRONTEND_EDITING_EDIT'], 'TXT_FRONTEND_EDITING_CANCEL_EDIT' => $_ARRAYLANG['TXT_FRONTEND_EDITING_CANCEL_EDIT'], 'TXT_FRONTEND_EDITING_FINISH_EDIT_MODE' => $_ARRAYLANG['TXT_FRONTEND_EDITING_FINISH_EDIT_MODE'], 'TXT_FRONTEND_EDITING_THE_DRAFT' => $_ARRAYLANG['TXT_FRONTEND_EDITING_THE_DRAFT'], 'TXT_FRONTEND_EDITING_SAVE_CURRENT_STATE' => $_ARRAYLANG['TXT_FRONTEND_EDITING_SAVE_CURRENT_STATE'], 'TXT_FRONTEND_EDITING_CONFIRM_BLOCK_SAVE' => $_ARRAYLANG['TXT_FRONTEND_EDITING_CONFIRM_BLOCK_SAVE'], 'TXT_FRONTEND_EDITING_MODULE_PAGE' => $_ARRAYLANG['TXT_FRONTEND_EDITING_MODULE_PAGE'], 'TXT_FRONTEND_EDITING_NO_TITLE_AND_CONTENT' => $_ARRAYLANG['TXT_FRONTEND_EDITING_NO_TITLE_AND_CONTENT'], 'TXT_FRONTEND_EDITING_CONFIRM_UNSAVED_EXIT' => $_ARRAYLANG['TXT_FRONTEND_EDITING_CONFIRM_UNSAVED_EXIT'], 'TXT_FRONTEND_EDITING_DRAFT' => $_ARRAYLANG['TXT_FRONTEND_EDITING_DRAFT'], 'TXT_FRONTEND_EDITING_PUBLISHED' => $_ARRAYLANG['TXT_FRONTEND_EDITING_PUBLISHED']);
     // add toolbar to html
     $this->prepareTemplate($componentController);
     // assign js variables
     $contrexxJavascript = \ContrexxJavascript::getInstance();
     $contrexxJavascript->setVariable('langVars', $langVariables, 'FrontendEditing');
     $contrexxJavascript->setVariable('pageId', $page->getId(), 'FrontendEditing');
     $contrexxJavascript->setVariable('hasPublishPermission', \Permission::checkAccess(78, 'static', true), 'FrontendEditing');
     $contrexxJavascript->setVariable('contentTemplates', $this->getCustomContentTemplates(), 'FrontendEditing');
     $contrexxJavascript->setVariable('defaultTemplate', $this->getDefaultTemplate(), 'FrontendEditing');
     $configPath = ASCMS_PATH_OFFSET . substr(\Env::get('ClassLoader')->getFilePath(ASCMS_CORE_PATH . '/Wysiwyg/ckeditor.config.js.php'), strlen(ASCMS_DOCUMENT_ROOT));
     $contrexxJavascript->setVariable('configPath', $configPath . '?langId=' . FRONTEND_LANG_ID, 'FrontendEditing');
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:39,代码来源:FrontendController.class.php


示例11: init

 /**
  * Reescreve o método init()
  * @access public
  * @param void
  * @return void
  */
 public function init()
 {
     // verifica as permissoes
     $PermissoesGrupo = array();
     $auth = Zend_Auth::getInstance();
     // instancia da autenticação
     $GrupoAtivo = new Zend_Session_Namespace('GrupoAtivo');
     $idPronac = $this->_request->getParam("idPronac");
     // pega o id do pronac via get
     if (strlen($idPronac) > 7) {
         $idPronac = Seguranca::dencrypt($idPronac);
     }
     if (isset($auth->getIdentity()->usu_codigo)) {
         parent::perfil(1, $PermissoesGrupo);
     } else {
         parent::perfil(4, $PermissoesGrupo);
         $this->getIdUsuario = isset($_GET["idusuario"]) ? $_GET["idusuario"] : 0;
         /* =============================================================================== */
         /* ==== VERIFICA PERMISSAO DE ACESSO DO PROPONENTE A PROPOSTA OU AO PROJETO ====== */
         /* =============================================================================== */
         if (!isset($idPronac) || empty($idPronac)) {
             parent::message('É necessário o número do PRONAC para acessar essa página!', "principalproponente", "ERROR");
         }
         //            $this->verificarPermissaoAcesso(false, true, false);
     }
     //SE CAIU A SECAO REDIRECIONA
     if (!$auth->hasIdentity()) {
         $url = Zend_Controller_Front::getInstance()->getBaseUrl();
         JS::redirecionarURL($url);
     }
     parent::init();
     // chama o init() do pai GenericControllerNew
 }
开发者ID:hackultura,项目名称:novosalic,代码行数:39,代码来源:SolicitarrecursodecisaoController.php


示例12: fetch

 public static function fetch()
 {
     if (!self::is_fetched()) {
         JS::require_jquery();
         JS::require_script("/" . FRAMEWORK_CORE_PATH . "js/jquery/screen_resolution.js");
     }
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:7,代码来源:BrowserInfo.class.php


示例13: init

 /**
  * Reescreve o método init()
  * @access public
  * @param void
  * @return void
  */
 public function init()
 {
     $PermissoesGrupo[] = 93;
     // Coordenador de Parecerista
     $PermissoesGrupo[] = 94;
     // Parecerista
     $PermissoesGrupo[] = 121;
     // Técnico de Acompanhamento
     $PermissoesGrupo[] = 129;
     // Técnico de Acompanhamento
     $PermissoesGrupo[] = 122;
     // Coordenador de Acompanhamento
     $PermissoesGrupo[] = 123;
     // Coordenador Geral de Acompanhamento
     $PermissoesGrupo[] = 128;
     // Tecnico de Portaria
     parent::perfil(1, $PermissoesGrupo);
     $auth = Zend_Auth::getInstance();
     // pega a autenticação
     //SE CAIU A SECAO REDIRECIONA
     if (!$auth->hasIdentity()) {
         $url = Zend_Controller_Front::getInstance()->getBaseUrl();
         JS::redirecionarURL($url);
     }
     $agente = GerenciarPautaReuniaoDAO::consultaAgenteUsuario($auth->getIdentity()->usu_codigo);
     $this->view->agente = $agente['idAgente'];
     $this->getIdUsuario = $agente['idAgente'];
     $GrupoAtivo = new Zend_Session_Namespace('GrupoAtivo');
     // cria a sessão com o grupo ativo
     $this->getIdOrgao = $GrupoAtivo->codOrgao;
     $this->codGrupo = $GrupoAtivo->codGrupo;
     parent::init();
     // chama o init() do pai GenericControllerNew
 }
开发者ID:hackultura,项目名称:novosalic,代码行数:40,代码来源:ManterreadequacaoController.php


示例14: showImport

 /**
  * It displayes the import menu
  *
  * @return customer import screen
  */
 function showImport()
 {
     global $_ARRAYLANG, $objDatabase;
     \JS::activate('cx');
     \JS::activate('jqueryui');
     \JS::registerCSS('modules/Crm/View/Style/main.css');
     \JS::registerJS('modules/Crm/View/Script/contactexport.js');
     \JS::registerJS('lib/javascript/jquery.form.js');
     \JS::registerJS('lib/javascript/jquery.tmpl.min.js');
     \JS::registerJS('lib/javascript/jquery.base64.js');
     \JS::registerJS('lib/javascript/jquery.format.js');
     $objTpl = $this->_objTpl;
     $objTpl->addBlockfile('CRM_SETTINGS_FILE', 'settings_block', "module_{$this->moduleNameLC}_interface_import_options.html");
     $objTpl->setGlobalVariable(array('MODULE_NAME' => $this->moduleName));
     foreach ($this->_delimiter as $key => $value) {
         $objTpl->setVariable(array('CRM_DELIMITER_VALUE' => $key, 'CRM_DELIMITER_TITLE' => $_ARRAYLANG[$value['placeholder']]));
         $objTpl->parse('crm_delimiter');
     }
     foreach ($this->_enclosure as $key => $value) {
         $objTpl->setVariable(array('CRM_ENCLOSURE_VALUE' => $key, 'CRM_ENCLOSURE_TITLE' => $_ARRAYLANG[$value['placeholder']]));
         $objTpl->parse('crm_enclosure');
     }
     $options = array('upload-limit' => 1, 'id' => 'importUploader', 'style' => 'display:none;', 'allowed-extensions' => array('csv'));
     $uploaderCode = $this->initUploader('uploadFinished', 'importCallbackJs', '', '', $options);
     $redirectUrl = \Cx\Core\Csrf\Controller\Csrf::enhanceURI('index.php?cmd=Crm&act=getImportFilename');
     $this->_objTpl->setVariable(array('COMBO_UPLOADER_CODE' => $uploaderCode, 'REDIRECT_URL' => $redirectUrl));
     $objTpl->setVariable(array('TXT_CRM_TITLE_IMPORT_CONTACTS' => $_ARRAYLANG['TXT_CRM_TITLE_IMPORT_CONTACTS'], 'TXT_CRM_IMPORT_HEADER' => $_ARRAYLANG['TXT_CRM_IMPORT_HEADER'], 'TXT_CRM_IMPORT_NOTE' => $_ARRAYLANG['TXT_CRM_IMPORT_NOTE'], 'TXT_CRM_IMPORT_NOTE_DESCRIPTION' => $_ARRAYLANG['TXT_CRM_IMPORT_NOTE_DESCRIPTION'], 'TXT_CRM_CSV_SETTINGS' => $_ARRAYLANG['TXT_CRM_CSV_SETTINGS'], 'TXT_CRM_SKIP' => $_ARRAYLANG['TXT_CRM_SKIP'], 'TXT_CRM_OVERWRITE' => $_ARRAYLANG['TXT_CRM_OVERWRITE'], 'TXT_CRM_DUPLICATE' => $_ARRAYLANG['TXT_CRM_DUPLICATE'], 'TXT_CRM_CHOOSE_FILE' => $_ARRAYLANG['TXT_CRM_CHOOSE_FILE'], 'TXT_CRM_CSV_SEPARATOR' => $_ARRAYLANG['TXT_CRM_CSV_SEPARATOR'], 'TXT_CRM_CSV_ENCLOSURE' => $_ARRAYLANG['TXT_CRM_CSV_ENCLOSURE'], 'TXT_CRM_ON_DUPLICATES' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATES'], 'TXT_CRM_CHOOSE_CSV' => $_ARRAYLANG['TXT_CRM_CHOOSE_CSV'], 'TXT_CRM_ON_DUPLICATES_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATES_INFO'], 'TXT_CRM_ON_DUPLICATE_SKIP_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATE_SKIP_INFO'], 'TXT_CRM_ON_DUPLICATE_OVERWRITE_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATE_OVERWRITE_INFO'], 'TXT_CRM_ON_DUPLICATE_INFO' => $_ARRAYLANG['TXT_CRM_ON_DUPLICATE_INFO'], 'TXT_CRM_IGNORE_FIRST_ROW' => $_ARRAYLANG['TXT_CRM_IGNORE_FIRST_ROW'], 'TXT_CRM_CONTINUE' => $_ARRAYLANG['TXT_CRM_CONTINUE'], 'TXT_CRM_CANCEL' => $_ARRAYLANG['TXT_CRM_CANCEL'], 'TXT_CRM_VERIFY_FIELDS' => $_ARRAYLANG['TXT_CRM_VERIFY_FIELDS'], 'TXT_CRM_VERIFY_INFO' => $_ARRAYLANG['TXT_CRM_VERIFY_INFO'], 'TXT_CRM_FILE_COLUMN' => $_ARRAYLANG['TXT_CRM_FILE_COLUMN'], 'TXT_CRM_CORRESPONDING_FIELD' => $_ARRAYLANG['TXT_CRM_CORRESPONDING_FIELD'], 'TXT_CRM_CSV_VALUE' => $_ARRAYLANG['TXT_CRM_CSV_VALUE'], 'TXT_CRM_CHANGE' => $_ARRAYLANG['TXT_CRM_CHANGE'], 'TXT_CRM_LOADING' => $_ARRAYLANG['TXT_CRM_LOADING'], 'TXT_CRM_PREVIOUS_RECORD' => $_ARRAYLANG['TXT_CRM_PREVIOUS_RECORD'], 'TXT_CRM_NEXT_RECORD' => $_ARRAYLANG['TXT_CRM_NEXT_RECORD'], 'TXT_CRM_TITLE_SAVING_CONTACTS' => $_ARRAYLANG['TXT_CRM_TITLE_SAVING_CONTACTS'], 'TXT_CRM_INTERFACE_FINAL_INFO' => $_ARRAYLANG['TXT_CRM_INTERFACE_FINAL_INFO'], 'TXT_CRM_RECORD_DONE' => $_ARRAYLANG['TXT_CRM_RECORD_DONE'], 'TXT_CRM_RECORD_SKIPPED' => $_ARRAYLANG['TXT_CRM_RECORD_SKIPPED'], 'TXT_CRM_RECORD_IMPORT' => $_ARRAYLANG['TXT_CRM_RECORD_IMPORT'], 'TXT_CRM_RECORD_PROCESS' => $_ARRAYLANG['TXT_CRM_RECORD_PROCESS'], 'TXT_CRM_IMPORT_NAME' => $_ARRAYLANG['TXT_CRM_IMPORT_NAME'], 'TXT_CRM_EXPORT_NAME' => $_ARRAYLANG['TXT_CRM_EXPORT_NAME']));
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:33,代码来源:CrmInterface.class.php


示例15: initUploader

    /**
     * init the pl uploader which is directly included in the webpage
     *
     * @return integer the uploader id
     */
    protected function initUploader()
    {
        \JS::activate('cx');
        // the uploader needs the framework
        $cx = \Cx\Core\Core\Controller\Cx::instanciate();
        \Env::get('ClassLoader')->loadFile($cx->getCodeBaseCoreModulePath() . '/Upload/Controller/UploadFactory.class.php');
        /**
         * Name of the upload instance
         */
        $uploaderInstanceName = 'exposed_combo_uploader';
        $uploaderWidgetName = 'uploadWidget';
        /**
         * jQuery selector of the HTML-element where the upload folder-widget shall be put in
         */
        $uploaderFolderWidgetContainer = '#uploadFormField_uploadWidget';
        // create an exposedCombo uploader
        $uploader = \Cx\Core_Modules\Upload\Controller\UploadFactory::getInstance()->newUploader('exposedCombo');
        //set instance name so we are able to catch the instance with js
        $uploader->setJsInstanceName($uploaderInstanceName);
        // specifies the function to call when upload is finished. must be a static function
        $uploader->setFinishedCallback(array($cx->getCodeBaseModulePath() . '/FileSharing/Controller/FileSharing.class.php', '\\Cx\\Modules\\FileSharing\\Controller\\FileSharing', 'uploadFinished'));
        //insert the uploader into the HTML-template
        $this->objTemplate->setVariable(array('UPLOADER_CODE' => $uploader->getXHtml(), 'EXTENDED_FILE_INPUT_CODE' => <<<CODE
<script type="text/javascript">
cx.include(
[
'core_modules/Upload/js/uploaders/exposedCombo/extendedFileInput.js'
],
function() {
        var ef = new ExtendedFileInput({
                field: \$J('#file_upload'),
                instance: '{$uploaderInstanceName}',
                widget: '{$uploaderWidgetName}'
        });
}
);
cx.jQuery(document).ready(function(\$) {
    \$J('a.toggle').click(function() {
        \$J('div.toggle').toggle();
        return false;
    });
});
</script>
CODE
));
        // optional: initialize the widget displaying the folder contents
        $uploadId = $uploader->getUploadId();
        $tempPaths = self::getTemporaryFilePaths($uploadId);
        if (!is_dir($tempPaths[0] . '/' . $tempPaths[2])) {
            \Cx\Lib\FileSystem\FileSystem::make_folder($tempPaths[0] . '/' . $tempPaths[2]);
            //mkdir($tempPaths[0] . '/' . $tempPaths[2]);
            \Cx\Lib\FileSystem\FileSystem::makeWritable($tempPaths[0] . '/' . $tempPaths[2]);
            //chmod($tempPaths[0] . '/' . $tempPaths[2], 0777);
        }
        $folderWidget = \Cx\Core_Modules\Upload\Controller\UploadFactory::getInstance()->newFolderWidget($tempPaths[0] . '/' . $tempPaths[2], $uploaderInstanceName);
        $this->objTemplate->setVariable('UPLOAD_WIDGET_CODE', $folderWidget->getXHtml($uploaderFolderWidgetContainer, 'uploadWidget'));
        // return the upload id
        return $uploadId;
    }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:64,代码来源:FileSharingLib.class.php


示例16: imageEditor

 function imageEditor()
 {
     JS::loadjQuery();
     JS::lib('jquery/jquery.imgareaselect-*');
     JS::lib('imgTools');
     $size = getimagesize($this->that->path);
     return Form::quick(false, __('Save'), new Input(__('Filename'), 'filename', $_POST['filename'] ? $_POST['filename'] : $this->that->basename), new Hidden('cropimgx', $_POST['cropimgx']), new Hidden('cropimgy', $_POST['cropimgy']), new Hidden('cropimgw', $_POST['cropimgw']), new Hidden('cropimgh', $_POST['cropimgh']), new Tabber('img', new Tab(__('Cropping'), '<div id="imgcropper"><img style="float: left" id="originalImage" src="?id=' . $this->that->ID . '&amp;w=400" /><div style="clear: both;"></div></div>'), new Tab(__('Resize'), '<div id="imgresize"><div id="resval" style="clear: right;"><input name="resimgx" id="resimgx" size="4" value="' . $size[0] . '" />x<input name="resimgy" id="resimgy" size="4" value="' . $size[1] . '" /></div></div>'), new Tab(__('Rotate'), new Select(__('Specify rotation (CCW)'), 'imgrot', array('0' => __('None'), '90' => '90 &deg;', '180' => '180 &deg;', '270' => '270 &deg;'), $_REQUEST['imgrot']))));
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:8,代码来源:ImageEditor.php


示例17: render

 function render()
 {
     JS::loadjQuery();
     JS::lib('viewslider');
     JS::raw('$(function(){$("div.viewslider-view").closest(".formdiv").viewslider();});');
     Head::add('viewslider/viewslider', 'css-lib');
     return '<div class="formsection viewslider-view"><h3>' . $this->header . '</h3>' . implode('', flatten($this->elements)) . '</div>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:8,代码来源:Formsection.php


示例18: init

 public function init()
 {
     ini_set('memory_limit', '128M');
     $auth = Zend_Auth::getInstance();
     // pega a autenticação
     // define as permissões
     $PermissoesGrupo = array();
     $PermissoesGrupo[] = 97;
     // Gestor Salic
     $PermissoesGrupo[] = 93;
     // Acompanhamento
     $PermissoesGrupo[] = 134;
     // Coordenador de Fiscalizaç?o
     //SE CAIU A SECAO REDIRECIONA
     if (!$auth->hasIdentity()) {
         $url = Zend_Controller_Front::getInstance()->getBaseUrl();
         JS::redirecionarURL($url);
     }
     /*         * ****************************************************************************************************** */
     $cpf = isset($auth->getIdentity()->usu_codigo) ? $auth->getIdentity()->usu_identificacao : $auth->getIdentity()->Cpf;
     $this->cpfLogado = $cpf;
     // Busca na SGCAcesso
     $sgcAcesso = new Sgcacesso();
     $buscaAcesso = $sgcAcesso->buscar(array('Cpf = ?' => $cpf));
     // Busca na Usuarios
     $usuarioDAO = new Usuario();
     $buscaUsuario = $usuarioDAO->buscar(array('usu_identificacao = ?' => $cpf));
     // Busca na Agentes
     $agentesDAO = new Agentes();
     $buscaAgente = $agentesDAO->BuscaAgente($cpf);
     if (count($buscaAcesso) > 0) {
         $this->idResponsavel = $buscaAcesso[0]->IdUsuario;
     }
     if (count($buscaAgente) > 0) {
         $this->idAgente = $buscaAgente[0]->idAgente;
     }
     if (count($buscaUsuario) > 0) {
         $this->idUsuario = $buscaUsuario[0]->usu_codigo;
     }
     $this->view->idAgenteLogado = $this->idAgente;
     /*         * ****************************************************************************************************** */
     // pega o idAgente do usuário logado
     if (isset($auth->getIdentity()->usu_codigo)) {
         parent::perfil(1, $PermissoesGrupo);
         $this->getCNPJCPF = $auth->getIdentity()->usu_identificacao;
         $this->getIdUsuario = UsuarioDAO::getIdUsuario($auth->getIdentity()->usu_codigo);
         if ($this->getIdUsuario) {
             $this->getIdUsuario = $this->getIdUsuario["idAgente"];
         } else {
             $this->getIdUsuario = 0;
         }
     } else {
         parent::perfil(4, $PermissoesGrupo);
         $this->getCNPJCPF = $auth->getIdentity()->Cpf;
         $this->getIdUsuario = $auth->getIdentity()->IdUsuario;
     }
     parent::init();
 }
开发者ID:hackultura,项目名称:novosalic,代码行数:58,代码来源:ListarprojetosController.php


示例19: render

 function render()
 {
     $id = idfy($this->name);
     JS::loadjQuery();
     Head::add('$(function(){$(".sortable_list").sortable({axis:"y"});});', 'js-raw');
     $val = (array) $this->value;
     array_walk($val, array($this, 'addHiddenFormField'));
     return '<span class="formelem">' . ($this->label === false ? '' : '<label for"' . $id . '">' . $this->label . '</label>') . listify($val, 'sortable_list' . ($this->validate ? ' ' . $this->validate : '')) . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . '</span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:9,代码来源:Sortable.php


示例20: render

 function render()
 {
     $id = idfy($this->name);
     JS::loadjQuery(false);
     JS::lib('imgPicker');
     JS::raw('setupPreview("' . $id . '");');
     //FIXME: Flytta styling till stylesheet!
     return '<span class="formelem">' . ($this->label === false ? '' : '<label for="' . $id . '">' . $this->label . '</label>') . '<input name="' . $this->name . '" id="' . $id . '" class="text' . ($this->validate ? ' ' . $this->validate : '') . '" value="' . $this->value . '" type="hidden" />' . '<div class="tools">' . icon('small/cross', __('Remove'), "javascript:removePreview('{$id}');", $id . "remicon") . icon('small/folder_picture', __('Browse picture'), "javascript:explore('{$id}', " . ($this->dir ? $this->dir : 'false') . ");") . '</div>' . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . ($this->preview ? '<div id="' . $id . 'prev" style="margin:10px 0 5px 150px;"><img id="' . $id . 'img" src="index.php?id=' . $this->value . '&mw=300" /></div>' : '') . '</span>';
 }
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:9,代码来源:ImagePicker.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JSFactory类代码示例发布时间:2022-05-23
下一篇:
PHP JRouter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap