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


PHP Topic::getName方法代码示例

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


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

示例1: Topic

 function test_setName()
 {
     $name = "Writing";
     $test_topic = new Topic($name);
     $name2 = "Interviews";
     $test_topic->setName($name2);
     $result = $test_topic->getName();
     $this->assertEquals($name2, $result);
 }
开发者ID:umamiMike,项目名称:promptr,代码行数:9,代码来源:TopicTest.php

示例2: elseif

 				</table>
 			</TD>
 			</TR>
 			<?php
 			} elseif ($dbColumn->getType() == ArticleTypeField::TYPE_TOPIC) {
 			?>
 			<tr>
 			<TD ALIGN="RIGHT" VALIGN="TOP" style="padding-top: 8px; padding-right: 5px;">
 			</td>
 			<td align="right">
 				<?php echo htmlspecialchars($dbColumn->getDisplayName()); ?>:
 			</td>
 			<td>
                 <?php
                 $topic = new Topic((int)$text);
                 echo $topic->getName(camp_session_get('LoginLanguageId', 1));
                 ?>
 			</td>
 			</tr>
 			<?php
 			} elseif ($dbColumn->getType() == ArticleTypeField::TYPE_SWITCH) {
                 $checked = $srcArticleData->getFieldValue($dbColumn->getPrintName()) ? 'checked' : '';
             ?>
             <tr>
             <TD ALIGN="RIGHT" VALIGN="TOP" style="padding-top: 8px; padding-right: 5px;">
             </td>
             <td align="right"><?php echo htmlspecialchars($dbColumn->getDisplayName()); ?>:</td>
             <td>
             <input type="checkbox" <?php echo $checked; ?> class="input_checkbox" name="<?php echo $dbColumn->getName(); ?>" id="<?php echo $dbColumn->getName(); ?>" disabled>
             </td>
             </tr>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:merge3.php

示例3: create


//.........这里部分代码省略.........
                     $body = str_replace("%name", $var['name'], $body);
                     $body = str_replace("%email", $var['email'], $body);
                     $body = str_replace("%url", $cfg->getBaseUrl(), $body);
                     $body = str_replace('%signature', $dept && $dept->isPublic() ? $dept->getSignature() : '', $body);
                     if (!$dept || !($email = $dept->getAutoRespEmail())) {
                         $email = $cfg->getDefaultEmail();
                     }
                     if ($email) {
                         $email->send($var['email'], $subj, $body);
                     }
                 }
                 //Alert admin...this might be spammy (no option to disable)...but it is helpful..I think.
                 $msg = 'Support ticket request denied for ' . $var['email'] . "\n" . 'Open ticket:' . $openTickets . "\n" . 'Max Allowed:' . $cfg->getMaxOpenTickets() . "\n\nNotice only sent once";
                 Sys::alertAdmin('Overlimit Notice', $msg);
             }
         }
     }
     //Any error above is fatal.
     if ($errors) {
         return 0;
     }
     // OK...just do it.
     $deptId = $var['deptId'];
     //pre-selected Dept if any.
     $priorityId = $var['pri'];
     $source = ucfirst($var['source']);
     $topic = NULL;
     // Intenal mapping magic...see if we need to overwrite anything
     if (isset($var['topicId'])) {
         //Ticket created via web by user/or staff
         if ($var['topicId'] && ($topic = new Topic($var['topicId'])) && $topic->getId()) {
             $deptId = $deptId ? $deptId : $topic->getDeptId();
             $priorityId = $priorityId ? $priorityId : $topic->getPriorityId();
             $topicDesc = $topic->getName();
             if ($autorespond) {
                 $autorespond = $topic->autoRespond();
             }
         }
         $source = $var['source'] ? $var['source'] : 'Web';
     } elseif ($var['emailId'] && !$var['deptId']) {
         //Emailed Tickets
         $email = new Email($var['emailId']);
         if ($email && $email->getId()) {
             $deptId = $email->getDeptId();
             $priorityId = $priorityId ? $priorityId : $email->getPriorityId();
             if ($autorespond) {
                 $autorespond = $email->autoRespond();
             }
         }
         $email = null;
         $source = 'Email';
     } elseif ($var['deptId']) {
         //Opened by staff.
         $deptId = $var['deptId'];
         $source = ucfirst($var['source']);
     }
     //Don't auto respond to mailer daemons.
     if (strpos(strtolower($var['email']), 'mailer-daemon@') !== false || strpos(strtolower($var['email']), 'postmaster@') !== false) {
         $autorespond = false;
     }
     //Last minute checks
     $priorityId = $priorityId ? $priorityId : $cfg->getDefaultPriorityId();
     $deptId = $deptId ? $deptId : $cfg->getDefaultDeptId();
     $topicId = $var['topicId'] ? $var['topicId'] : 0;
     $ipaddress = $var['ip'] ? $var['ip'] : $_SERVER['REMOTE_ADDR'];
     //We are ready son...hold on to the rails.
开发者ID:supaket,项目名称:helpdesk,代码行数:67,代码来源:class.ticket.php

示例4: Topic

<div class="row">
    <div class="box col-md-12">
        <div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> Form Topic</h2>

                
            </div>
            <div class="box-content">
                 <?php 
$topic_id = Request::get("topic_id");
if (is_numeric($topic_id) && $topic_id > 0) {
    $topicObj = new Topic();
    $topicObj->set("topic_id", $topic_id);
    $result = $topicObj->getName();
    if (count($result)) {
        $row = $result[0];
        $topic_id = $row['topic_id'];
        $topic = $row['topic'];
        $active = $row['active'];
    }
}
?>
                            <div class="error"><?php 
echo Error::displayError();
?>
</div>
                 <form action="" method="POST">
                    <table style="margin-left: 20%;" width="100%" >
                        <tr>
开发者ID:sonaljain888,项目名称:project-legal-lawyer-,代码行数:30,代码来源:add_topic.php

示例5: update

 function update($var, &$errors)
 {
     global $cfg, $thisstaff;
     $fields = array();
     $fields['name'] = array('type' => 'string', 'required' => 1, 'error' => 'Name required');
     $fields['email'] = array('type' => 'email', 'required' => 1, 'error' => 'Email is required');
     $fields['note'] = array('type' => 'text', 'required' => 1, 'error' => 'Reason for the update required');
     $fields['subject'] = array('type' => 'string', 'required' => 1, 'error' => 'Subject required');
     $fields['topicId'] = array('type' => 'int', 'required' => 0, 'error' => 'Invalid Selection');
     $fields['pri'] = array('type' => 'int', 'required' => 0, 'error' => 'Invalid Priority');
     $fields['phone'] = array('type' => 'phone', 'required' => 0, 'error' => 'Valid phone # required');
     $fields['duedate'] = array('type' => 'date', 'required' => 0, 'error' => 'Invalid date - must be MM/DD/YY');
     $params = new Validator($fields);
     if (!$params->validate($var)) {
         $errors = array_merge($errors, $params->errors());
     }
     if ($var['duedate']) {
         if ($this->isClosed()) {
             $errors['duedate'] = 'Duedate can NOT be set on a closed ticket';
         } elseif (!$var['time'] || strpos($var['time'], ':') === false) {
             $errors['time'] = 'Select time';
         } elseif (strtotime($var['duedate'] . ' ' . $var['time']) === false) {
             $errors['duedate'] = 'Invalid duedate';
         } elseif (strtotime($var['duedate'] . ' ' . $var['time']) <= time()) {
             $errors['duedate'] = 'Due date must be in the future';
         }
     }
     //Make sure phone extension is valid
     if ($var['phone_ext']) {
         if (!is_numeric($var['phone_ext']) && !$errors['phone']) {
             $errors['phone'] = 'Invalid phone ext.';
         } elseif (!$var['phone']) {
             //make sure they just didn't enter ext without phone #
             $errors['phone'] = 'Phone number required';
         }
     }
     $cleartopic = false;
     $topicDesc = '';
     if ($var['topicId'] && ($topic = new Topic($var['topicId'])) && $topic->getId()) {
         $topicDesc = $topic->getName();
     } elseif (!$var['topicId'] && $this->getTopicId()) {
         $topicDesc = '';
         $cleartopic = true;
     }
     if (!$errors) {
         $sql = 'UPDATE ' . TICKET_TABLE . ' SET updated=NOW() ' . ',email=' . db_input($var['email']) . ',name=' . db_input(Format::striptags($var['name'])) . ',subject=' . db_input(Format::striptags($var['subject'])) . ',phone="' . db_input($var['phone'], false) . '"' . ',phone_ext=' . db_input($var['phone_ext'] ? $var['phone_ext'] : NULL) . ',priority_id=' . db_input($var['pri']) . ',topic_id=' . db_input($var['topicId']) . ',duedate=' . ($var['duedate'] ? db_input(date('Y-m-d G:i', Misc::dbtime($var['duedate'] . ' ' . $var['time']))) : 'NULL');
         if ($var['duedate']) {
             //We are setting new duedate...
             $sql .= ',isoverdue=0';
         }
         if ($topicDesc || $cleartopic) {
             //we're overwriting previous topic.
             $sql .= ',helptopic=' . db_input($topicDesc);
         }
         $sql .= ' WHERE ticket_id=' . db_input($this->getId());
         //echo $sql;
         if (db_query($sql)) {
             $this->postNote('Ticket Updated', $var['note']);
             $this->reload();
             return true;
         }
     }
     return false;
 }
开发者ID:ryan1432,项目名称:osTicket-1.7fork,代码行数:64,代码来源:class.ticket.php

示例6: camp_html_breadcrumbs

        ArticleTopic::RemoveTopicFromArticles($topic->getTopicId());
    }
    // delete all subtopics
    foreach ($deleteTopics as $topic) {
        $topic->delete($f_topic_language_id);
    }
    $doDelete = true;
}
if ($doDelete) {
    ArticleTopic::RemoveTopicFromArticles($deleteTopic->getTopicId());
    $deleted = $deleteTopic->delete($f_topic_language_id);
    if ($deleted) {
        camp_html_add_msg(getGS("Topic was deleted."), "ok");
        camp_html_goto_page("/{$ADMIN}/topics/index.php");
    } else {
        $errorMsgs[] = getGS('The topic $1 could not be deleted.', '<B>' . $deleteTopic->getName($f_topic_language_id) . '</B>');
    }
}
$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Topics"), "/{$ADMIN}/topics/");
$crumbs[] = array(getGS("Deleting topic"), "");
echo camp_html_breadcrumbs($crumbs);
?>

<P>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box">
<TR>
	<TD COLSPAN="2">
		<B> <?php 
putGS("Deleting topic");
开发者ID:nidzix,项目名称:Newscoop,代码行数:31,代码来源:do_del.php

示例7: createAndTest

	private function createAndTest($p_topicId, $p_data, $p_left, $p_right)
	{
		$topic = new Topic($p_topicId);
		$topic->create($p_data);
		unset($topic);
		$topic = new Topic($p_topicId);
		$this->assertTrue($topic->exists());
		foreach ($p_data['names'] as $languageId=>$name) {
			$this->assertEquals($name, $topic->getName($languageId));
		}
		$this->assertEquals($p_left, $topic->getLeft());
		$this->assertEquals($p_right, $topic->getRight());
	}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:13,代码来源:TopicTest.php

示例8:

    ?>
		<li>
			<a class="nowrap" href="<?php 
    echo $topic->getUrl();
    ?>
">
			<span class="tag pull-right" style="margin-left: 0.5em;"><?php 
    echo $topic['argument_title'];
    ?>
</span>
			<span class="bubble red pull-right"><?php 
    echo $topic['replies'];
    ?>
</span>
			<?php 
    echo $topic->getName();
    ?>
			<span class="hide-phone hide-tablet"> - <?php 
    echo $topic->getFormattedDate();
    ?>
</span>
			</a>
		</li>
<?php 
}
?>
</ul>


<?php 
echo AlertMessage::Get("Vi ricordiamo che questo sito e' un lavoro in corso, \n\t\tquindi errori e mancanza di funzionalita' sono perfettamente normali a questo punto.<br/><br/>\n\n\t\t<ul style='margin-left: 20px;'>\n\t\t\t<li style='margin-bottom: 20px;'>Se trovi un errore <button class='btn' onclick=\"location.href='http://www.pierotofy.it/p/extras/forum/572/';\">segnalalo agli sviluppatori</button></li>\n\t\t\t<li style='margin-bottom: 20px;'>Se vuoi contribuire e partecipare assieme al nostro fantastico team di sviluppo <button class='btn' onclick=\"location.href='http://devwiki.pierotofy.it';\">visita il nostro wiki</button></li>\n\t\t\t<li style='margin-bottom: 20px;'>Se sei curioso di vedere il sorgente <button class='btn' onclick=\"location.href='http://svn.pierotofy.it';\">clicca qui</button></li>\n\t\t</ul>", AlertMessage::WARN);
开发者ID:pierotofy,项目名称:pierotofy.it,代码行数:31,代码来源:index.php

示例9: Article

	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), null, true);
	exit;
}

if (!$g_user->hasPermission('AttachTopicToArticle')) {
	camp_html_display_error(getGS("You do not have the right to detach topics from articles."), null, true);
	exit;
}

$articleObj = new Article($f_language_selected, $f_article_number);
if (!$articleObj->exists()) {
	camp_html_display_error(getGS('Article does not exist.'), null, true);
	exit;
}
$topicObj = new Topic($f_topic_id);
if (!$topicObj->exists()) {
	camp_html_display_error(getGS('Topic does not exist.'), null, true);
	exit;
}

ArticleTopic::RemoveTopicFromArticle($f_topic_id, $f_article_number);
$topicName = $topicObj->getName($f_language_selected);
if (empty($topicName)) {
	$topicName = $topicObj->getName(1);
}
camp_html_add_msg(getGS("The topic '$1' has been removed from article.", $topicName), "ok");
$url = camp_html_article_url($articleObj, $f_language_id, "edit.php");
camp_html_goto_page($url);

?>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:do_del.php


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