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

PHP studip_utf8decode函数代码示例

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

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



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

示例1: add_topic_action

 public function add_topic_action()
 {
     if (!$GLOBALS['perm']->have_studip_perm("tutor", $_SESSION['SessionSeminar'])) {
         throw new AccessDeniedException();
     }
     if (!Request::get("title")) {
         throw new Exception("Geben Sie einen Titel an.");
     }
     $date = new CourseDate(Request::option("termin_id"));
     $seminar_id = $date['range_id'];
     $title = studip_utf8decode(Request::get("title"));
     $topic = CourseTopic::findByTitle($seminar_id, $title);
     if (!$topic) {
         $topic = new CourseTopic();
         $topic['title'] = $title;
         $topic['seminar_id'] = $seminar_id;
         $topic['author_id'] = $GLOBALS['user']->id;
         $topic['description'] = "";
         $topic->store();
     }
     $date->addTopic($topic);
     $factory = $this->get_template_factory();
     $output = array('topic_id' => $topic->getId());
     $template = $factory->open($this->get_default_template("_topic_li"));
     $template->set_attribute("topic", $topic);
     $template->set_attribute("date", $date);
     $output['li'] = $template->render();
     $this->render_json($output);
 }
开发者ID:ratbird,项目名称:hope,代码行数:29,代码来源:dates.php


示例2: po_unescape

/**
 * Unescapes a string for use in .po file.
 *
 * @param String $string String to unescape
 * @return String Unescaped string
 */
function po_unescape($string)
{
    $replaces = array('\\"' => '"', '\\n' => "\n");
    $string = str_replace(array_keys($replaces), array_values($replaces), $string);
    $string = studip_utf8decode($string);
    return $string;
}
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:help-translation-tool.php


示例3: before_filter

 /**
  * Things to do before every page load.
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // AJAX request, so no page layout.
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
         // Open base layout for normal
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
         PageLayout::setTitle(_('Anmeldesets'));
         // Get only own courses if user doesn't have permission to edit institute-wide coursesets.
         $this->onlyOwnCourses = true;
         if ($GLOBALS['perm']->have_perm('admin') || $GLOBALS['perm']->have_perm('dozent') && get_config('ALLOW_DOZENT_COURSESET_ADMIN')) {
             // We have access to institute-wide course sets, so all courses may be assigned.
             $this->onlyOwnCourses = false;
             Navigation::activateItem('/tools/coursesets/sets');
         } else {
             throw new AccessDeniedException();
         }
     }
     PageLayout::addSqueezePackage('admission');
     $this->set_content_type('text/html;charset=windows-1252');
     $views = new ViewsWidget();
     $views->setTitle(_('Aktionen'));
     $views->addLink(_('Anmeldeset anlegen'), $this->url_for('admission/courseset/configure'))->setActive($action == 'configure');
     Sidebar::Get()->addWidget($views);
 }
开发者ID:ratbird,项目名称:hope,代码行数:36,代码来源:courseset.php


示例4: __construct

 /**
  * Construct an array object from a json string
  *
  * @param string $input a json string
  */
 function __construct($input)
 {
     if (is_string($input)) {
         $input = studip_utf8decode((array) json_decode($input, true));
     }
     parent::__construct((array) $input);
 }
开发者ID:ratbird,项目名称:hope,代码行数:12,代码来源:JSONArrayObject.class.php


示例5: before_filter

 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::Get()->LITERATURE_ENABLE) {
         throw new AccessDeniedException(_('Die Literaturverwaltung ist nicht aktiviert.'));
     }
     $this->attributes['textarea'] = array('style' => 'width:98%', 'rows' => 2);
     $this->attributes['select'] = array();
     $this->attributes['date'] = array();
     $this->attributes['combo'] = array('style' => 'width:45%; display: inline;');
     $this->attributes['lit_select'] = array('style' => 'font-size:8pt;width:100%');
     // on AJAX request set no page layout.
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     }
     $this->set_content_type('text/html;charset=windows-1252');
     /*      checkObject(); // do we have an open object?
             checkObjectModule('literature');
             object_set_visit_module('literature');/**/
 }
开发者ID:ratbird,项目名称:hope,代码行数:32,代码来源:literature.php


示例6: before_filter

 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     if (Request::get('termin_id')) {
         $this->dates[0] = new SingleDate(Request::option('termin_id'));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (Request::get('issue_id')) {
         $this->issue_id = Request::option('issue_id');
         $this->dates = array_values(array_map(function ($data) {
             $d = new SingleDate();
             $d->fillValuesFromArray($data);
             return $d;
         }, IssueDB::getDatesforIssue(Request::option('issue_id'))));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(400);
     }
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen");
     PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _("Veranstaltungstermine absagen"));
     $this->set_content_type('text/html;charset=windows-1252');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:35,代码来源:cancel_dates.php


示例7: fetchData

 /**
  * You can specify a custom import.
  * @return bool
  */
 public function fetchData()
 {
     $wsdl = FleximportConfig::get("SEMIRO_SOAP_PARTICIPANTS_WSDL");
     $soap = new SoapClient($wsdl, array('trace' => 1, 'exceptions' => 0, 'cache_wsdl' => $GLOBALS['CACHING_ENABLE'] || !isset($GLOBALS['CACHING_ENABLE']) ? WSDL_CACHE_BOTH : WSDL_CACHE_NONE, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
     $file = strtolower(substr($wsdl, strrpos($wsdl, "/") + 1));
     $soapHeaders = new SoapHeader($file, 'Header', array('pw' => FleximportConfig::get("SEMIRO_SOAP_PASSWORD")));
     $soap->__setSoapHeaders($soapHeaders);
     $result = $soap->getTeilnehmerXML(array('pw' => FleximportConfig::get("SEMIRO_SOAP_PASSWORD")));
     if (is_a($result, "SoapFault")) {
         throw new Exception("SOAP-error: " . $result->faultstring);
     }
     $fields = array();
     $doc = new DOMDocument();
     $doc->loadXML(studip_utf8decode($result->return));
     $seminar_data = array();
     foreach ($doc->getElementsByTagName("teilnehmer") as $seminar) {
         $seminar_data_row = array();
         foreach ($seminar->childNodes as $attribute) {
             if ($attribute->tagName) {
                 if (!in_array(studip_utf8decode(trim($attribute->tagName)), $fields)) {
                     $fields[] = studip_utf8decode(trim($attribute->tagName));
                 }
                 $seminar_data_row[] = studip_utf8decode(trim($attribute->nodeValue));
             }
         }
         $seminar_data[] = $seminar_data_row;
     }
     $this->table->createTable($fields, $seminar_data);
 }
开发者ID:Krassmus,项目名称:Fleximport,代码行数:33,代码来源:fleximport_semiro_participant_import.php


示例8: edit_action

 function edit_action($area_id)
 {
     ForumPerm::check('edit_area', $this->getId(), $area_id);
     if (Request::isAjax()) {
         ForumEntry::update($area_id, studip_utf8decode(Request::get('name')), studip_utf8decode(Request::get('content')));
         $this->render_json(array('content' => ForumEntry::killFormat(ForumEntry::killEdit(studip_utf8decode(Request::get('content'))))));
     } else {
         ForumEntry::update($area_id, Request::get('name'), Request::get('content'));
         $this->flash['messages'] = array('success' => _('Die Änderungen am Bereich wurden gespeichert.'));
         $this->redirect(PluginEngine::getLink('coreforum/index/index'));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:12,代码来源:area.php


示例9: store_action

 public function store_action($version)
 {
     $body = Request::get('body');
     if (Request::isXhr()) {
         $body = studip_utf8decode($body);
     }
     submitWikiPage($this->keyword, $version, $body, $GLOBALS['user']->id, $this->range_id);
     $latest_version = getLatestVersion($this->keyword, $this->range_id);
     if (Request::isXhr()) {
         $this->render_json(array('version' => $latest_version['version'], 'body' => $latest_version['body'], 'messages' => implode(PageLayout::getMessages()) ?: false, 'zusatz' => getZusatz($latest_version)));
     } else {
         // Yeah, wait for the whole trailification of the wiki...
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:wiki.php


示例10: before_filter

 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     $this->current_action = $action;
     parent::before_filter($action, $args);
     if (Request::isXhr()) {
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     $this->set_content_type('text/html;charset=windows-1252');
 }
开发者ID:ratbird,项目名称:hope,代码行数:18,代码来源:helpers.php


示例11: before_filter

 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->course_id = $args[0];
     if (!in_array($action, words('apply claim delete order_down order_up'))) {
         $this->redirect($this->url_for('/apply/' . $action));
         return false;
     }
     if (!get_object_type($this->course_id, array('sem'))) {
         throw new Trails_Exception(400);
     }
     $course = Seminar::GetInstance($this->course_id);
     $enrolment_info = $course->getEnrolmentInfo($GLOBALS['user']->id);
     //Ist bereits Teilnehmer/Admin/freier Zugriff -> gleich weiter
     if ($enrolment_info['enrolment_allowed'] && (in_array($enrolment_info['cause'], words('root courseadmin member')) || $enrolment_info['cause'] == 'free_access' && $GLOBALS['user']->id == 'nobody')) {
         $redirect_url = UrlHelper::getUrl('seminar_main.php', array('auswahl' => $this->course_id));
         if (Request::isXhr()) {
             $this->response->add_header('X-Location', $redirect_url);
             $this->render_nothing();
         } else {
             $this->redirect($redirect_url);
         }
         return false;
     }
     //Grundsätzlich verboten
     if (!$enrolment_info['enrolment_allowed']) {
         throw new AccessDeniedException($enrolment_info['description']);
     }
     PageLayout::setTitle($course->getFullname() . " - " . _("Veranstaltungsanmeldung"));
     PageLayout::addSqueezePackage('enrolment');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('X-No-Buttons', 1);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     $this->set_content_type('text/html;charset=windows-1252');
     if (Request::submitted('cancel')) {
         $this->redirect(URLHelper::getURL('dispatch.php/course/details/', array('sem_id' => $this->course_id)));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:49,代码来源:enrolment.php


示例12: before_filter

 function before_filter(&$action, &$args)
 {
     $this->current_action = $action;
     // allow only "word" characters in arguments
     $this->validate_args($args);
     parent::before_filter($action, $args);
     if ($this->with_session) {
         # open session
         page_open(array('sess' => 'Seminar_Session', 'auth' => $this->allow_nobody ? 'Seminar_Default_Auth' : 'Seminar_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
         // show login-screen, if authentication is "nobody"
         $GLOBALS['auth']->login_if((Request::get('again') || !$this->allow_nobody) && $GLOBALS['user']->id == 'nobody');
         // Setup flash instance
         $this->flash = Trails_Flash::instance();
         // set up user session
         include 'lib/seminar_open.php';
     }
     # Set base layout
     #
     # If your controller needs another layout, overwrite your controller's
     # before filter:
     #
     #   class YourController extends AuthenticatedController {
     #     function before_filter(&$action, &$args) {
     #       parent::before_filter($action, $args);
     #       $this->set_layout("your_layout");
     #     }
     #   }
     #
     # or unset layout by sending:
     #
     #   $this->set_layout(NULL)
     #
     $layout_file = Request::isXhr() ? 'layouts/dialog.php' : 'layouts/base.php';
     $layout = $GLOBALS['template_factory']->open($layout_file);
     $this->set_layout($layout);
     if ($this->encoding) {
         $this->set_content_type('text/html;charset=' . $this->encoding);
     }
     if (Request::isXhr() && $this->utf8decode_xhr) {
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:45,代码来源:studip_controller.php


示例13: before_filter

 /**
  * @see AuthenticatedController::before_filter
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
         PageLayout::setTitle(_('Anmeldesets'));
         Navigation::activateItem('/tools/coursesets');
     }
     $this->set_content_type('text/html;charset=windows-1252');
 }
开发者ID:ratbird,项目名称:hope,代码行数:21,代码来源:rule.php


示例14: before_filter

 /**
  * Callback function being called before an action is executed.
  */
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // AJAX request, so no page layout.
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
         // Open base layout for normal view
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
     }
     $this->set_content_type('text/html;charset=windows-1252');
     $this->help_admin = $GLOBALS['perm']->have_perm('root') || RolePersistence::isAssignedRole($GLOBALS['user']->id, 'Hilfe-Administrator(in)');
 }
开发者ID:ratbird,项目名称:hope,代码行数:22,代码来源:help_content.php


示例15: before_filter

 /**
  * @see AuthenticatedController::before_filter
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $this->via_ajax = false;
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
         PageLayout::setTitle(_('Verwaltung von Anmelderegeln'));
         Navigation::activateItem('/admin/config/admissionrules');
     }
     PageLayout::addSqueezePackage('admission');
     $this->set_content_type('text/html;charset=windows-1252');
 }
开发者ID:ratbird,项目名称:hope,代码行数:23,代码来源:ruleadministration.php


示例16: load

 /**
  * @todo Adjust this to db BEFORE release
  */
 public function load($identifier, $variables = array(), $language = null)
 {
     $language = $language ?: substr($GLOBALS['user']->preferred_language, 0, 2);
     $jsonfile = sprintf('%s/%s/%s.json', $this->json_directory, strtolower($language), $identifier);
     if (!file_exists($jsonfile) && $language !== 'de') {
         $language = 'de';
         $jsonfile = sprintf('%s/%s/%s.json', $this->json_directory, strtolower($language), $identifier);
     }
     if (!file_exists($jsonfile) || !is_readable($jsonfile)) {
         throw new InvalidArgumentException('Helpbar for identifier "' . $identifier . '" not found or not readable.');
     }
     $json = studip_utf8decode(json_decode(file_get_contents($jsonfile), true));
     if ($json === null) {
         throw new RuntimeException('Helpbar content for identifier "' . $identifier . '" could not be loaded.');
     }
     foreach ($json as $row) {
         if (!empty($row['icon'])) {
             $icon = Icon::create($row['icon'], 'info_alt');
         }
         $this->addPlainText($row['label'] ?: '', $this->interpolate($row['text'], $variables), $icon ?: null);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:25,代码来源:Helpbar.php


示例17: before_filter

 /**
  * @see AuthenticatedController::before_filter
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Request::isXhr()) {
         $this->via_ajax = true;
         $this->set_layout(null);
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $layout = $GLOBALS['template_factory']->open('layouts/base');
         $this->set_layout($layout);
         PageLayout::setTitle(_('Personenlisten'));
         Navigation::activateItem('/tools/coursesets/userlists');
     }
     PageLayout::addSqueezePackage('admission');
     $this->set_content_type('text/html;charset=windows-1252');
     $views = new ViewsWidget();
     $views->setTitle(_('Aktionen'));
     $views->addLink(_('Personenliste anlegen'), $this->url_for('admission/userlist/configure'))->setActive($action == 'configure');
     Sidebar::Get()->addWidget($views);
 }
开发者ID:ratbird,项目名称:hope,代码行数:26,代码来源:userlist.php


示例18: process_action

 public function process_action($process_id)
 {
     if (Request::isPost()) {
         if (Request::submitted("start")) {
             $protocol = array();
             $starttime = time();
             $this->process = FleximportProcess::find($process_id);
             $this->tables = $this->process->tables;
             foreach ($this->tables as $table) {
                 $table->fetchData();
             }
             foreach ($this->tables as $table) {
                 $table->doImport();
             }
             $duration = time() - $starttime;
             if ($duration >= 60) {
                 PageLayout::postMessage(MessageBox::success(sprintf(_("Import wurde durchgeführt und dauerte %s Minuten"), floor($duration / 60)), $protocol));
             } else {
                 PageLayout::postMessage(MessageBox::success(_("Import wurde durchgeführt"), $protocol));
             }
         } elseif ($_FILES['tableupload']) {
             foreach ($_FILES['tableupload']['tmp_name'] as $table_id => $tmp_name) {
                 if ($tmp_name) {
                     $table = new FleximportTable($table_id);
                     $output = $this->plugin->getCSVDataFromFile($tmp_name);
                     if ($table['tabledata']['source_encoding'] === "utf8") {
                         $output = studip_utf8decode($output);
                     }
                     $headline = array_shift($output);
                     $table->createTable($headline, $output);
                 }
             }
             PageLayout::postMessage(MessageBox::success(_("CSV-Datei hochgeladen")));
         }
     }
     $this->redirect("import/overview/" . $process_id);
 }
开发者ID:Krassmus,项目名称:Fleximport,代码行数:37,代码来源:import.php


示例19: post_files_action

 public function post_files_action()
 {
     $context = Request::option("context") ? Request::get("context") : $GLOBALS['user']->id;
     $context_type = Request::option("context_type");
     if (!Request::isPost() || $context_type === "course" && !$GLOBALS['perm']->have_studip_perm("autor", $context)) {
         throw new AccessDeniedException("Kein Zugriff");
     }
     //check folders
     $db = DBManager::get();
     $folder_id = md5("Blubber_" . $context . "_" . $GLOBALS['user']->id);
     $parent_folder_id = md5("Blubber_" . $context);
     if ($context_type !== "course") {
         $folder_id = $parent_folder_id;
     }
     $folder = $db->query("SELECT * " . "FROM folder " . "WHERE folder_id = " . $db->quote($folder_id) . " " . "")->fetch(PDO::FETCH_COLUMN, 0);
     if (!$folder) {
         $folder = $db->query("SELECT * " . "FROM folder " . "WHERE folder_id = " . $db->quote($parent_folder_id) . " " . "")->fetch(PDO::FETCH_COLUMN, 0);
         if (!$folder) {
             $db->exec("INSERT IGNORE INTO folder " . "SET folder_id = " . $db->quote($parent_folder_id) . ", " . "range_id = " . $db->quote($context) . ", " . "user_id = " . $db->quote($GLOBALS['user']->id) . ", " . "name = " . $db->quote("BlubberDateien") . ", " . "permission = '7', " . "mkdate = " . $db->quote(time()) . ", " . "chdate = " . $db->quote(time()) . " " . "");
         }
         if ($context_type === "course") {
             $db->exec("INSERT IGNORE INTO folder " . "SET folder_id = " . $db->quote($folder_id) . ", " . "range_id = " . $db->quote($parent_folder_id) . ", " . "user_id = " . $db->quote($GLOBALS['user']->id) . ", " . "name = " . $db->quote(get_fullname()) . ", " . "permission = '7', " . "mkdate = " . $db->quote(time()) . ", " . "chdate = " . $db->quote(time()) . " " . "");
         }
     }
     $output = array();
     foreach ($_FILES as $file) {
         $GLOBALS['msg'] = '';
         if ($context_type === "course") {
             validate_upload($file);
             if ($GLOBALS['msg']) {
                 $output['errors'][] = $file['name'] . ': ' . studip_utf8encode(html_entity_decode(trim(substr($GLOBALS['msg'], 6), '§')));
                 continue;
             }
         }
         if ($file['size']) {
             $document['name'] = $document['filename'] = studip_utf8decode(strtolower($file['name']));
             $document['user_id'] = $GLOBALS['user']->id;
             $document['author_name'] = get_fullname();
             $document['seminar_id'] = $context;
             $document['range_id'] = $context_type === "course" ? $folder_id : $parent_folder_id;
             $document['filesize'] = $file['size'];
             if ($newfile = StudipDocument::createWithFile($file['tmp_name'], $document)) {
                 $type = null;
                 strpos($file['type'], 'image') === false || ($type = "img");
                 strpos($file['type'], 'video') === false || ($type = "video");
                 if (strpos($file['type'], 'audio') !== false || strpos($document['filename'], '.ogg') !== false) {
                     $type = "audio";
                 }
                 $url = GetDownloadLink($newfile->getId(), $newfile['filename']);
                 if ($type) {
                     $output['inserts'][] = "[" . $type . "]" . $url;
                 } else {
                     $output['inserts'][] = "[" . $newfile['filename'] . "]" . $url;
                 }
             }
         }
     }
     $this->render_json($output);
 }
开发者ID:noackorama,项目名称:blubberforum,代码行数:59,代码来源:forum.php


示例20: fetchData

 /**
  * @see lib/classes/Config::fetchData()
  */
 protected function fetchData($data = null)
 {
     if ($data !== null) {
         $this->data = $data;
     } else {
         $this->data = array();
         foreach (Config::get()->getFields('user') as $field) {
             $this->data[$field] = Config::get()->{$field};
             $metadata[$field] = Config::get()->getMetadata($field);
         }
         $db = DbManager::get();
         $rs = $db->query("SELECT field, value FROM user_config WHERE user_id = " . $db->quote($this->user_id));
         while ($row = $rs->fetch(PDO::FETCH_ASSOC)) {
             switch ($metadata[$row['field']]['type']) {
                 case 'integer':
                     $value = (int) $row['value'];
                     break;
                 case 'boolean':
                     $value = (bool) $row['value'];
                     break;
                 case 'array':
                     $value = studip_utf8decode((array) json_decode($row['value'], true));
                     break;
                 default:
                     $value = $row['value'];
             }
             $this->data[$row['field']] = $value;
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:33,代码来源:UserConfig.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP studip_utf8encode函数代码示例发布时间:2022-05-23
下一篇:
PHP stub函数代码示例发布时间: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