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

PHP module_enabled函数代码示例

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

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



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

示例1: renderForgetPasswordForm

    static function renderForgetPasswordForm()
    {
        $rtn = Message::renderMessages() . '
<form role="form" action="" method="post" id="forget_password">
  <fieldset>
    <div class="form-group">
      <label for="email">' . i18n(array('en' => 'Your E-mail address', 'zh' => '您的电子箱地址')) . '</label>
      <input class="form-control" name="email" type="email" id="email" autofocus required="">
    </div>
    <input type="submit" name="submit" class="btn btn-primary btn-block ' . (module_enabled('form') ? 'disabled' : '') . '" value="' . i18n(array('en' => 'Confirm', 'zh' => '确认')) . '" />
    ' . (module_enabled('form') ? Form::loadSpamToken('#forget_password', SITEUSER_FORM_SPAM_TOKEN) : '') . '
    <div style="text-align:center;"><br /><small><a href="' . uri('users') . '">返回登录界面</a></small></div>
  </fieldset>
</form>
';
        return $rtn;
    }
开发者ID:jeffreycai,项目名称:chaoliu,代码行数:17,代码来源:MySiteUser.class.php


示例2: read_more

 static function read_more($text, $string = null)
 {
     if (!substr_count($text, "e51b2b9a58824dd068d8777ec6e97e4d")) {
         return $text;
     }
     if (Route::current()->action == "view") {
         return preg_replace('/(<p>)?<a class="read_more" href="([^"]+)">e51b2b9a58824dd068d8777ec6e97e4d<\\/a>\\(\\(\\(more(\\((.+)\\))?\\)\\)\\)(<\\/p>(\\n\\n<\\/p>(\\n\\n)?)?)?/', "", $text);
     }
     if (module_enabled('smartypants')) {
         preg_match_all("/e51b2b9a58824dd068d8777ec6e97e4d(\\(\\(\\(more(\\((.+)\\))?\\)\\)\\))/", preg_replace("/<[^>]+>/", "", html_entity_decode(Smartypants::stupify($text), ENT_QUOTES, 'UTF-8')), $more, PREG_OFFSET_CAPTURE);
         $body = truncate(html_entity_decode(Smartypants::stupify($text), ENT_QUOTES, 'UTF-8'), $more[1][0][1], "", true, true);
     } else {
         preg_match_all("/e51b2b9a58824dd068d8777ec6e97e4d(\\(\\(\\(more(\\((.+)\\))?\\)\\)\\))/", preg_replace("/<[^>]+>/", "", html_entity_decode(str_replace("&nbsp;", " ", $text), ENT_QUOTES, 'UTF-8')), $more, PREG_OFFSET_CAPTURE);
         $body = truncate($text, $more[1][0][1], "", true, true);
     }
     $body .= @$more[3][0];
     if (!empty($more[2][0])) {
         $string = $more[2][0];
     } elseif (!isset($string) or $string instanceof Post) {
         # If it's called from anywhere but Twig the post will be passed as a second argument.
         $string = __("Read More &raquo;", "theme");
     }
     return str_replace("e51b2b9a58824dd068d8777ec6e97e4d", $string, $body);
 }
开发者ID:betsyzhang,项目名称:chyrp,代码行数:24,代码来源:read_more.php


示例3: mktable

function mktable($title, $content) {
        echo "<h3>$title</h3>\n";
        echo $content;
}

if (ldap_get_right("lcs_is_admin",$login)!="Y")
  die (gettext("Vous n'avez pas les droits suffisants pour acc&egrave;der &agrave; cette fonction.")."</BODY></HTML>");


function module_enabled($name) {
    return function_exists('apache_get_modules') && in_array($name, apache_get_modules());
}


if (module_enabled('mod_security2')) {
    echo "<h2>Le module de s&eacutecurit&eacute est actif.</h2>";
    if ( file_exists("/tmp/disablemodesecurity.lock") ) {
    	#echo "D&eacute;sactivation du mode s&eacute;curit&eacute; en cours !..<br />";
        echo "<div align='center'>\n
				<img src=\"Images/wait.gif\" title=\"Patientez...\" align=\"middle\" border=\"0\" ALT=\"Patientez\">\n&nbsp;D&eacute;sactivation du mode s&eacute;curit&eacute; en cours ! Veuillez patienter...
        	</div>\n";
    } else {
		if (!isset($disable))
		{
			echo "<form name ='security' action='mod_security.php' method='post'>\n";
			echo "	</select></br><input name=disable type='submit' value='Désactiver le mode sécurité' />\n";
                                                      echo '<input name="jeton" type="hidden"  value="'.md5($_SESSION['token'].htmlentities($_SERVER['PHP_SELF'])).'" />';
			echo "<input type=\"hidden\" name=\"reload\" value=\"true\">\n";
			echo "</form>\n";
		}
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:mod_security.php


示例4: lang

}
if ($hasDocuments) {
	tpl_assign("widgetClass", 'dashDocuments');
	tpl_assign("widgetTitle", lang('documents'));
	tpl_assign("widgetTemplate", 'documents');
	$this->includeTemplate(get_template_path('widget', 'dashboard'));
}
?>

</td>

<?php if ($hasMessages  || $hasCharts || $hasEmails || $hasComments || $showWorkspaceInfo){ ?>
<td style="<?php echo ($hasPendingTasks || $hasLate || $hasToday || $hasDocuments)? 'width:38%;min-width:330px' : 'width:100%' ?>">
<?php 

if ($hasEmails && (module_enabled('mails', defined('SHOW_MAILS_TAB') ? SHOW_MAILS_TAB : 0))) {
	tpl_assign("widgetClass", 'dashUnreadEmails');
	tpl_assign("widgetTitle", $unread_emails?lang('unread emails'):lang('workspace emails'));
	tpl_assign("widgetTemplate", 'emails');
	$this->includeTemplate(get_template_path('widget', 'dashboard'));
}

if ($hasMessages) {
	tpl_assign("widgetClass", 'dashMessages');
	tpl_assign("widgetTitle", lang('messages'));
	tpl_assign("widgetTemplate", 'messages');
	$this->includeTemplate(get_template_path('widget', 'dashboard'));
}

if ($hasComments) {
	tpl_assign("widgetClass", 'dashComments');
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:index.php


示例5: i18n_echo

    </div>
    <div class="checkbox">
      <label>
        <input name="remember" type="checkbox" value="Remeber me" <?php 
if (isset($_POST['remember'])) {
    ?>
checked="checked"<?php 
}
?>
><?php 
i18n_echo(array('en' => 'Remember Me', 'zh' => '下次自动登录'));
?>
      </label>
    </div>
    <!-- Change this to a button or input when using this as a form -->
    <input type="submit" name="submit" class="btn btn-success btn-block disabled" value="<?php 
i18n_echo(array('en' => 'Login', 'zh' => '登录'));
?>
" />
    <?php 
if (module_enabled('form')) {
    ?>
      <?php 
    Form::loadSpamToken('#login', UID_BACKEND_LOGIN_FORM);
    ?>
    <?php 
}
?>
  </fieldset>
</form>
开发者ID:jeffreycai,项目名称:chaoliu,代码行数:30,代码来源:login.tpl.php


示例6: disable

 /**
  * Function: disable
  * Disables a module or feather.
  */
 public function disable()
 {
     $config = Config::current();
     $visitor = Visitor::current();
     $type = isset($_GET['module']) ? "module" : "feather";
     if (!$visitor->group->can("toggle_extensions")) {
         if ($type == "module") {
             show_403(__("Access Denied"), __("You do not have sufficient privileges to enable/disable modules."));
         } else {
             show_403(__("Access Denied"), __("You do not have sufficient privileges to enable/disable feathers."));
         }
     }
     if ($type == "module" and !module_enabled($_GET[$type])) {
         Flash::warning(__("Module already disabled."), "/admin/?action=modules");
     }
     if ($type == "feather" and !feather_enabled($_GET[$type])) {
         Flash::warning(__("Feather already disabled."), "/admin/?action=feathers");
     }
     $enabled_array = $type == "module" ? "enabled_modules" : "enabled_feathers";
     $folder = $type == "module" ? MODULES_DIR : FEATHERS_DIR;
     $class_name = camelize($_GET[$type]);
     if (method_exists($class_name, "__uninstall")) {
         call_user_func(array($class_name, "__uninstall"), false);
     }
     $config->set($type == "module" ? "enabled_modules" : "enabled_feathers", array_diff($config->{$enabled_array}, array($_GET[$type])));
     $info = YAML::load($folder . "/" . $_GET[$type] . "/info.yaml");
     if ($type == "module") {
         Flash::notice(_f("&#8220;%s&#8221; module disabled.", array($info["name"])), "/admin/?action=" . pluralize($type));
     } elseif ($type == "feather") {
         Flash::notice(_f("&#8220;%s&#8221; feather disabled.", array($info["name"])), "/admin/?action=" . pluralize($type));
     }
 }
开发者ID:eadz,项目名称:chyrp,代码行数:36,代码来源:Admin.php


示例7: Message

 }
 if ($active !== false) {
     $user->setActive($active == "1" ? 1 : 0);
     $user->setEmailActivated(1);
 }
 // for new user
 if (empty($uid)) {
     $user->setCreatedAt(time());
     // if $noemailnotification flag is not set
     if (!$noemailnotification) {
         $user->setEmailActivated(0);
     }
 }
 if ($user->save()) {
     // update profile
     if (module_enabled('siteuser_profile')) {
         require MODULESROOT . '/siteuser_profile/controllers/fields_update.php';
     }
     if (empty($uid)) {
         if (!$noemailnotification) {
             $user->sendAccountActivationEmail();
             Message::register(new Message(Message::SUCCESS, i18n(array('en' => 'Thank you for registering with us. An activation email has been sent to your mail box. Please activate your account by clicking the link in the mail.', 'zh' => '感谢您注册新帐号。我们刚给您的注册邮箱发送了一份帐号激活邮件,请点击邮件内的激活链接')) . '<br /><br />' . i18n(array('en' => 'After you activate your account, you can ', 'zh' => '激活您的账号后,您可以')) . '<a href="' . uri('users') . '">' . i18n(array('en' => 'login here', 'zh' => '在此登录')) . '</a>'));
         } else {
             Message::register(new Message(Message::SUCCESS, i18n(array('en' => 'New user created successfully', 'zh' => '新用户添加成功'))));
             // clear $_POST so that our form is not pre-populated
             unset($_POST);
         }
     } else {
         Message::register(new Message(Message::SUCCESS, i18n(array('en' => 'User updated successfully', 'zh' => '用户更新成功'))));
     }
     // update user-role
开发者ID:jeffreycai,项目名称:chaoliu,代码行数:31,代码来源:add_edit_submission.php


示例8: delete

 /**
  * Function: delete
  * Deletes the given milestone. Calls the "delete_milestone" trigger and passes the <Milestone> as an argument.
  *
  * Parameters:
  *     $id - The milestone to delete.
  */
 static function delete($id)
 {
     parent::destroy(get_class(), $id);
     if (module_enabled("cacher")) {
         Modules::$instances["cacher"]->regenerate();
     }
 }
开发者ID:vito,项目名称:chyrp-site,代码行数:14,代码来源:Milestone.php


示例9: exit

<?php

if (version_compare(PHP_VERSION, "5.1.3", "<")) {
    exit("Chyrp requires PHP 5.1.3 or greater.");
}
require_once "../includes/common.php";
# Prepare the controller.
$extend = ExtendController::current();
# Parse the route.
$route = Route::current($extend);
if (module_enabled("cacher") and !empty(Modules::$instances["cacher"]->cacher->path)) {
    $cacher =& Modules::$instances["cacher"]->cacher;
    $cacher->caches = INCLUDES_DIR . "/caches/extend";
    $cacher->path = str_replace(INCLUDES_DIR . "/caches", INCLUDES_DIR . "/caches/extend", $cacher->path);
    $cacher->file = $cacher->path . "/" . md5($cacher->url) . ".html";
    $cacher->remove_expired();
}
# Execute the appropriate Controller responder.
$route->init();
# If the route failed or nothing was displayed, check for:
#     1. Module-provided pages.
#     2. Feather-provided pages.
#     3. Theme-provided pages.
if (!$route->success) {
    $displayed = false;
    if (!$displayed and $theme->file_exists("pages/" . $route->action)) {
        $extend->display("pages/extend/" . $route->action);
    } elseif (!$displayed) {
        show_404();
    }
}
开发者ID:vito,项目名称:chyrp-site,代码行数:31,代码来源:index.php


示例10: Message

    if (empty($msg)) {
        $messages[] = new Message(Message::DANGER, i18n(array('en' => 'Please enter your message', 'zh' => '请填写您的留言')));
    }
    if (!empty($messages)) {
        Message::register($messages);
        HTML::forward($_SERVER['HTTP_REFERER'] . '#contact-form');
    }
    // check spam
    if (module_enabled('form') && !Form::checkSpamToken('global contact form')) {
        $message = new Message(Message::DANGER, i18n(array('en' => 'Form login session expired. Please try again', 'zh' => '表单提交时限过期,请重新尝试登录')));
        Message::register($message);
        HTML::forward($_SERVER['HTTP_REFERER'] . '#contact-form');
    }
    /** success action **/
    Message::register(new Message(Message::SUCCESS, i18n(array('en' => 'Thank you for your contact ;) We will get back to you soon.', 'zh' => '感谢您的留言 ;) 我们会及时和您沟通'))));
    if (module_enabled('mail')) {
        $message = array();
        foreach ($_POST['contact'] as $key => $val) {
            $message[] = "<p><strong>{$key}</strong>:<br />" . str_replace("\n", "<br />", $val) . "</p><br />";
        }
        $message = implode("\n", $message);
        sendemailAdmin('Site contact form', $message);
    }
    HTML::forward($_SERVER['HTTP_REFERER'] . '#contact-form');
}
$html = new HTML();
$html->renderOut('site/components/html_header', array('title' => 'Contact', 'body_class' => 'page page-template page-template-templates page-template-full-width page-template-templatesfull-width-php has-toolbar'));
$html->output('<div id="page-container">');
//$html->renderOut('site/components/toptoolbar');
$html->renderOut('site/components/header');
$html->renderOut('site/contact', array('pagetitle' => $page->getTitle(), 'content' => $page->getContent(), 'googlemap' => $html->render('site/components/googlemap', array('latitude' => '-33.877348', 'longitude' => '151.2079613')), 'full_page_sidebar_right' => $html->render('site/components/full_page_sidebar_right', array('blocks' => array(Block::findByName('Get in Touch'), Block::findByName('Apply Now'))))));
开发者ID:jeffreycai,项目名称:ct21,代码行数:31,代码来源:contact.php


示例11: getDashboardObjectQueries


//.........这里部分代码省略.........
         // Show all objects in trash
         $comments_arch_cond = "1 = 1";
     } else {
         $trashed_cond = '`trashed_on` = ' . DB::escape(EMPTY_DATETIME);
         if ($archived) {
             $archived_cond = "`archived_by_id` > 0";
             $comments_arch_cond = "1 = 0";
             // Don't show comments in archived objects listings
         } else {
             $archived_cond = "`archived_by_id` = 0";
             $comments_arch_cond = "1 = 1";
         }
     }
     if (isset($tag) && $tag && $tag != '') {
         $tag_str = " AND EXISTS (SELECT * FROM `" . TABLE_PREFIX . "tags` `t` WHERE `tag`= " . DB::escape($tag) . " AND `co`.`id` = `t`.`rel_object_id` AND `t`.`rel_object_manager` = `object_manager_value`) ";
     } else {
         $tag_str = ' ';
     }
     if ($linkedObject instanceof ProjectDataObject) {
         $link_id = $linkedObject->getId();
         $link_mgr = get_class($linkedObject->manager());
         $link_str = " AND EXISTS (SELECT * FROM `" . TABLE_PREFIX . "linked_objects` `t` WHERE\n\t\t\t(`t`.`object_id`=" . DB::escape($link_id) . " AND `t`.object_manager = " . DB::escape($link_mgr) . " AND `co`.`id` = `t`.`rel_object_id` AND `t`.`rel_object_manager` = `object_manager_value`) OR\n\t\t\t(`t`.`rel_object_id`=" . DB::escape($link_id) . " AND `t`.rel_object_manager = " . DB::escape($link_mgr) . " AND `co`.`id` = `t`.`object_id` AND `t`.`object_manager` = `object_manager_value`)) ";
     } else {
         $link_str = ' ';
     }
     $tag_str .= $link_str;
     $res = array();
     /** If the name of the query ends with Comments it is assumed to be a list of Comments **/
     $cfn = '';
     if ($filterName != '') {
         $cfn = " AND text LIKE '%" . $filterName . "%'";
     }
     // Notes
     if (module_enabled('notes')) {
         $fn = '';
         if ($filterName != '') {
             $fn = " AND title LIKE '%" . $filterName . "%'";
         }
         $permissions = ' AND ( ' . permissions_sql_for_listings(ProjectMessages::instance(), ACCESS_LEVEL_READ, logged_user(), '`project_id`', '`co`') . ')';
         if ($filterManager == '' || $filterManager == "ProjectMessages") {
             $res['ProjectMessages'] = "SELECT  'ProjectMessages' AS `object_manager_value`, `id` AS `oid`, {$order_crit_messages} AS `order_value` FROM `" . TABLE_PREFIX . "project_messages` `co` WHERE " . $trashed_cond . " AND {$archived_cond} AND " . $proj_cond_messages . str_replace('= `object_manager_value`', "= 'ProjectMessages'", $tag_str) . $permissions . $fn;
         }
         if ($filterManager == '' || $filterManager == "Comments") {
             $res['ProjectMessagesComments'] = "SELECT  'Comments' AS `object_manager_value`, `id` AS `oid`, {$order_crit_comments} AS `order_value` FROM `" . TABLE_PREFIX . "comments` WHERE {$trashed_cond} AND `rel_object_manager` = 'ProjectMessages' AND `rel_object_id` IN (SELECT `co`.`id` FROM `" . TABLE_PREFIX . "project_messages` `co` WHERE `trashed_by_id` = 0 AND {$comments_arch_cond} AND " . $proj_cond_messages . str_replace('= `object_manager_value`', "= 'ProjectMessages'", $tag_str) . $permissions . $cfn . ")";
         }
     }
     // Events
     if (module_enabled("calendar")) {
         $fn = '';
         if ($filterName != '') {
             $fn = " AND subject LIKE '%" . $filterName . "%'";
         }
         $permissions = ' AND ( ' . permissions_sql_for_listings(ProjectEvents::instance(), ACCESS_LEVEL_READ, logged_user(), '`project_id`', '`co`') . ')';
         if ($filterManager == '' || $filterManager == "ProjectEvents") {
             $res['ProjectEvents'] = "SELECT  'ProjectEvents' AS `object_manager_value`, `id` AS `oid`, {$order_crit_calendar} AS `order_value` FROM `" . TABLE_PREFIX . "project_events` `co` WHERE  " . $trashed_cond . " AND {$archived_cond} AND " . $proj_cond_events . str_replace('= `object_manager_value`', "= 'ProjectEvents'", $tag_str) . $permissions . $fn;
         }
         if ($filterManager == '' || $filterManager == "Comments") {
             $res['ProjectEventsComments'] = "SELECT  'Comments' AS `object_manager_value`, `id` AS `oid`, {$order_crit_comments} AS `order_value` FROM `" . TABLE_PREFIX . "comments` WHERE {$trashed_cond} AND `rel_object_manager` = 'ProjectEvents' AND `rel_object_id` IN (SELECT `co`.`id` FROM `" . TABLE_PREFIX . "project_events` `co` WHERE `trashed_by_id` = 0 AND {$comments_arch_cond} AND " . $proj_cond_events . str_replace('= `object_manager_value`', "= 'ProjectEvents'", $tag_str) . $permissions . $cfn . ")";
         }
     }
     // Documents
     if (module_enabled("documents")) {
         $fn = '';
         if ($filterName != '') {
             $fn = " AND filename LIKE '%" . $filterName . "%'";
         }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:67,代码来源:ObjectController.class.php


示例12: delete

 /**
  * Function: delete
  * Deletes the given version, including its notes. Calls the "delete_version" trigger and passes the <Version> as an argument.
  *
  * Parameters:
  *     $id - The version to delete.
  */
 static function delete($id)
 {
     $version = new self($id);
     foreach ($version->notes as $note) {
         Note::delete($note->id);
     }
     foreach ($version->attachments as $attachment) {
         Attachment::delete($attachment->id);
     }
     @unlink(uploaded($version->filename, false));
     @unlink(uploaded($version->preview, false));
     parent::destroy(get_class(), $id);
     if (module_enabled("cacher")) {
         Modules::$instances["cacher"]->regenerate();
     }
 }
开发者ID:vito,项目名称:chyrp-site,代码行数:23,代码来源:Version.php


示例13: die

<?php

// dependency check
if (!module_enabled('crawler')) {
    die('Please enable crawler module');
}
$user = User::getInstance();
if (!is_cli() && $user->isLogin() && is_backend()) {
    // register admin
    Backend::registerSideNav('
  <li>
    <a href="' . uri('admin/queue/list') . '"><i class="fa fa-tasks"></i> ' . i18n(array('en' => 'Queue', 'zh' => '队列')) . '</a>
  </li>
  ');
}
开发者ID:jeffreycai,项目名称:reader,代码行数:15,代码来源:bootstrap.php


示例14: isset

<?php

$user = User::getInstance();
// we only do stuff when the user is not login
if (!$user->isLogin()) {
    $isSubmit = isset($_POST['submit']) ? true : false;
    // is submission or not;
    // deal with form submission
    if ($isSubmit) {
        // check spam
        if (module_enabled('form') && !Form::checkSpamToken(UID_BACKEND_LOGIN_FORM)) {
            $message = new Message(Message::DANGER, 'Form submission error.');
            Message::register($message);
            HTML::forwardBackToReferer();
        }
        // authentication
        $authentication_success = false;
        $email = isset($_POST['email']) ? strip_tags($_POST['email']) : null;
        $password = isset($_POST['password']) ? strip_tags($_POST['password']) : null;
        $settings = Vars::getSettings();
        foreach ($settings['users'] as $u) {
            if ($u['email'] == $email && $u['password'] == $password) {
                $authentication_success = true;
            }
        }
        // if success
        if ($authentication_success) {
            $user = User::findByEmail($email);
            $user->login();
            HTML::forwardBackToReferer();
            // if fail
开发者ID:jeffreycai,项目名称:chaoliu,代码行数:31,代码来源:login.php


示例15: array_push

     $new = $config->{$enabled_array};
     array_push($new, $_POST["extension"]);
     $config->set($enabled_array, $new);
     exit('{ notifications: [' . (!empty($info["notifications"]) ? '"' . implode('", "', $info["notifications"]) . '"' : "") . '] }');
     break;
 case "disable_module":
 case "disable_feather":
     $type = $_POST['action'] == "disable_module" ? "module" : "feather";
     if (!$visitor->group->can("change_settings")) {
         if ($type == "module") {
             exit("{ notifications: ['" . __("You do not have sufficient privileges to enable/disable modules.") . "'] }");
         } else {
             exit("{ notifications: ['" . __("You do not have sufficient privileges to enable/disable feathers.") . "'] }");
         }
     }
     if ($type == "module" and !module_enabled($_POST['extension']) or $type == "feather" and !feather_enabled($_POST['extension'])) {
         exit("{ notifications: [] }");
     }
     $class_name = camelize($_POST["extension"]);
     if (method_exists($class_name, "__uninstall")) {
         call_user_func(array($class_name, "__uninstall"), $_POST['confirm'] == "1");
     }
     $enabled_array = $type == "module" ? "enabled_modules" : "enabled_feathers";
     $config->set($enabled_array, array_diff($config->{$enabled_array}, array($_POST['extension'])));
     exit('{ notifications: [] }');
     break;
 case "reorder_feathers":
     $reorder = oneof(@$_POST['list'], $config->enabled_feathers);
     foreach ($reorder as &$value) {
         $value = preg_replace("/feathers\\[([^\\]]+)\\]/", "\\1", $value);
     }
开发者ID:vito,项目名称:chyrp-site,代码行数:31,代码来源:ajax.php


示例16: class_exists

}
// check if user exists
$class = class_exists('MySiteUser') ? 'MySiteUser' : 'SiteUser';
if (strpos($username, '@') == false) {
    $user = $class::findByUsername($username, $class);
} else {
    $user = $class::findByEmail($username, $class);
}
if (is_null($user) || !$user->checkPassword($password) || $user->getActive() == 0) {
    Message::register(new Message(Message::DANGER, i18n(array('en' => 'Username and password don\'t match. Please try again', 'zh' => '用户名和密码不匹配,请重新尝试'))));
    HTML::forwardBackToReferer();
} else {
    if ($user->getEmailActivated() == 0) {
        Message::register(new Message(Message::DANGER, i18n(array('en' => 'Your account is not yet activated. To resend the activation email, please <a href="' . uri('user/' . $user->getId() . '/activate_resend_email/' . encrypt($user->getSalt()), false) . '">click here</a>', 'zh' => '您的账号还未激活。如需重新发送激活邮件,请<a href="' . uri('user/' . $user->getId() . '/activate_resend_email/' . encrypt($user->getSalt()), false) . '">点击此处</a>'))));
        HTML::forwardBackToReferer();
    }
}
// check spam
if (module_enabled('form') && !Form::checkSpamToken(SITEUSER_FORM_SPAM_TOKEN)) {
    $message = new Message(Message::DANGER, i18n(array('en' => 'Form login session expired. Please try again', 'zh' => '表单提交时限过期,请重新尝试登录')));
    Message::register($message);
    HTML::forwardBackToReferer();
}
/** login action **/
$user->login(is_null($remember) ? false : true);
// forward back to referer if exists
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false;
if ($referer && !preg_match('/\\/users\\/?$/', $referer) && !preg_match('/\\/confirm\\/?$/', $referer) && !preg_match('/forget\\-password\\/?$/', $referer)) {
    HTML::forward($referer);
}
HTML::forward('');
开发者ID:jeffreycai,项目名称:reader,代码行数:31,代码来源:user_login_logic.php


示例17: tpl_assign

    tpl_assign("widgetTemplate", 'documents');
    $this->includeTemplate(get_template_path('widget', 'dashboard'));
}
?>

</td>

<?php 
if ($hasMessages || $hasCharts || $hasEmails || $hasComments || $showWorkspaceInfo) {
    ?>
<td style="<?php 
    echo $hasPendingTasks || $hasLate || $hasToday || $hasDocuments ? 'width:38%;min-width:330px' : 'width:100%';
    ?>
">
<?php 
    if ($hasEmails && module_enabled('email', defined('SHOW_MAILS_TAB') ? SHOW_MAILS_TAB : 0)) {
        tpl_assign("widgetClass", 'dashUnreadEmails');
        tpl_assign("widgetTitle", $unread_emails ? lang('unread emails') : lang('workspace emails'));
        tpl_assign("widgetTemplate", 'emails');
        $this->includeTemplate(get_template_path('widget', 'dashboard'));
    }
    if ($hasMessages) {
        tpl_assign("widgetClass", 'dashMessages');
        tpl_assign("widgetTitle", lang('messages'));
        tpl_assign("widgetTemplate", 'messages');
        $this->includeTemplate(get_template_path('widget', 'dashboard'));
    }
    if ($hasComments) {
        tpl_assign("widgetClass", 'dashComments');
        tpl_assign("widgetTitle", lang('latest comments'));
        tpl_assign("widgetTemplate", 'comments');
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:31,代码来源:index.php


示例18: delete

 /**
  * Function: delete
  * Deletes the given extension, including its notes. Calls the "delete_extension" trigger and passes the <Extension> as an argument.
  *
  * Parameters:
  *     $id - The extension to delete.
  */
 static function delete($id)
 {
     $extension = new self($id);
     foreach ($extension->versions as $version) {
         Version::delete($version->id);
     }
     parent::destroy(get_class(), $id);
     if (module_enabled("cacher")) {
         Modules::$instances["cacher"]->regenerate();
     }
 }
开发者ID:vito,项目名称:chyrp-site,代码行数:18,代码来源:Extension.php


示例19: json_encode

?>
,
	'enable_tasks_module': <?php 
echo json_encode(module_enabled("tasks"));
?>
,
	'enable_weblinks_module': <?php 
echo json_encode(module_enabled('weblinks'));
?>
,
	'enable_time_module': <?php 
echo json_encode(module_enabled("time") && can_manage_time(logged_user(), true));
?>
,
	'enable_reporting_module': <?php 
echo json_encode(module_enabled("reporting"));
?>
};
og.preferences = {
	'rememberGUIState': <?php 
echo user_config_option('rememberGUIState') ? '1' : '0';
?>
,
	'show_unread_on_title': <?php 
echo user_config_option('show_unread_on_title') ? '1' : '0';
?>
,
	'email_polling': <?php 
echo json_encode(user_config_option('email_polling'));
?>
 ,
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:31,代码来源:website.php


示例20: parse_ini_file

// 页面启动时间
$GLOBALS['AX_XHPROF_IS_RUN'] = false;
// 当前页面是否启动xhprof
// 获取ini中相关配置信息
$ax_ini = parse_ini_file(__XHPROF_DIR . '/auto-xhprof.ini', true);
$ax_config = $ax_ini['auto_xhprof'];
$GLOBALS['AX_XHPROF_AUTOSTART'] = get_ini_value($ax_config, 'xhprof.autostart');
$GLOBALS['AX_XHPROF_TIMEOUT'] = get_ini_value($ax_config, 'xhprof.timeout');
$GLOBALS['AX_XHPROF_IGNORE'] = get_ini_value($ax_config, 'xhprof.ignore');
$GLOBALS['AX_DATABASE_DSN'] = get_ini_value($ax_config, 'database.dsn');
$GLOBALS['AX_DATABASE_USER'] = get_ini_value($ax_config, 'database.user');
$GLOBALS['AX_DATABASE_PASS'] = get_ini_value($ax_config, 'database.pass');
$GLOBALS['AX_GEARMAN_SERVER'] = get_ini_value($ax_config, 'gearman.server');
$xhprof_enabled = module_enabled('xhprof');
// 检查xhprof模块是否可用
$gearman_enabled = module_enabled('gearman');
// 检查gearman模块是否可用
if ($gearman_enabled && !$GLOBALS['AX_GEARMAN_SERVER']) {
    $gearman_enabled = false;
}
function get_ini_value($ini, $key)
{
    return array_key_exists($key, $ini) ? $ini[$key] : false;
}
function module_enabled($module)
{
    // 检查模块是否可用
    return in_array($module, get_loaded_extensions());
}
function xhprof_start()
{
开发者ID:songliang89,项目名称:auto-xhprof,代码行数:31,代码来源:auto-xhprof.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP module_entries函数代码示例发布时间:2022-05-15
下一篇:
PHP module_enable函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap