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


PHP Sanitize::stripAll方法代码示例

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


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

示例1: saveTask

 /**
  * Saves changes to an order
  *
  * @return void
  */
 public function saveTask()
 {
     // Check for request forgeries
     Request::checkToken();
     $statusmsg = '';
     $data = array_map('trim', $_POST);
     $action = isset($data['action']) ? $data['action'] : '';
     $id = $data['id'] ? $data['id'] : 0;
     $cost = intval($data['total']);
     if ($id) {
         // initiate extended database class
         $row = new Order($this->database);
         $row->load($id);
         $row->notes = \Hubzero\Utility\Sanitize::clean($data['notes']);
         $hold = $row->total;
         $row->total = $cost;
         // get user bank account
         $xprofile = User::getInstance($row->uid);
         $BTL_Q = new Teller($this->database, $xprofile->get('id'));
         switch ($action) {
             case 'complete_order':
                 // adjust credit
                 $credit = $BTL_Q->credit_summary();
                 $adjusted = $credit - $hold;
                 $BTL_Q->credit_adjustment($adjusted);
                 // remove hold
                 $sql = "DELETE FROM `#__users_transactions` WHERE category='store' AND type='hold' AND referenceid='" . $id . "' AND uid=" . intval($row->uid);
                 $this->database->setQuery($sql);
                 if (!$this->database->query()) {
                     throw new Exception($this->database->getErrorMsg(), 500);
                 }
                 // debit account
                 if ($cost > 0) {
                     $BTL_Q->withdraw($cost, Lang::txt('COM_STORE_BANKING_PURCHASE') . ' #' . $id, 'store', $id);
                 }
                 // update order information
                 $row->status_changed = Date::toSql();
                 $row->status = 1;
                 $statusmsg = Lang::txt('COM_STORE_ORDER') . ' #' . $id . ' ' . Lang::txt('COM_STORE_HAS_BEEN') . ' ' . strtolower(Lang::txt('COM_STORE_COMPLETED')) . '.';
                 break;
             case 'cancel_order':
                 // adjust credit
                 $credit = $BTL_Q->credit_summary();
                 $adjusted = $credit - $hold;
                 $BTL_Q->credit_adjustment($adjusted);
                 // remove hold
                 $sql = "DELETE FROM `#__users_transactions` WHERE category='store' AND type='hold' AND referenceid='" . $id . "' AND uid=" . intval($row->uid);
                 $this->database->setQuery($sql);
                 if (!$this->database->query()) {
                     throw new Exception($this->database->getErrorMsg(), 500);
                 }
                 // update order information
                 $row->status_changed = Date::toSql();
                 $row->status = 2;
                 $statusmsg = Lang::txt('COM_STORE_ORDER') . ' #' . $id . ' ' . Lang::txt('COM_STORE_HAS_BEEN') . ' ' . strtolower(Lang::txt('COM_STORE_CANCELLED')) . '.';
                 break;
             case 'message':
                 $statusmsg = Lang::txt('COM_STORE_MSG_SENT') . '.';
                 break;
             default:
                 $statusmsg = Lang::txt('COM_STORE_ORDER_DETAILS_UPDATED') . '.';
                 break;
         }
         // check content
         if (!$row->check()) {
             throw new Exception($row->getError(), 500);
             return;
         }
         // store new content
         if (!$row->store()) {
             throw new Exception($row->getError(), 500);
         }
         // send email
         if ($action || $data['message']) {
             if (\Hubzero\Utility\Validate::email($row->email)) {
                 $message = new \Hubzero\Mail\Message();
                 $message->setSubject(Config::get('sitename') . ' ' . Lang::txt('COM_STORE_EMAIL_UPDATE_SHORT', $id));
                 $message->addFrom(Config::get('mailfrom'), Config::get('sitename') . ' ' . Lang::txt('COM_STORE_STORE'));
                 // Plain text email
                 $eview = new \Hubzero\Mail\View(array('name' => 'emails', 'layout' => '_plain'));
                 $eview->option = $this->_option;
                 $eview->controller = $this->_controller;
                 $eview->orderid = $id;
                 $eview->cost = $cost;
                 $eview->row = $row;
                 $eview->action = $action;
                 $eview->message = \Hubzero\Utility\Sanitize::stripAll($data['message']);
                 $plain = $eview->loadTemplate(false);
                 $plain = str_replace("\n", "\r\n", $plain);
                 $message->addPart($plain, 'text/plain');
                 // HTML email
                 $eview->setLayout('_html');
                 $html = $eview->loadTemplate();
                 $html = str_replace("\n", "\r\n", $html);
                 $message->addPart($html, 'text/html');
//.........这里部分代码省略.........
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:101,代码来源:orders.php

示例2: saveTask

 /**
  * Save an entry
  *
  * @return  void
  */
 public function saveTask()
 {
     // Check if they're logged in
     if (User::isGuest()) {
         $this->loginTask();
         return;
     }
     Request::checkToken();
     // get the posted vars
     $id = Request::getInt('id', 0, 'post');
     $c = Request::getVar('fields', array(), 'post');
     $c['id'] = $id;
     // clean vars
     foreach ($c as $key => $val) {
         if (!is_array($val)) {
             $val = html_entity_decode(urldecode($val));
             $val = Sanitize::stripAll($val);
             $c[$key] = Sanitize::clean($val);
         }
     }
     // Bind incoming data to object
     $row = new Citation($this->database);
     if (!$row->bind($c)) {
         $this->setError($row->getError());
         $this->editTask();
         return;
     }
     // New entry so set the created date
     if (!$row->id) {
         $row->created = Date::toSql();
     }
     if (!filter_var($row->url, FILTER_VALIDATE_URL)) {
         $row->url = null;
     }
     // Check content for missing required data
     if (!$row->check()) {
         $this->setError($row->getError());
         $this->editTask();
         return;
     }
     // Store new content
     if (!$row->store()) {
         $this->setError($row->getError());
         $this->editTask();
         return;
     }
     // Incoming associations
     $arr = Request::getVar('assocs', array(), 'post');
     $ignored = array();
     foreach ($arr as $a) {
         $a = array_map('trim', $a);
         // Initiate extended database class
         $assoc = new Association($this->database);
         //check to see if we should delete
         if (isset($a['id']) && $a['tbl'] == '' && $a['oid'] == '') {
             // Delete the row
             if (!$assoc->delete($a['id'])) {
                 $this->setError($assoc->getError());
                 $this->editTask();
                 return;
             }
         } else {
             if ($a['tbl'] != '' || $a['oid'] != '') {
                 $a['cid'] = $row->id;
                 // bind the data
                 if (!$assoc->bind($a)) {
                     $this->setError($assoc->getError());
                     $this->editTask();
                     return;
                 }
                 // Check content
                 if (!$assoc->check()) {
                     $this->setError($assoc->getError());
                     $this->editTask();
                     return;
                 }
                 // Store new content
                 if (!$assoc->store()) {
                     $this->setError($assoc->getError());
                     $this->editTask();
                     return;
                 }
             }
         }
     }
     //check if we are allowing tags
     if ($this->config->get('citation_allow_tags', 'no') == 'yes') {
         $tags = trim(Request::getVar('tags', '', 'post'));
         $ct1 = new Tags($row->id);
         $ct1->setTags($tags, User::get('id'), 0, 1, '');
     }
     //check if we are allowing badges
     if ($this->config->get('citation_allow_badges', 'no') == 'yes') {
         $badges = trim(Request::getVar('badges', '', 'post'));
         $ct2 = new Tags($row->id);
//.........这里部分代码省略.........
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:101,代码来源:citations.php

示例3: sendstoryTask

 /**
  * Save a success story and show a thank you message
  *
  * @return  void
  */
 public function sendstoryTask()
 {
     if (User::isGuest()) {
         $here = Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=' . $this->_task);
         App::redirect(Route::url('index.php?option=com_users&view=login&return=' . base64_encode($here)), Lang::txt('COM_FEEDBACK_STORY_LOGIN'), 'warning');
     }
     Request::checkToken();
     $fields = Request::getVar('fields', array(), 'post');
     $fields = array_map('trim', $fields);
     $fields['user_id'] = User::get('id');
     // Initiate class and bind posted items to database fields
     $row = Quote::oneOrNew(0)->set($fields);
     // Check that a story was entered
     if (!$row->get('quote')) {
         $this->setError(Lang::txt('COM_FEEDBACK_ERROR_MISSING_STORY'));
         return $this->storyTask($row);
     }
     // Check for an author
     if (!$row->get('fullname')) {
         $this->setError(Lang::txt('COM_FEEDBACK_ERROR_MISSING_AUTHOR'));
         return $this->storyTask($row);
     }
     // Check for an organization
     if (!$row->get('org')) {
         $this->setError(Lang::txt('COM_FEEDBACK_ERROR_MISSING_ORGANIZATION'));
         return $this->storyTask($row);
     }
     // Code cleaner for xhtml transitional compliance
     $row->set('quote', Sanitize::stripAll($row->get('quote')));
     $row->set('quote', str_replace('<br>', '<br />', $row->get('quote')));
     $row->set('date', Date::toSql());
     // Store new content
     if (!$row->save()) {
         $this->setError($row->getError());
         return $this->storyTask($row);
     }
     $addedPictures = array();
     $path = $row->filespace() . DS . $row->get('id');
     if (!is_dir($path)) {
         if (!Filesystem::makeDirectory($path)) {
             $this->setError(Lang::txt('COM_FEEDBACK_ERROR_UNABLE_TO_CREATE_UPLOAD_PATH'));
         }
     }
     // If there is a temp dir for this user then copy the contents to the newly created folder
     $tempDir = $this->tmpPath() . DS . User::get('id');
     if (is_dir($tempDir)) {
         $dirIterator = new DirectoryIterator($tempDir);
         foreach ($dirIterator as $file) {
             if ($file->isDot() || $file->isDir()) {
                 continue;
             }
             $name = $file->getFilename();
             if ($file->isFile()) {
                 if ('cvs' == strtolower($name) || '.svn' == strtolower($name)) {
                     continue;
                 }
                 if (Filesystem::move($tempDir . DS . $name, $path . DS . $name)) {
                     array_push($addedPictures, $name);
                 }
             }
         }
         // Remove temp folder
         Filesystem::deleteDirectory($tempDir);
     }
     $path = substr($row->filespace(), strlen(PATH_ROOT)) . DS . $row->get('id');
     // Set page title
     $this->_buildTitle();
     // Set the pathway
     $this->_buildPathway();
     // Output HTML
     $this->view->set('row', $row)->set('path', $path)->set('addedPictures', $addedPictures)->set('title', $this->_title)->setErrors($this->getErrors())->setLayout('thanks')->display();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:77,代码来源:feedback.php

示例4:

?>
								<?php 
echo 'Email: ' . $this->shipping['email'];
?>
</td>
							</tr>
							<?php 
if ($this->shipping['comments']) {
    ?>
							<tr>
								<th style="text-align: right; padding: 0 0.5em; font-weight: bold; white-space: nowrap; vertical-align: top;" align="right"><?php 
    echo Lang::txt('COM_STORE_DETAILS');
    ?>
:</th>
								<td style="text-align: left; padding: 0 0.5em; vertical-align: top;" width="100%" align="left"><?php 
    echo \Hubzero\Utility\Sanitize::stripAll($this->shipping['comments']);
    ?>
</td>
							</tr>
							<?php 
}
?>
						</tbody>
					</table>
				</td>
			</tr>
		</tbody>
	</table>

	<!-- Start Spacer -->
	<table class="tbl-spacer" width="100%" cellpadding="0" cellspacing="0" border="0">
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:confirmation_html.php

示例5: onIndex

 /**
  * onIndex 
  * 
  * @param string $type
  * @param integer $id 
  * @param boolean $run 
  * @access public
  * @return void
  */
 public function onIndex($type, $id, $run = false)
 {
     if ($type == 'wiki') {
         if ($run === true) {
             // Establish a db connection
             $db = App::get('db');
             // Sanitize the string
             $id = \Hubzero\Utility\Sanitize::paranoid($id);
             // Get the record
             $sql = "SELECT * FROM #__wiki_pages\n\t\t\t\t\tJOIN #__wiki_versions\n\t\t\t\t\tON #__wiki_pages.version_id = #__wiki_versions.id\n\t\t\t\t\tWHERE #__wiki_pages.id = {$id} AND #__wiki_pages.state = 1;";
             $row = $db->setQuery($sql)->query()->loadObject();
             // Get the name of the author
             $sql1 = "SELECT name FROM #__users WHERE id={$row->created_by};";
             $author = $db->setQuery($sql1)->query()->loadResult();
             // Get any tags
             $sql2 = "SELECT tag \n\t\t\t\t\tFROM #__tags\n\t\t\t\t\tLEFT JOIN #__tags_object\n\t\t\t\t\tON #__tags.id=#__tags_object.tagid\n\t\t\t\t\tWHERE #__tags_object.objectid = {$id} AND #__tags_object.tbl = 'wiki';";
             $tags = $db->setQuery($sql2)->query()->loadColumn();
             // Determine the path
             if ($row->scope == 'site') {
                 $path = '/wiki/' . $row->path;
             } elseif ($row->scope == 'group') {
                 $group = \Hubzero\User\Group::getInstance($row->scope_id);
                 // Make sure group is valid.
                 if (is_object($group)) {
                     $cn = $group->get('cn');
                     $path = '/groups/' . $cn . '/wiki/' . $row->path;
                 }
             } else {
                 // Only group and site wiki is supported right now
                 // @TODO: Project Notes
                 return;
             }
             // Public condition
             if ($row->state == 1 && ($row->access == 0 || ($row->access = 1))) {
                 $access_level = 'public';
             } elseif ($row->state == 1 && $row->access == 2) {
                 $access_level = 'registered';
             } else {
                 $access_level = 'private';
             }
             if ($row->scope != 'group') {
                 $owner_type = 'user';
                 $owner = $row->created_by;
             } else {
                 $owner_type = 'group';
                 $owner = $row->scope_id;
             }
             // Get the title
             $title = $row->title;
             // Build the description, clean up text
             $content = $row->pagehtml;
             $content = preg_replace('/<[^>]*>/', ' ', $content);
             $content = preg_replace('/ {2,}/', ' ', $content);
             $description = \Hubzero\Utility\Sanitize::stripAll($content);
             // Create a record object
             $record = new \stdClass();
             $record->id = $type . '-' . $id;
             $record->hubtype = $type;
             $record->title = $title;
             $record->description = $description;
             $record->author = array($author);
             $record->tags = $tags;
             $record->path = $path;
             $record->access_level = $access_level;
             $record->owner = $owner;
             $record->owner_type = $owner_type;
             // Return the formatted record
             return $record;
         } else {
             $db = App::get('db');
             $sql = "SELECT #__wiki_pages.id FROM #__wiki_pages\n\t\t\t\t\tJOIN #__wiki_versions\n\t\t\t\t\tON #__wiki_pages.version_id = #__wiki_versions.id\n\t\t\t\t\tWHERE #__wiki_pages.state = 1;";
             $ids = $db->setQuery($sql)->query()->loadColumn();
             return $ids;
         }
     }
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:85,代码来源:wiki.php

示例6: onIndex

 /**
  * onIndex 
  * 
  * @param string $type
  * @param integer $id 
  * @param boolean $run 
  * @access public
  * @return void
  */
 public function onIndex($type, $id, $run = false)
 {
     if ($type == 'event') {
         if ($run === true) {
             // Establish a db connection
             $db = App::get('db');
             // Sanitize the string
             $id = \Hubzero\Utility\Sanitize::paranoid($id);
             // Get the record
             $sql = "SELECT * FROM #__events WHERE id={$id};";
             $row = $db->setQuery($sql)->query()->loadObject();
             // Get the (start) date of the event
             // Format the date for SOLR
             $date = Date::of($row->publish_up)->format('Y-m-d');
             $date .= 'T';
             $date .= Date::of($row->publish_up)->format('h:m:s') . 'Z';
             // Get the name of the author
             $sql1 = "SELECT name FROM #__users WHERE id={$row->created_by};";
             $author = $db->setQuery($sql1)->query()->loadResult();
             // Get any tags
             $sql2 = "SELECT tag \n\t\t\t\t\tFROM #__tags\n\t\t\t\t\tLEFT JOIN #__tags_object\n\t\t\t\t\tON #__tags.id=#__tags_object.tagid\n\t\t\t\t\tWHERE #__tags_object.objectid = {$id} AND #__tags_object.tbl = 'events';";
             $tags = $db->setQuery($sql2)->query()->loadColumn();
             if ($row->scope == 'event' || $row->scope == '') {
                 $path = '/events/details/' . $row->id;
             } elseif ($row->scope == 'group') {
                 $group = \Hubzero\User\Group::getInstance($row->scope_id);
                 // Make sure group is valid.
                 if (is_object($group)) {
                     $cn = $group->get('cn');
                     $path = '/groups/' . $cn . '/calendar/details/' . $row->id;
                 } else {
                     $path = '';
                 }
             }
             // Public condition
             if ($row->state == 1 && $row->approved == 1 && $row->scope != 'group') {
                 $access_level = 'public';
             } else {
                 // Default private
                 $access_level = 'private';
             }
             if ($row->scope != 'group') {
                 $owner_type = 'user';
                 $owner = $row->created_by;
             } else {
                 $owner_type = 'group';
                 $owner = $row->scope_id;
             }
             // Get the title
             $title = $row->title;
             // Build the description, clean up text
             $content = preg_replace('/<[^>]*>/', ' ', $row->content);
             $content = preg_replace('/ {2,}/', ' ', $content);
             $description = \Hubzero\Utility\Sanitize::stripAll($content);
             // Format the date for SOLR
             $date = Date::of($row->publish_up)->format('Y-m-d');
             $date .= 'T';
             $date .= Date::of($row->publish_up)->format('h:m:s') . 'Z';
             // Create a record object
             $record = new \stdClass();
             $record->id = $type . '-' . $id;
             $record->hubtype = $type;
             $record->title = $title;
             $record->description = $description;
             $record->author = array($author);
             $record->tags = $tags;
             $record->path = $path;
             $record->access_level = $access_level;
             $record->date = $date;
             $record->owner = $owner;
             $record->owner_type = $owner_type;
             // Return the formatted record
             return $record;
         } else {
             $db = App::get('db');
             $sql = "SELECT id FROM #__events;";
             $ids = $db->setQuery($sql)->query()->loadColumn();
             return $ids;
         }
     }
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:90,代码来源:events.php

示例7: ucfirst

     // Does this category have a unique output display?
     $func = 'plgWhatsnew' . ucfirst($row->section) . 'Out';
     // Check if a method exist (using JPlugin style)
     $obj = 'plgWhatsnew' . ucfirst($this->cats[$k]['category']);
     if (function_exists($func)) {
         $html .= $func($row, $this->period);
     } elseif (method_exists($obj, 'out')) {
         $html .= call_user_func(array($obj, 'out'), $row, $this->period);
     } else {
         if (strstr($row->href, 'index.php')) {
             $row->href = Route::url($row->href);
         }
         $html .= "\t" . '<li>' . "\n";
         $html .= "\t\t" . '<p class="title"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a></p>' . "\n";
         if ($row->text) {
             $html .= "\t\t" . '<p>' . \Hubzero\Utility\String::truncate(strip_tags(\Hubzero\Utility\Sanitize::stripAll(stripslashes($row->text))), 200) . '</p>' . "\n";
         }
         $html .= "\t\t" . '<p class="href">' . rtrim(Request::getSchemeAndHttpHost(), '/') . '/' . ltrim($row->href, '/') . '</p>' . "\n";
         $html .= "\t" . '</li>' . "\n";
     }
 }
 $html .= '</ol>' . "\n";
 // Initiate paging if we we're displaying an active category
 if ($dopaging) {
     $pageNav = $this->pagination($this->total, $this->start, $this->limit);
     $pageNav->setAdditionalUrlParam('category', urlencode(strToLower($this->active)));
     $pageNav->setAdditionalUrlParam('period', $this->period);
     $html .= $pageNav->render();
     $html .= '<div class="clearfix"></div>';
 } else {
     $html .= '<p class="moreresults">' . Lang::txt('COM_WHATSNEW_TOP_SHOWN', $amt);
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:display.php

示例8: onIndex

 /**
  * onIndex 
  * 
  * @param string $type
  * @param integer $id 
  * @param boolean $run 
  * @access public
  * @return void
  */
 public function onIndex($type, $id, $run = false)
 {
     if ($type == 'citation') {
         if ($run === true) {
             // Establish a db connection
             $db = App::get('db');
             // Sanitize the string
             $id = \Hubzero\Utility\Sanitize::paranoid($id);
             // Get the record
             $sql = "SELECT * FROM #__citations WHERE id={$id};";
             $row = $db->setQuery($sql)->query()->loadObject();
             // Obtain list of related authors
             $sql1 = "SELECT author FROM #__citations_authors WHERE cid={$id};";
             $authors = $db->setQuery($sql1)->query()->loadColumn();
             // Get any tags
             $sql2 = "SELECT tag \n\t\t\t\t\tFROM #__tags\n\t\t\t\t\tLEFT JOIN #__tags_object\n\t\t\t\t\tON #__tags.id=#__tags_object.tagid\n\t\t\t\t\tWHERE #__tags_object.objectid = {$id} AND #__tags_object.tbl = 'citations';";
             $tags = $db->setQuery($sql2)->query()->loadColumn();
             // Determine the path
             if ($row->scope == 'member') {
                 $path = '/members/' . $row->scope_id . '/citations';
             } elseif ($row->scope == 'group') {
                 $group = \Hubzero\User\Group::getInstance($row->scope_id);
                 // Make sure group is valid.
                 if (is_object($group)) {
                     $cn = $group->get('cn');
                     $path = '/groups/' . $cn . '/citations';
                 } else {
                     $path = '';
                 }
             } else {
                 $path = '/citations/view/' . $id;
             }
             $access_level = 'public';
             if ($row->scope != 'group') {
                 $owner_type = 'user';
                 $owner = $row->uid;
             } else {
                 $owner_type = 'group';
                 $owner = $row->scope_id;
             }
             // Get the title
             $title = $row->title;
             // Build the description, clean up text
             $content = $row->address . ' ' . $row->author . ' ' . $row->booktitle . ' ' . $row->chapter . ' ' . $row->cite . ' ' . $row->edition . ' ' . $row->eprint . ' ' . $row->howpublished . ' ' . $row->institution . ' ' . $row->isbn . ' ' . $row->journal . ' ' . $row->month . ' ' . $row->note . ' ' . $row->number . ' ' . $row->organization . ' ' . $row->pages . ' ' . $row->publisher . ' ' . $row->series . ' ' . $row->school . ' ' . $row->title . ' ' . $row->url . ' ' . $row->volume . ' ' . $row->year . ' ' . $row->doi . ' ' . $row->ref_type . ' ' . $row->date_submit . ' ' . $row->date_accept . ' ' . $row->date_publish . ' ' . $row->software_use . ' ' . $row->notes . ' ' . $row->language . ' ' . $row->label . ' ';
             $content = preg_replace('/<[^>]*>/', ' ', $content);
             $content = preg_replace('/ {2,}/', ' ', $content);
             $description = \Hubzero\Utility\Sanitize::stripAll($content);
             // Create a record object
             $record = new \stdClass();
             $record->id = $type . '-' . $id;
             $record->hubtype = $type;
             $record->title = $title;
             $record->description = $description;
             $record->author = $authors;
             $record->tags = $tags;
             $record->path = $path;
             $record->access_level = $access_level;
             $record->owner = $owner;
             $record->owner_type = $owner_type;
             // Return the formatted record
             return $record;
         } else {
             $db = App::get('db');
             $sql = "SELECT id FROM #__citations;";
             $ids = $db->setQuery($sql)->query()->loadColumn();
             return $ids;
         }
     }
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:78,代码来源:citations.php

示例9: out

 /**
  * Special formatting for results
  *
  * @param      object $row    Database row
  * @param      string $period Time period
  * @return     string
  */
 public static function out($row, $period)
 {
     $database = App::get('db');
     $config = Component::params('com_publications');
     // Get version authors
     $pa = new \Components\Publications\Tables\Author($database);
     $authors = $pa->getAuthors($row->version_id);
     // Start building HTML
     $html = "\t" . '<li class="publication">' . "\n";
     $html .= "\t\t" . '<p><span class="pub-thumb"><img src="' . Route::url('index.php?option=com_publications&id=' . $row->id . '&v=' . $row->version_id) . '/Image:thumb' . '" alt="" /></span>';
     $html .= '<span class="pub-details"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a>' . "\n";
     $html .= "\t\t" . '<span class="block details">' . Date::of($row->published_up)->toLocal('d M Y') . ' <span>|</span> ' . $row->cat_name;
     if ($authors) {
         $html .= ' <span>|</span> ' . Lang::txt('PLG_WHATSNEW_PUBLICATIONS_CONTRIBUTORS') . ' ' . \Components\Publications\Helpers\Html::showContributors($authors, false, true);
     }
     $html .= '</span></span></p>' . "\n";
     if ($row->text) {
         $html .= "\t\t" . '<p>' . \Hubzero\Utility\String::truncate(\Hubzero\Utility\Sanitize::stripAll(stripslashes($row->text)), 200) . '</p>' . "\n";
     }
     $html .= "\t\t" . '<p class="href">' . Request::base() . trim($row->href, '/') . '</p>' . "\n";
     $html .= "\t" . '</li>' . "\n";
     // Return output
     return $html;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:publications.php

示例10: array

	<p class="details">
		<?php 
$info = array();
if ($thedate) {
    $info[] = $thedate;
}
if ($this->line->type && $params->get('show_type') || $this->line->standalone == 1) {
    $info[] = stripslashes($this->line->typetitle);
}
if ($helper->contributors && $params->get('show_authors')) {
    $info[] = Lang::txt('COM_RESOURCES_CONTRIBUTORS') . ': ' . $helper->contributors;
}
echo implode(' <span>|</span> ', $info);
?>
	</p>
	<p>
		<?php 
$content = '';
if ($this->line->introtext) {
    $content = $this->line->introtext;
} else {
    if ($this->line->fulltxt) {
        $content = $this->line->fulltxt;
        $content = preg_replace("#<nb:(.*?)>(.*?)</nb:(.*?)>#s", '', $content);
        $content = trim($content);
    }
}
echo \Hubzero\Utility\String::truncate(strip_tags(\Hubzero\Utility\Sanitize::stripAll(stripslashes($content))), 300);
?>
	</p>
</li>
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:31,代码来源:item.php

示例11: out

 /**
  * Special formatting for results
  * 
  * @param      object $row    Database row
  * @param      string $period Time period
  * @return     string
  */
 public static function out($row, $period)
 {
     if (strstr($row->href, 'index.php')) {
         $row->href = Route::url($row->href);
     }
     $html = "\t" . '<li>' . "\n";
     $html .= "\t\t" . '<p class="title"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a></p>' . "\n";
     if ($row->text) {
         $html .= "\t\t" . '<p>' . \Hubzero\Utility\String::truncate(\Hubzero\Utility\Sanitize::stripAll(stripslashes($row->text)), 200) . '</p>' . "\n";
     }
     $html .= "\t\t" . '<p class="href">' . Request::base() . ltrim($row->href, '/') . '</p>' . "\n";
     $html .= "\t" . '</li>' . "\n";
     // Return output
     return $html;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:22,代码来源:content.php

示例12: _save

 /**
  * Save item
  *
  * @return  string
  */
 protected function _save()
 {
     if (User::isGuest()) {
         $this->setError(Lang::txt('MEMBERS_LOGIN_NOTICE'));
         return;
     }
     if (User::get('id') != $this->member->get('id')) {
         $this->setError(Lang::txt('PLG_MEMBERS_TODO_NOT_AUTHORIZED'));
         return $this->_browse();
     }
     // Check for request forgeries
     Request::checkToken();
     // Incoming
     $content = Request::getVar('content', '');
     $projectid = Request::getInt('projectid', 0);
     $due = trim(Request::getVar('due', ''));
     $model = new \Components\Projects\Models\Project($projectid);
     if (!$content) {
         $this->setError(Lang::txt('PLG_MEMBERS_TODO_ERROR_PROVIDE_CONTENT'));
         return $this->_browse();
     }
     if (!$model->exists() || !$model->access('content')) {
         $this->setError(Lang::txt('PLG_MEMBERS_TODO_ERROR_ACCESS_PROJECT'));
         return $this->_browse();
     }
     // Initiate extended database class
     $objTD = new \Components\Projects\Tables\Todo($this->database);
     $content = rtrim(stripslashes($content));
     $objTD->content = $content ? $content : $objTD->content;
     $objTD->content = \Hubzero\Utility\Sanitize::stripAll($objTD->content);
     $objTD->created_by = $this->member->get('id');
     $objTD->created = Date::toSql();
     $objTD->projectid = $model->get('id');
     if (strlen($objTD->content) > 255) {
         $objTD->details = $objTD->content;
     }
     $objTD->content = \Hubzero\Utility\String::truncate($objTD->content, 255);
     if ($due && $due != 'mm/dd/yyyy') {
         $date = explode('/', $due);
         if (count($date) == 3) {
             $month = $date[0];
             $day = $date[1];
             $year = $date[2];
             if (intval($month) && intval($day) && intval($year)) {
                 if (strlen($day) == 1) {
                     $day = '0' . $day;
                 }
                 if (strlen($month) == 1) {
                     $month = '0' . $month;
                 }
                 if (checkdate($month, $day, $year)) {
                     $objTD->duedate = Date::of(mktime(0, 0, 0, $month, $day, $year))->toSql();
                 }
             }
         }
     } else {
         $objTD->duedate = '';
     }
     // Get last order
     $lastorder = $objTD->getLastOrder($model->get('id'));
     $objTD->priority = $lastorder ? $lastorder + 1 : 1;
     // Store content
     if (!$objTD->store()) {
         $this->setError($objTD->getError());
         return $this->_browse();
     } else {
         // Record activity
         $aid = $model->recordActivity(Lang::txt('PLG_MEMBERS_TODO_ACTIVITY_TODO_ADDED'), $objTD->id, 'to do', Route::url('index.php?option=com_projects&alias=' . $model->get('alias') . '&active=todo&action=view&todoid=' . $objTD->id), 'todo', 1);
         // Store activity ID
         if ($aid) {
             $objTD->activityid = $aid;
             $objTD->store();
         }
     }
     App::redirect(Route::url($this->member->link() . '&active=' . $this->_name), Lang::txt('PLG_MEMBERS_TODO_SAVED'));
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:81,代码来源:todo.php

示例13: out

 /**
  * Static method for formatting results
  *
  * @param      object $row Database row
  * @return     string HTML
  */
 public static function out($row)
 {
     require_once \Component::path('com_members') . DS . 'models' . DS . 'member.php';
     $member = \Components\Members\Models\Member::oneOrNew($row->id);
     $row->href = Route::url($member->link());
     $html = "\t" . '<li class="member">' . "\n";
     $html .= "\t\t" . '<p class="photo"><img width="50" height="50" src="' . $member->picture() . '" alt="" /></p>' . "\n";
     $html .= "\t\t" . '<p class="title"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a></p>' . "\n";
     if ($row->ftext) {
         $html .= "\t\t" . \Hubzero\Utility\String::truncate(\Hubzero\Utility\Sanitize::stripAll(stripslashes($row->ftext)), 200) . "\n";
     }
     $html .= "\t\t" . '<p class="href">' . Request::base() . ltrim($row->href, '/') . '</p>' . "\n";
     $html .= "\t" . '</li>' . "\n";
     return $html;
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:21,代码来源:members.php

示例14: _feedItem

 /**
  * Recursive function to append comments to a feed
  *
  * @param   object  $comments
  * @return  void
  */
 protected function _feedItem($comments)
 {
     foreach ($comments as $comment) {
         // Load individual item creator class
         $item = new \Hubzero\Document\Type\Feed\Item();
         $item->author = Lang::txt('COM_KB_ANONYMOUS');
         if (!$comment->get('anonymous')) {
             $item->author = $comment->creator('name', $item->author);
         }
         // Prepare the title
         $item->title = Lang::txt('COM_KB_COMMENTS_RSS_COMMENT_TITLE', $item->author) . ' @ ' . $comment->created('time') . ' on ' . $comment->created('date');
         // URL link to article
         $item->link = $feed->link . '#c' . $comment->get('id');
         // Strip html from feed item description text
         if ($comment->isReported()) {
             $item->description = Lang::txt('COM_KB_COMMENT_REPORTED_AS_ABUSIVE');
         } else {
             $item->description = html_entity_decode(\Hubzero\Utility\Sanitize::stripAll($comment->content('clean')));
         }
         $item->date = $comment->created();
         $item->category = '';
         // Loads item info into rss array
         Document::addItem($item);
         if ($comment->replies()->total()) {
             $this->_feedItem($comment->replies());
         }
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:34,代码来源:articles.php

示例15: addComment

 /**
  * Save comment
  *
  * @param      integer $itemid
  * @param      string $tbl
  * @param      string $comment
  * @param      integer $by
  * @param      integer $parent_activity
  * @param      integer $admin
  * @return     integer (comment id) or false
  */
 public function addComment($itemid = NULL, $tbl = '', $comment = '', $by = 0, $parent_activity = 0, $admin = 0)
 {
     if (!$itemid || !$tbl || !$by || !$comment || !$parent_activity) {
         return false;
     }
     $comment = \Hubzero\Utility\String::truncate($comment, 250);
     $comment = \Hubzero\Utility\Sanitize::stripAll($comment);
     $this->itemid = $itemid;
     $this->tbl = $tbl;
     $this->parent_activity = $parent_activity;
     $this->comment = $comment;
     $this->admin = $admin;
     $this->created = \Factory::getDate()->toSql();
     $this->created_by = $by;
     if (!$this->store()) {
         return false;
     } else {
         return $this->id;
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:comment.php


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