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

PHP Utility\String类代码示例

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

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



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

示例1: __invoke

 /**
  * Highlight some text
  *
  * @param   string   $text     Text to find phrases in
  * @param   integer  $phrase   Phrase to highlight
  * @param   array    $options  Options for highlighting
  * @return  string
  * @throws  \InvalidArgumentException If no text was passed
  */
 public function __invoke($text = null, $phrase = null, $options = array())
 {
     if (null === $text) {
         throw new \InvalidArgumentException(__METHOD__ . '(); No text passed.');
     }
     return String::highlight($text, $phrase, $options);
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:16,代码来源:Highlight.php


示例2: __invoke

 /**
  * Obfuscate some text
  *
  * @param   string  $text  Text to obfuscate
  * @return  string
  * @throws  \InvalidArgumentException If no text passed
  */
 public function __invoke($text = null)
 {
     if (null === $text) {
         throw new \InvalidArgumentException(__METHOD__ . '(); No text passed.');
     }
     return String::obfuscate($text);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:14,代码来源:Obfuscate.php


示例3: __invoke

 /**
  * Truncate some text
  *
  * @param   string   $text     Text to truncate
  * @param   integer  $length   Length to truncate to
  * @param   array    $options  Options
  * @return  string
  * @throws  \InvalidArgumentException If no text is passed or length isn't a positive integer
  */
 public function __invoke($text = null, $length = null, $options = array())
 {
     if (null === $text) {
         throw new \InvalidArgumentException(__METHOD__ . '(); No text passed.');
     }
     if (!$length || !is_numeric($length)) {
         throw new \InvalidArgumentException(__METHOD__ . '(); Length must be an integer');
     }
     return String::truncate($text, $length, $options);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:19,代码来源:Truncate.php


示例4: __construct

 /**
  * Constructor
  *
  * @param      integer $scope_id Scope ID (group, course, etc.)
  * @return     void
  */
 public function __construct($scope_id = 0)
 {
     $this->set('scope_id', $scope_id);
     $this->_segments['id'] = $scope_id;
     $this->_segments['active'] = 'blog';
     $this->_item = Profile::getInstance($scope_id);
     $config = Plugin::params('members', 'blog');
     $id = String::pad($this->get('scope_id'));
     $this->set('path', str_replace('{{uid}}', $id, $config->get('uploadpath', '/site/members/{{uid}}/blog')));
     $this->set('scope', $this->get('scope_id') . '/blog');
     $this->set('option', $this->_segments['option']);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:18,代码来源:member.php


示例5: check

 /**
  * Validate data
  *
  * @return  boolean  True if data is valid
  */
 public function check()
 {
     $this->message = trim($this->message);
     if ($this->message == '') {
         $this->setError(Lang::txt('SUPPORT_ERROR_BLANK_FIELD'));
         return false;
     }
     $this->title = trim($this->title);
     if (!$this->title) {
         $this->title = String::truncate($this->message, 250);
     }
     return true;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:18,代码来源:message.php


示例6: __construct

 /**
  * Constructor
  *
  * @param   integer  $scope_id  Scope ID (group, course, etc.)
  * @return  void
  */
 public function __construct($scope_id = 0)
 {
     $this->set('scope_id', $scope_id);
     include_once PATH_CORE . DS . 'components' . DS . 'com_courses' . DS . 'models' . DS . 'courses.php';
     $offering = \Components\Courses\Models\Offering::getInstance($this->get('scope_id'));
     $course = \Components\Courses\Models\Course::getInstance($offering->get('course_id'));
     $this->_segments['gid'] = $course->get('alias');
     $this->_segments['offering'] = $offering->alias();
     $this->_segments['active'] = 'discussions';
     if (Request::getVar('active') == 'outline') {
         $this->_segments['active'] = 'outline';
     }
     $this->_name = String::truncate($course->get('alias'), 50) . ': ' . String::truncate($offering->get('alias'), 50);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:20,代码来源:course.php


示例7: parse

 /**
  * Parse Document Content
  *
  * @return  void
  */
 public function parse()
 {
     // check to make sure we have content
     if (!$this->get('document')) {
         App::abort(406, '\\Components\\Groups\\Helpers\\Document: Requires document to parse');
     }
     // parse content
     // get all group includes
     if (preg_match_all('#<group:include([^>]*)/>#', $this->get('document'), $matches)) {
         // get number of matches
         $count = count($matches[1]);
         //loop through each match
         for ($i = 0; $i < $count; $i++) {
             $attribs = String::parseAttributes($matches[1][$i]);
             $type = isset($attribs['type']) ? strtolower(trim($attribs['type'])) : null;
             $name = isset($attribs['name']) ? $attribs['name'] : $type;
             unset($attribs['type']);
             $params = $attribs;
             $this->_tags[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'params' => $params);
         }
     }
     // return this
     return $this;
 }
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:29,代码来源:document.php


示例8: content

 /**
  * Get the content of the entry
  *
  * @param	   string  $as		Format to return state in [text, number]
  * @param	   integer $shorten Number of characters to shorten text to
  * @return	   string
  */
 public function content($as = 'parsed', $shorten = 0)
 {
     $as = strtolower($as);
     $options = array();
     switch ($as) {
         case 'parsed':
             $content = $this->get('comment.parsed', null);
             if ($content === null) {
                 $config = array('option' => $this->get('option', 'com_projects'), 'scope' => $this->get('scope'), 'pagename' => $this->get('alias'), 'pageid' => 0, 'filepath' => $this->get('path'), 'domain' => '');
                 $content = str_replace(array('\\"', "\\'"), array('"', "'"), (string) $this->get('comment', ''));
                 $this->importPlugin('content')->trigger('onContentPrepare', array($this->_context, &$this, &$config));
                 $this->set('comment.parsed', (string) $this->get('comment', ''));
                 $this->set('comment', $content);
                 return $this->content($as, $shorten);
             }
             $options['html'] = true;
             break;
         case 'clean':
             $content = strip_tags($this->content('parsed'));
             break;
         case 'raw':
         default:
             $content = str_replace(array('\\"', "\\'"), array('"', "'"), $this->get('comment'));
             $content = preg_replace('/^(<!-- \\{FORMAT:.*\\} -->)/i', '', $content);
             break;
     }
     if ($shorten) {
         $content = \Hubzero\Utility\String::truncate($content, $shorten, $options);
     }
     return $content;
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:38,代码来源:comment.php


示例9: transferItem

 /**
  * Retrieves a row from the database
  *
  * @param      string $refid    ID of the database table row
  * @param      string $category Element type (determines table to look in)
  * @param      string $parent   If the element has a parent element
  * @return     array
  */
 public function transferItem($from_type, $from_id, $to_type, $rid = 0, $deactivate = 1)
 {
     $upconfig = Component::params('com_members');
     $this->banking = $upconfig->get('bankAccounts');
     $database = App::get('db');
     if ($from_type == NULL or $from_id == NULL or $to_type == NULL) {
         $this->setError(Lang::txt('PLG_SUPPORT_TRANSFER_ERROR_MISSING_INFO'));
         return false;
     }
     if ($from_type == $to_type) {
         $this->setError(Lang::txt('PLG_SUPPORT_TRANSFER_ERROR_CATEGORIES_MUST_BE_DIFFERENT'));
         return false;
     }
     // collectors
     $author = '';
     $subject = '';
     $body = '';
     $tags = '';
     $owner = '';
     // name of group owning the item
     $anonymous = 0;
     // get needed scripts
     include_once PATH_CORE . DS . 'components' . DS . 'com_support' . DS . 'models' . DS . 'ticket.php';
     include_once PATH_CORE . DS . 'components' . DS . 'com_answers' . DS . 'models' . DS . 'question.php';
     include_once PATH_CORE . DS . 'components' . DS . 'com_wishlist' . DS . 'models' . DS . 'wishlist.php';
     $wconfig = Component::params('com_wishlist');
     $admingroup = $wconfig->get('group') ? $wconfig->get('group') : 'hubadmin';
     // Get needed scripts & initial data
     switch ($from_type) {
         // Transfer from a Support Ticket
         case 'ticket':
             $row = new \Components\Support\Models\Ticket($from_id);
             if ($row->exists()) {
                 $author = $row->get('login');
                 $subject = $row->content('raw', 200);
                 // max 200 characters
                 $body = $row->get('summary');
                 $owner = $row->get('group');
                 // If we are de-activating original item
                 if ($deactivate) {
                     $row->set('status', 2);
                     $row->set('resolved', 'transfered');
                 }
                 $tags = $row->tags('string');
             } else {
                 $this->setError(Lang::txt('PLG_SUPPORT_TRANSFER_ERROR_ITEM_NOT_FOUND'));
                 return false;
             }
             break;
             // Transfer from a Question
         // Transfer from a Question
         case 'question':
             $row = new \Components\Answers\Models\Question($from_id);
             if ($row->exists()) {
                 $author = $row->get('created_by');
                 $subject = $row->subject('raw', 200);
                 // max 200 characters
                 $body = $row->get('question');
                 $anonymous = $row->get('anonymous');
                 // If we are de-activating original item
                 if ($deactivate) {
                     $row->set('state', 2);
                     $row->set('reward', 0);
                 }
                 $tags = $row->tags('string');
             } else {
                 $this->setError(Lang::txt('PLG_SUPPORT_TRANSFER_ERROR_ITEM_NOT_FOUND'));
                 return false;
             }
             break;
             // Transfer from a Wish
         // Transfer from a Wish
         case 'wish':
             $row = new \Components\Wishlist\Tables\Wish($database);
             $row->load($from_id);
             if ($row->id) {
                 $author = $row->proposed_by;
                 $subject = \Hubzero\Utility\String::truncate($row->subject, 200);
                 // max 200 characters
                 $body = $row->about;
                 $anonymous = $row->anonymous;
                 // If we are de-activating original item
                 if ($deactivate) {
                     $row->status = 2;
                     $row->ranking = 0;
                     // also delete all previous votes for this wish
                     $objR = new \Components\Wishlist\Tables\Rank($database);
                     $objR->remove_vote($from_id);
                 }
                 // get owner
                 $objG = new \Components\Wishlist\Tables\OwnerGroup($database);
                 $nativegroups = $objG->get_owner_groups($row->wishlist, $admingroup, '', 1);
//.........这里部分代码省略.........
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:101,代码来源:transfer.php


示例10: _process

 /**
  * Process data
  *
  * @return     void
  */
 protected function _process()
 {
     // New project?
     $new = $this->model->exists() ? false : true;
     // Are we in setup?
     $setup = $new || $this->model->inSetup() ? true : false;
     // Incoming
     $private = Request::getInt('private', 1);
     // Save section
     switch ($this->section) {
         case 'describe':
         case 'info':
             // Incoming
             $name = trim(Request::getVar('name', '', 'post'));
             $title = trim(Request::getVar('title', '', 'post'));
             $name = preg_replace('/ /', '', $name);
             $name = strtolower($name);
             // Clean up title from any scripting
             $title = preg_replace('/\\s+/', ' ', $title);
             $title = $this->_txtClean($title);
             // Check incoming data
             if ($setup && $new && !$this->model->check($name, $this->model->get('id'))) {
                 $this->setError(Lang::txt('COM_PROJECTS_ERROR_NAME_INVALID_OR_EMPTY'));
                 return false;
             } elseif (!$title) {
                 $this->setError(Lang::txt('COM_PROJECTS_ERROR_TITLE_SHORT_OR_EMPTY'));
                 return false;
             }
             if ($this->model->exists()) {
                 $this->model->set('modified', Date::toSql());
                 $this->model->set('modified_by', User::get('id'));
             } else {
                 $this->model->set('alias', $name);
                 $this->model->set('created', Date::toSql());
                 $this->model->set('created_by_user', User::get('id'));
                 $this->model->set('owned_by_group', $this->_gid);
                 $this->model->set('owned_by_user', User::get('id'));
                 $this->model->set('private', $this->config->get('privacy', 1));
             }
             $this->model->set('title', \Hubzero\Utility\String::truncate($title, 250));
             $this->model->set('about', trim(Request::getVar('about', '', 'post', 'none', 2)));
             $this->model->set('type', Request::getInt('type', 1, 'post'));
             // save advanced permissions
             if (isset($_POST['private'])) {
                 $this->model->set('private', $private);
             }
             if ($setup && !$this->model->exists()) {
                 // Copy params from default project type
                 $objT = $this->model->table('Type');
                 $this->model->set('params', $objT->getParams($this->model->get('type')));
             }
             // Save changes
             if (!$this->model->store()) {
                 $this->setError($this->model->getError());
                 return false;
             }
             // Save owners for new projects
             if ($new) {
                 $this->_identifier = $this->model->get('alias');
                 // Group owners
                 $objO = $this->model->table('Owner');
                 if ($this->_gid) {
                     if (!$objO->saveOwners($this->model->get('id'), User::get('id'), 0, $this->_gid, 0, 1, 1, '', $split_group_roles = 0)) {
                         $this->setError(Lang::txt('COM_PROJECTS_ERROR_SAVING_AUTHORS') . ': ' . $objO->getError());
                         return false;
                     }
                     // Make sure project creator is manager
                     $objO->reassignRole($this->model->get('id'), $users = array(User::get('id')), 0, 1);
                 } elseif (!$objO->saveOwners($this->model->get('id'), User::get('id'), User::get('id'), $this->_gid, 1, 1, 1)) {
                     $this->setError(Lang::txt('COM_PROJECTS_ERROR_SAVING_AUTHORS') . ': ' . $objO->getError());
                     return false;
                 }
             }
             break;
         case 'team':
             if ($new) {
                 return false;
             }
             // Save team
             $content = Event::trigger('projects.onProject', array($this->model, 'save', array('team')));
             if (isset($content[0]) && $this->next == $this->section) {
                 if (isset($content[0]['msg']) && !empty($content[0]['msg'])) {
                     $this->_setNotification($content[0]['msg']['message'], $content[0]['msg']['type']);
                 }
             }
             break;
         case 'settings':
             if ($new) {
                 return false;
             }
             // Save privacy
             if (isset($_POST['private'])) {
                 $this->model->set('private', $private);
                 // Save changes
                 if (!$this->model->store()) {
//.........这里部分代码省略.........
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:101,代码来源:setup.php


示例11: out

 /**
  * Static method for formatting results
  *
  * @param      object $row Database row
  * @return     string HTML
  */
 public static function out($row)
 {
     $row->href = Route::url($row->href);
     $month = Date::of($row->publish_up)->toLocal('M');
     $day = Date::of($row->publish_up)->toLocal('d');
     $year = Date::of($row->publish_up)->toLocal('Y');
     // Start building the HTML
     $html = "\t" . '<li class="event">' . "\n";
     $html .= "\t\t" . '<p class="event-date"><span class="month">' . $month . '</span> <span class="day">' . $day . '</span> <span class="year">' . $year . '</span></p>' . "\n";
     $html .= "\t\t" . '<p class="title"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a></p>' . "\n";
     if ($row->ftext) {
         $row->ftext = str_replace('[[BR]]', '', $row->ftext);
         // Remove tags to prevent tables from being displayed within a table.
         $row->ftext = strip_tags($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() . trim($row->href, '/') . '</p>' . "\n";
     $html .= "\t" . '</li>' . "\n";
     // Return output
     return $html;
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:27,代码来源:events.php


示例12: ucfirst

}
?>
	<?php 
if ($this->row->isComplete()) {
    ?>
 &raquo; <span class="indlist completedtd"><a href="<?php 
    echo Route::url($url) . '/?state=1';
    ?>
"><?php 
    echo ucfirst(Lang::txt('PLG_PROJECTS_TODO_COMPLETED'));
    ?>
</a></span> <?php 
}
?>
	&raquo; <span class="itemname"><?php 
echo \Hubzero\Utility\String::truncate($this->row->get('content'), 60);
?>
</span>
	</h3>
</div>

<div class="pinboard">
		<section class="section intropage">
			<div class="grid">
				<div class="col span8">
					<div id="td-item" class="<?php 
echo $class;
?>
">
						<span class="pin">&nbsp;</span>
						<div class="todo-content">
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:default.php


示例13:

				<?php 
    if ($this->params->get('access_email', 2) == 0 || $this->params->get('access_email', 2) == 1 && $loggedin || $this->params->get('access_email', 2) == 2 && $isUser) {
        ?>
					<li class="profile-email field">
						<div class="field-content">
							<div class="key"><?php 
        echo Lang::txt('PLG_GROUPS_PROFILE_EMAIL');
        ?>
</div>
							<div class="value">
								<a class="email" href="mailto:<?php 
        echo \Hubzero\Utility\String::obfuscate($this->profile->get('email'));
        ?>
" rel="nofollow">
									<?php 
        echo \Hubzero\Utility\String::obfuscate($this->profile->get('email'));
        ?>
								</a>
							</div>
						</div>
					</li>
				<?php 
    }
    ?>
			<?php 
}
?>

			<?php 
if ($this->registration->ORCID != REG_HIDE && $this->profile->get('orcid')) {
    ?>
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:default.php


示例14:

				</td>
				<td>
					<span class="<?php 
    echo $class;
    ?>
 hasTip" title="<?php 
    echo $status;
    ?>
">&nbsp;</span>
				</td>
				<td>
					<a href="<?php 
    echo Route::url('index.php?option=com_projects&task=edit&id[]=' . $row->project_id);
    ?>
"><?php 
    echo \Hubzero\Utility\String::truncate($row->project_title, 50);
    ?>
</a>
				</td>
				<td>
					<a href="<?php 
    echo Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=versions&id=' . $row->id . $filterstring);
    ?>
"><?php 
    echo $this->escape($row->versions);
    ?>
</a>
				</td>
				<td>
					<?php 
    echo $this->escape($row->base);
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:31,代码来源:display.php


示例15:

                        $html .= "\t\t\t" . '<td>' . $breeze . '</td>' . "\n";
                    }
                    $html .= "\t\t\t" . '<td>' . $videoi . '</td>' . "\n";
                    $html .= "\t\t\t" . '<td>' . $pdf . '</td>' . "\n";
                    $html .= "\t\t\t" . '<td>' . $supp . '</td>' . "\n";
                    $html .= "\t\t\t" . '<td>' . $exercises . '</td>' . "\n";
                } else {
                    //$html .= "\t\t\t".'<td colspan="5">'.Lang::txt('Currently unavilable').'</td>'."\n";
                    $html .= "\t\t\t" . '<td colspan="5"> </td>' . "\n";
                }
                $html .= "\t\t" . '</tr>' . "\n";
                if ($child->standalone == 1) {
                    if ($child->type != 31 && $child->introtext) {
                        $html .= "\t\t" . '<tr class="' . $o . '">' . "\n";
                        $html .= "\t\t\t" . '<td colspan="6">';
                        $html .= \Hubzero\Utility\String::truncate(stripslashes($child->introtext), 200) . '<br /><br />';
                        $html .= "\t\t\t" . '</td>' . "\n";
                        $html .= "\t\t" . '</tr>' . "\n";
                    }
                }
            }
            echo $html;
            ?>
				</tbody>
			</table>
			<?php 
        }
    }
    ?>
	</section><!-- / .main section -->
<?php 
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:31,代码来源:courses.php


示例16: foreach

$html = '<h3>' . $this->escape(stripslashes($name)) . ' <span>(' . Lang::txt('COM_TAGS_RESULTS_THROUGH_OF', $this->filters['start'] + 1, $ttl, $total) . ')</span></h3>' . "\n";
if ($this->results) {
    $html .= '<ol class="results">' . "\n";
    foreach ($this->results as $row) {
        $obj = 'plgTags' . ucfirst($row->section);
        if (method_exists($obj, 'out')) {
            $html .= call_user_func(array($obj, 'out'), $row);
        } else {
            // @todo accomodate scope (aka) group citations
            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 . '">' . \Hubzero\Utility\Sanitize::clean($row->title) . '</a></p>' . "\n";
            if ($row->ftext) {
                $html .= "\t\t" . '<p>' . \Hubzero\Utility\String::truncate(strip_tags($row->ftext), 200) . "</p>\n";
            }
            $html .= "\t\t" . '<p class="href">' . $base . $row->href . '</p>' . "\n";
            $html .= "\t" . '</li>' . "\n";
        }
    }
    $html .= '</ol>' . "\n";
} else {
    $html = '<p class="warning">' . Lang::txt('COM_TAGS_NO_RESULTS') . '</p>';
}
echo $html;
?>
				</div><!-- / .container-block -->
				<?php 
$pageNav = $this->pagination($total, $this->filters['start'], $this->filters['limit']);
$pageNav->setAdditionalUrlParam('task', '');
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:view.php


示例17: defined

defined('_HZEXEC_') or die;
// Get block/element properties
$props = $this->pub->curation('blocks', $this->master->blockId, 'props') . '-' . $this->elementId;
$complete = $this->pub->curation('blocks', $this->master->blockId, 'elementStatus', $this->elementId);
$required = $this->pub->curation('blocks', $this->master->blockId, 'elements', $this->elementId)->params->required;
$elName = 'content-element' . $this->elementId;
$max = $this->manifest->params->max;
$multiZip = isset($this->manifest->params->typeParams->multiZip) && $this->manifest->params->typeParams->multiZip == 0 ? false : true;
// Customize title
$defaultTitle = $this->manifest->params->title ? str_replace('{pubtitle}', $this->pub->title, $this->manifest->params->title) : NULL;
$defaultTitle = $this->manifest->params->title ? str_replace('{pubversion}', $this->pub->version_label, $defaultTitle) : NULL;
$error = $this->status->getError();
$aboutTxt = $this->manifest->adminTips ? $this->manifest->adminTips : $this->manifest->about;
$shorten = $aboutTxt && strlen($aboutTxt) > 200 ? 1 : 0;
if ($shorten) {
    $about = \Hubzero\Utility\String::truncate($aboutTxt, 200);
    $about .= ' <a href="#more-' . $elName . '" class="more-content">' . Lang::txt('COM_PUBLICATIONS_READ_MORE') . '</a>';
    $about .= ' <div class="hidden">';
    $about .= ' 	<div class="full-content" id="more-' . $elName . '">' . $aboutTxt . '</div>';
    $about .= ' </div>';
} else {
    $about = $aboutTxt;
}
// Get version params and extract bundle name
$bundleName = $this->pub->params->get($elName . 'bundlename', $defaultTitle);
$bundleName = $bundleName ? $bundleName : 'bundle';
$bundleName .= '.zip';
// Get attachment model
$modelAttach = new \Components\Publications\Models\Attachments($this->database);
// Get handler model
$modelHandler = new \Components\Publications\Models\Handlers($this->database);
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:dataselector.php


示例18:

</time></span>
								<span class="comment-date-on"><?php 
            echo Lang::txt('COM_BLOG_ON');
            ?>
</span>
								<span class="date"><time datetime="<?php 
            echo $replyto->get('created');
            ?>
"><?php 
            echo $replyto->created('date');
            ?>
</time></span>
							</p>
							<p>
								<?php 
            echo \Hubzero\Utility\String::truncate(stripslashes($replyto->get('content')), 300);
            ?>
							</p>
						</blockquote>
						<?php 
        }
    }
    ?>

					<?php 
    if (!User::isGuest()) {
        ?>
						<label for="commentcontent">
							Your <?php 
        echo $replyto->get('id') ? 'reply' : 'comments';
        ?>
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:31,代码来源:entry.php


示例19: onAfterStatusChange

 /**
  * On after approve/kickback
  *
  * @return  void
  */
 public function onAfterStatusChange()
 {
     if ($this->getError()) {
         return;
     }
     $pub = $this->_pub;
     $status = $this->_pub->version->state;
     $activity = $status == 1 ? Lang::txt('COM_PUBLICATIONS_CURATION_ACTIVITY_PUBLISHED') : Lang::txt('COM_PUBLICATIONS_CURATION_ACTIVITY_KICKBACK');
     $pubtitle = \Hubzero\Utility\String::truncate($pub->title, 100);
     // Log activity in curation history
     $pub->_curationModel->saveHistory(User::get('id'), $pub->state, $status, 1);
     // Add activity
     $activity .= ' ' . strtolower(Lang::txt('version')) . ' ' . $pub->version_label . ' ' . Lang::txt('COM_PUBLICATIONS_OF') . ' ' . strtolower(Lang::txt('publication')) . ' "' . $pubtitle . '" ';
     // Record activity
     $aid = $pub->project()->recordActivity($activity, $pub->id, $pubtitle, $pub->link('version'), 'publication', 0, $admin = 1);
     // Start message
     $sef = 'publications' . DS . $pub->id . DS . $pub->version_number;
     $link = rtrim(Request::base(), DS) . DS . trim($pub->link('version'), DS);
     $manage = rtrim(Request::base(), DS) . DS . trim($pub->link('editversion'), DS);
     $message = $status == 1 ? Lang::txt('COM_PUBLICATIONS_CURATION_EMAIL_CURATOR_APPROVED') : Lang::txt('COM_PUBLICATIONS_CURATION_EMAIL_CURATOR_KICKED_BACK');
     if ($status != 1) {
         $message .= "\n" . "\n";
         $message .= Lang::txt('COM_PUBLICATIONS_CURATION_TAKE_ACTION') . ' ' . $manage;
     } else {
         $message .= ' ' . $link;
     }
     $pubtitle = \Hubzero\Utility\String::truncate($pub->title, 100);
     $subject = ucfirst(Lang::txt('COM_PUBLICATIONS_CURATION_VERSION')) . ' ' . $pub->version_label . ' ' . Lang::txt('COM_PUBLICATIONS_OF') . ' ' . strtolower(Lang::txt('COM_PUBLICATIONS_PUBLICATION')) . ' "' . $pubtitle . '" ';
     $subject .= $status == 1 ? Lang::txt('COM_PUBLICATIONS_MSG_ADMIN_PUBLISHED') : Lang::txt('COM_PUBLICATIONS_MSG_ADMIN_KICKED_BACK');
     // Get authors
     $authors = $pub->table('Author')->getAuthors($pub->version_id, 1, 1, 1);
     // No authors – send to publication creator
     if (count($authors) == 0) {
         $authors = array($pub->created_by);
     }
     // New version released?
     if ($status == 1 && $pub->get('version_number') > 1) {
         // Notify subsrcibers
         Event::trigger('publications.onWatch', array($pub));
     }
     // Make sure there are no duplicates
     $authors = array_unique($authors);
     // Notify authors
     Helpers\Html::notify($pub, $authors, $subject, $message, true);
     return;
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:51,代码来源:curation.php


示例20:

echo $this->pub->id;
?>
" />
		<input type="hidden" name="vid" value="<?php 
echo $this->pub->version_id;
?>
" />
		<input type="hidden" name="task" id="task" value="save" />
	</fieldset>
<div class="curation-wrap">
	<div class="pubtitle">
		<h3><span class="restype indlist"><?php 
echo $typetitle;
?>
</span> <?php 
echo \Hubzero\Utility\String::truncate($this->pub->title, 65);
?>
 | <?php 
echo Lang::txt('COM_PUBLICATIONS_CURATION_VERSION') . ' ' . $this->pub->version_label;
?>
		</h3>
	</div>
	<p class="instruct">
		<span class="pubimage"><img src="<?php 
echo Route::url('index.php?option=com_publications&id=' . $this->pub->id . '&v=' . $this->pub->version_id) . '/Image:thumb';
?>
" alt="" /></span>
		<strong class="block"><?php 
echo $this->pub->reviewed ? Lang::txt('COM_PUBLICATIONS_CURATION_RESUBMITTED') : Lang::txt('COM_PUBLICATIONS_CURATION_SUBMITTED');
echo ' ' . Date::of($this->pub->submitted)->toLocal('M d, Y') . ' ' . Lang::txt('COM_PUBLICATIONS_CURATION_BY') . ' ' . $this->pub->modifier('name');
?>
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:view.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP compat\CActiveForm类代码示例发布时间:2022-05-23
下一篇:
PHP Utility\Sanitize类代码示例发布时间: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