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


PHP PHPWS_Text::saltArray方法代码示例

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


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

示例1: clearLink

 public function clearLink()
 {
     $js_vars['label'] = dgettext('filecabinet', 'Clear file');
     $js_vars['id'] = $this->session_id;
     $js_vars['img'] = str_replace("'", "\\'", $this->placeHolder());
     $add_vars = $this->linkInfo();
     $add_vars['fop'] = 'open_file_manager';
     $add_vars['fid'] = 0;
     $js_vars['authkey'] = Current_User::getAuthKey(PHPWS_Text::saltArray($add_vars));
     return javascriptMod('filecabinet', 'clear_file', $js_vars);
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:11,代码来源:File_Manager.php

示例2: rowTags

    public function rowTags()
    {
        static $folder = null;
        if (empty($folder)) {
            $folder = new Folder($this->folder_id);
        }
        if (Current_User::allow('filecabinet', 'edit_folders', $this->folder_id, 'folder')) {
            $links[] = $folder->uploadLink('icon', null, null, $this->id);
            $authkey = \Current_User::getAuthKey(\PHPWS_Text::saltArray(array('iop' => 'delete_image', 'file_id' => $this->id, 'folder_id' => $this->folder_id)));
            $links[] = <<<EOF
<i style='cursor:pointer' class='fa fa-trash-o delete-file' data-folder-id='{$this->folder_id}' data-id='{$this->id}' data-type='iop' data-command='delete_image' data-authkey='{$authkey}'></i>
EOF;
        }
        if (isset($links)) {
            $tpl['ACTION'] = implode('', $links);
        }
        $tpl['SIZE'] = $this->getSize(TRUE);
        $tpl['FILE_NAME'] = $this->file_name;
        $tpl['THUMBNAIL'] = $this->lightboxThumb();
        $tpl['TITLE'] = htmlspecialchars($this->title, ENT_QUOTES);
        $tpl['DIMENSIONS'] = sprintf('%s x %s', $this->width, $this->height);
        return $tpl;
    }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:23,代码来源:Image.php

示例3: getAuthKey

 public function getAuthKey()
 {
     // if not secure, authkey irrelevant
     if (!$this->secure || !class_exists('Current_User')) {
         return null;
     }
     if ($this->salted) {
         // Have to make them strings because GET will change them on the
         // other side.
         return Current_User::getAuthKey(PHPWS_Text::saltArray($this->values));
     } else {
         $result = Current_User::getAuthKey();
         return $result;
     }
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:15,代码来源:Link.php

示例4: folderContents

    /**
     * Lists the contents of a folder for adminstrative changes.
     * @param object $folder
     * @param boolean $pick_image
     */
    public function folderContents($folder)
    {
        $links = array();
        javascript('jquery');
        $src = PHPWS_SOURCE_HTTP . 'mod/filecabinet/javascript/folder_options/contents.js';
        \Layout::addJSHeader("<script type='text/javascript' src='{$src}'></script>", 'folder-options');
        Layout::addStyle('filecabinet');
        PHPWS_Core::initCoreClass('DBPager.php');
        $dir_write = true;
        if (!is_writable($folder->getFullDirectory())) {
            $this->cabinet->message .= dgettext('filecabinet', 'Warning: this folder\'s directory is not writable.');
            $dir_write = false;
        }
        if ($folder->ftype == IMAGE_FOLDER) {
            javascript('lightbox');
            PHPWS_Core::initModClass('filecabinet', 'Image.php');
            $pager = new DBPager('images', 'PHPWS_Image');
            $pager->setTemplate('Forms/image_grid.tpl');
            $limits[9] = 9;
            $limits[16] = 16;
            $limits[25] = 25;
            $operation = 'iop';
            $command = 'upload_image_form';
            $label = _('Add image');
        } elseif ($folder->ftype == DOCUMENT_FOLDER) {
            PHPWS_Core::initModClass('filecabinet', 'Document.php');
            $pager = new DBPager('documents', 'PHPWS_Document');
            $pager->setTemplate('Forms/file_list.tpl');
            $limits[10] = 10;
            $limits[25] = 25;
            $limits[50] = 50;
            $operation = 'dop';
            $label = _('Add document');
            $command = 'upload_document_form';
            $pager->addSortHeader('downloaded', sprintf('<abbr title="%s">%s</abbr>', dgettext('filecabinet', 'Downloaded'), dgettext('filecabinet', 'DL')));
        } elseif ($folder->ftype = MULTIMEDIA_FOLDER) {
            PHPWS_Core::initModClass('filecabinet', 'Multimedia.php');
            $pager = new DBPager('multimedia', 'PHPWS_Multimedia');
            $pager->setTemplate('Forms/multimedia_grid.tpl');
            $limits[9] = 9;
            $limits[16] = 16;
            $limits[25] = 25;
            $label = _('Add media');
            $command = 'upload_multimedia_form';
            $operation = 'mop';
        }
        if (Current_User::allow('filecabinet', 'edit_folders', $folder->id, 'folder')) {
            if ($dir_write) {
                $links[] = $folder->uploadLink('button');
            }
            if ($folder->ftype == MULTIMEDIA_FOLDER) {
                //$links[] = $folder->rtmpLink();
                $salt = array('mop' => 'edit_rtmp', 'folder_id' => $folder->id);
                $authkey = \Current_User::getAuthKey(PHPWS_Text::saltArray($salt));
                $links[] = <<<EOF
<button class="btn btn-default show-modal" data-authkey="{$authkey}" data-command="edit_rtmp" data-operation="{$operation}" data-folder-id="{$folder->id}"><i class="fa fa-cloud"></i> Add RTMP video</button>
EOF;
            }
            //$links[] = $folder->editLink();
            $salt = array($operation => 'edit_folder', 'folder_id' => $folder->id);
            $authkey = \Current_User::getAuthKey(PHPWS_Text::saltArray($salt));
            $links[] = <<<EOF
<button class="btn btn-default show-modal" data-authkey="{$authkey}" data-command="edit_folder_modal" data-operation="aop" data-folder-id="{$folder->id}"><i class="fa fa-edit"></i> Edit</button>
EOF;
        }
        if ($this->cabinet->panel) {
            $pagetags['BACK'] = PHPWS_Text::moduleLink('<i class="fa fa-reply"></i> ' . dgettext('filecabinet', 'Back to folder list'), 'filecabinet', array('tab' => $this->cabinet->panel->getCurrentTab()), null, null, 'btn btn-default');
        }
        if (!empty($links)) {
            $pagetags['ADMIN_LINKS'] = implode(' ', $links);
        }
        $pagetags['MODAL'] = $this->getModal();
        $pagetags['ACTION_LABEL'] = dgettext('filecabinet', 'Action');
        $pager->setLimitList($limits);
        $pager->setSearch('file_name', 'title', 'description');
        $pager->addWhere('folder_id', $folder->id);
        $pager->setOrder('title', 'asc', true);
        $pager->setModule('filecabinet');
        $pager->addPageTags($pagetags);
        $pager->addRowTags('rowTags');
        $pager->addSortHeader('title', dgettext('filecabinet', 'Title'));
        $pager->addSortHeader('file_name', dgettext('filecabinet', 'File name'));
        $pager->addSortHeader('file_type', dgettext('filecabinet', 'File type'));
        $pager->addSortHeader('size', dgettext('filecabinet', 'Size'));
        $pager->setEmptyMessage(dgettext('filecabinet', 'Folder is empty.'));
        $this->cabinet->content = $pager->get();
    }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:92,代码来源:Forms.php


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