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


PHP DocumentType::getSearchURL方法代码示例

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


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

示例1: getUploadFileValidLocationName

 /**
  * Find a valid path for the new file
  *
  * @param $dir       dir to search a free path for the file
  * @param $sha1sum   SHA1 of the file
  *
  * @return nothing
  **/
 static function getUploadFileValidLocationName($dir, $sha1sum)
 {
     global $CFG_GLPI;
     if (empty($dir)) {
         $message = __('Unauthorized file type');
         if (Session::haveRight('dropdown', READ)) {
             $dt = new DocumentType();
             $message .= " <a target='_blank' href='" . $dt->getSearchURL() . "'>\n                         <img src=\"" . $CFG_GLPI["root_doc"] . "/pics/aide.png\"></a>";
         }
         Session::addMessageAfterRedirect($message, false, ERROR);
         return '';
     }
     if (!is_dir(GLPI_DOC_DIR)) {
         Session::addMessageAfterRedirect(sprintf(__("The directory %s doesn't exist."), GLPI_DOC_DIR), false, ERROR);
         return '';
     }
     $subdir = $dir . '/' . substr($sha1sum, 0, 2);
     if (!is_dir(GLPI_DOC_DIR . "/" . $subdir) && @mkdir(GLPI_DOC_DIR . "/" . $subdir, 0777, true)) {
         Session::addMessageAfterRedirect(sprintf(__('Create the directory %s'), GLPI_DOC_DIR . "/" . $subdir));
     }
     if (!is_dir(GLPI_DOC_DIR . "/" . $subdir)) {
         Session::addMessageAfterRedirect(sprintf(__('Failed to create the directory %s. Verify that you have the correct permission'), GLPI_DOC_DIR . "/" . $subdir), false, ERROR);
         return '';
     }
     return $subdir . '/' . substr($sha1sum, 2) . '.' . $dir;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:34,代码来源:document.class.php

示例2: getUploadFileValidLocationName

 /**
  * Find a valid path for the new file
  *
  * @param $dir dir to search a free path for the file
  * @param $sha1sum SHA1 of the file
  *
  * @return nothing
  **/
 static function getUploadFileValidLocationName($dir, $sha1sum)
 {
     global $CFG_GLPI, $LANG;
     if (empty($dir)) {
         $message = $LANG['document'][32];
         if (haveRight('dropdown', 'r')) {
             $dt = new DocumentType();
             $message .= " <a target='_blank' href='" . $dt->getSearchURL() . "'>\n                         <img src=\"" . $CFG_GLPI["root_doc"] . "/pics/aide.png\"></a>";
         }
         addMessageAfterRedirect($message, false, ERROR);
         return '';
     }
     if (!is_dir(GLPI_DOC_DIR)) {
         addMessageAfterRedirect($LANG['document'][31] . " " . GLPI_DOC_DIR, false, ERROR);
         return '';
     }
     $subdir = $dir . '/' . substr($sha1sum, 0, 2);
     if (!is_dir(GLPI_DOC_DIR . "/" . $subdir) && @mkdir(GLPI_DOC_DIR . "/" . $subdir, 0777, true)) {
         addMessageAfterRedirect($LANG['document'][34] . " " . GLPI_DOC_DIR . "/" . $subdir);
     }
     if (!is_dir(GLPI_DOC_DIR . "/" . $subdir)) {
         addMessageAfterRedirect($LANG['document'][29] . " " . GLPI_DOC_DIR . "/" . $subdir . " " . $LANG['document'][30], false, ERROR);
         return '';
     }
     return $subdir . '/' . substr($sha1sum, 2) . '.' . $dir;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:34,代码来源:document.class.php


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