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


PHP Horde::popupJs方法代码示例

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


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

示例1: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output, $prefs, $session;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     if (!Horde::isConnectionSecure()) {
         $view->notsecure = true;
     } else {
         $smime_url = IMP_Basic_Smime::url();
         $view->has_key = $prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key');
         if ($view->has_key) {
             $view->viewpublic = Horde::link($smime_url->copy()->add('actionID', 'view_personal_public_key'), _("View Personal Public Certificate"), null, 'view_key');
             $view->infopublic = Horde::link($smime_url->copy()->add('actionID', 'info_personal_public_key'), _("Information on Personal Public Certificate"), null, 'info_key');
             if ($injector->getInstance('IMP_Crypt_Smime')->getPassphrase()) {
                 $view->passphrase = Horde::link($ui->selfUrl(array('special' => true, 'token' => true))->add('unset_smime_passphrase', 1), _("Unload Passphrase")) . _("Unload Passphrase");
             } else {
                 $imple = $injector->getInstance('Horde_Core_Factory_Imple')->create('IMP_Ajax_Imple_PassphraseDialog', array('params' => array('reload' => $ui->selfUrl()->setRaw(true)), 'type' => 'smimePersonal'));
                 $view->passphrase = Horde::link('#', _("Enter Passphrase"), null, null, null, null, null, array('id' => $imple->getDomId())) . _("Enter Passphrase");
             }
             $view->viewprivate = Horde::link($smime_url->copy()->add('actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key');
             $page_output->addInlineScript(array('$("delete_smime_personal").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")) . ')) { e.stop(); } })'), true);
         } elseif ($session->get('imp', 'file_upload')) {
             $view->import = true;
             $page_output->addInlineScript(array('$("import_smime_personal").observe("click", function(e) { ' . Horde::popupJs($smime_url, array('params' => array('actionID' => 'import_personal_certs', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 275, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
         }
     }
     return $view->render('smimeprivatekey');
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:SmimePrivateKey.php

示例2: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $injector, $page_output, $prefs, $session;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $imp_pgp = $injector->getInstance('IMP_Crypt_Pgp');
     /* Get list of Public Keys on keyring. */
     try {
         $pubkey_list = $imp_pgp->listPublicKeys();
     } catch (Horde_Exception $e) {
         $pubkey_list = array();
     }
     $pgp_url = IMP_Basic_Pgp::url();
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     $view->addHelper('Text');
     if (!empty($pubkey_list)) {
         $plist = array();
         $self_url = $ui->selfUrl(array('special' => true, 'token' => true));
         foreach ($pubkey_list as $val) {
             $plist[] = array('name' => $val['name'], 'email' => $val['email'], 'view' => Horde::link($pgp_url->copy()->add(array('actionID' => 'view_public_key', 'email' => $val['email'])), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'), 'info' => Horde::link($pgp_url->copy()->add(array('actionID' => 'info_public_key', 'email' => $val['email'])), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'), 'delete' => Horde::link($self_url->copy()->add(array('delete_pgp_pubkey' => 1, 'email' => $val['email'])), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "window.confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')"));
         }
         $view->pubkey_list = $plist;
     }
     if ($session->get('imp', 'file_upload')) {
         $view->can_import = true;
         $view->no_source = !$prefs->getValue('add_source');
         if (!$view->no_source) {
             $page_output->addInlineScript(array('$("import_pgp_public").observe("click", function(e) { ' . Horde::popupJs($pgp_url, array('params' => array('actionID' => 'import_public_key', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 275, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
         }
     }
     return $view->render('pgppublickey');
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:34,代码来源:PgpPublicKey.php

示例3: __construct

 public function __construct($vars, $calendar)
 {
     global $conf, $injector, $registry;
     $this->_calendar = $calendar;
     $owner = $calendar->get('owner') == $registry->getAuth() || is_null($calendar->get('owner')) && $registry->isAdmin();
     parent::__construct($vars, $owner ? sprintf(_("Edit %s"), $calendar->get('name')) : $calendar->get('name'));
     $this->addHidden('', 'c', 'text', true);
     $this->addVariable(_("Name"), 'name', 'text', true);
     if (!$owner) {
         $v = $this->addVariable(_("Owner"), 'owner', 'text', false);
         $owner_name = $injector->getInstance('Horde_Core_Factory_Identity')->create($calendar->get('owner'))->getValue('fullname');
         if (trim($owner_name) == '') {
             $owner_name = $calendar->get('owner');
         }
         $v->setDefault($owner_name ? $owner_name : _("System"));
     }
     $this->addVariable(_("Color"), 'color', 'colorpicker', false);
     if ($registry->isAdmin()) {
         $this->addVariable(_("System Calendar"), 'system', 'boolean', false, false, _("System calendars don't have an owner. Only administrators can change the calendar settings and permissions."));
     }
     $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
     $this->addVariable(_("Tags"), 'tags', 'Kronolith:KronolithTags', false);
     /* Display URL. */
     $url = Horde::url('month.php', true, -1)->add('display_cal', $calendar->getName());
     $this->addVariable(_("Display URL"), '', 'link', false, false, null, array(array('url' => $url, 'text' => $url, 'title' => _("Click or copy this URL to display this calendar"), 'target' => '_blank')));
     /* Subscription URLs. */
     $url = $registry->get('webroot', 'horde');
     if (isset($conf['urls']['pretty']) && $conf['urls']['pretty'] == 'rewrite') {
         $webdavUrl = $url . '/rpc/kronolith/';
         $caldavUrl = $url . '/rpc/calendars/';
         $accountUrl = $url . '/rpc/';
     } else {
         $webdavUrl = $url . '/rpc.php/kronolith/';
         $caldavUrl = $url . '/rpc.php/calendars/';
         $accountUrl = $url . '/rpc.php/';
     }
     try {
         $accountUrl = Horde::url($accountUrl, true, -1) . 'principals/' . $registry->convertUsername($registry->getAuth(), false) . '/';
         $caldavUrl = Horde::url($caldavUrl, true, -1) . $registry->convertUsername($registry->getAuth(), false) . '/' . $injector->getInstance('Horde_Dav_Storage')->getExternalCollectionId($calendar->getName(), 'calendar') . '/';
         $this->addVariable(_("CalDAV Subscription URL"), '', 'link', false, false, null, array(array('url' => $caldavUrl, 'text' => $caldavUrl, 'title' => _("Copy this URL to a CalDAV client to subscribe to this calendar"), 'target' => '_blank')));
         $this->addVariable(_("CalDAV Account URL"), '', 'link', false, false, null, array(array('url' => $accountUrl, 'text' => $accountUrl, 'title' => _("Copy this URL to a CalDAV client to subscribe to all your calendars"), 'target' => '_blank')));
     } catch (Horde_Exception $e) {
     }
     $webdavUrl = Horde::url($webdavUrl, true, -1) . ($calendar->get('owner') ? $registry->convertUsername($calendar->get('owner'), false) : '-system-') . '/' . $calendar->getName() . '.ics';
     $this->addVariable(_("WebDAV/ICS Subscription URL"), '', 'link', false, false, null, array(array('url' => $webdavUrl, 'text' => $webdavUrl, 'title' => _("Copy this URL to a WebDAV or ICS client to subscribe to this calendar"), 'target' => '_blank')));
     /* Feed URL. */
     $url = Kronolith::feedUrl($calendar->getName());
     $this->addVariable(_("Feed URL"), '', 'link', false, false, null, array(array('url' => $url, 'text' => $url, 'title' => _("Copy this URL to a news feed reader to subscribe to this calendar"), 'target' => '_blank')));
     /* Embed code. */
     $v = $this->addVariable(_("Embed code"), '', 'longtext', false, false, _("To embed this calendar in another website, use the code above."), array(4, 60));
     $v->setHelp('embed');
     $v->setDefault(Kronolith::embedCode($calendar->getName()));
     /* Permissions link. */
     if (empty($conf['share']['no_sharing']) && $owner) {
         $url = Horde::url('perms.php')->add('share', $calendar->getName());
         $this->addVariable('', '', 'link', false, false, null, array(array('url' => $url, 'text' => _("Change Permissions"), 'onclick' => Horde::popupJs($url, array('params' => array('urlencode' => true))) . 'return false;', 'class' => 'horde-button', 'target' => '_blank')));
     }
     $this->setButtons(array(_("Save"), array('class' => 'horde-delete', 'value' => _("Delete")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:59,代码来源:EditCalendar.php

示例4: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $browser, $injector, $page_output, $prefs;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $p_css = new Horde_Themes_Element('prefs.css');
     $page_output->addStylesheet($p_css->fs, $p_css->uri);
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     if (!Horde::isConnectionSecure()) {
         $view->notsecure = true;
         return $view->render('smimeprivatekey');
     }
     $smime_url = IMP_Basic_Smime::url();
     $view->has_key = $prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key');
     $view->has_sign_key = $prefs->getValue('smime_public_sign_key') && $prefs->getValue('smime_private_sign_key');
     if ($browser->allowFileUploads()) {
         $view->import = true;
         $page_output->addInlineScript(array('$("import_smime_personal").observe("click", function(e) { ' . Horde::popupJs($smime_url, array('params' => array('actionID' => 'import_personal_certs', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 450, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
     }
     if (!$view->has_key) {
         return $view->render('smimeprivatekey');
     }
     $smime = $injector->getInstance('IMP_Smime');
     foreach (array('' => false, '_sign' => true) as $suffix => $secondary) {
         if ($secondary && !$view->has_sign_key) {
             continue;
         }
         $cert = $smime->parseCert($smime->getPersonalPublicKey($secondary));
         if (!empty($cert['validity']['notafter'])) {
             $expired = new Horde_Date($cert['validity']['notafter']);
             if ($expired->before(time())) {
                 $view->{'expiredate' . $suffix} = $expired->strftime($prefs->getValue('date_format'));
                 $view->{'expiretime' . $suffix} = $expired->strftime($prefs->getValue('time_format'));
             }
         }
         $view->{'viewpublic' . $suffix} = $smime_url->copy()->add('actionID', 'view_personal_public' . $suffix . '_key')->link(array('title' => $secondary ? _("View Secondary Personal Public Certificate") : _("View Personal Public Certificate"), 'target' => 'view_key')) . _("View") . '</a>';
         $view->{'infopublic' . $suffix} = $smime_url->copy()->add('actionID', 'info_personal_public' . $suffix . '_key')->link(array('title' => _("Information on Personal Public Certificate"), 'target' => 'info_key')) . _("Details") . '</a>';
         if ($smime->getPassphrase($secondary)) {
             $view->{'passphrase' . $suffix} = $ui->selfUrl(array('special' => true, 'token' => true))->add('unset_smime' . $suffix . '_passphrase', 1)->link(array('title' => _("Unload Passphrase"))) . _("Unload Passphrase") . '</a>';
         } else {
             $imple = $injector->getInstance('Horde_Core_Factory_Imple')->create('IMP_Ajax_Imple_PassphraseDialog', array('params' => array('reload' => $ui->selfUrl()->setRaw(true), 'secondary' => intval($secondary)), 'type' => 'smimePersonal'));
             $view->{'passphrase' . $suffix} = Horde::link('#', _("Enter Passphrase"), null, null, null, null, null, array('id' => $imple->getDomId())) . _("Enter Passphrase");
         }
         $view->{'viewprivate' . $suffix} = $smime_url->copy()->add('actionID', 'view_personal_private' . $suffix . '_key')->link(array('title' => _("View Secondary Personal Private Key"), 'target' => 'view_key')) . _("View") . '</a>';
         $page_output->addInlineScript(array('$("delete_smime_personal' . $suffix . '").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")) . ')) { e.stop(); } })'), true);
     }
     return $view->render('smimeprivatekey');
 }
开发者ID:horde,项目名称:horde,代码行数:50,代码来源:SmimePrivateKey.php

示例5: __construct

 public function __construct($vars, Horde_Share_Object $addressbook)
 {
     global $conf, $injector, $registry;
     $this->_addressbook = $addressbook;
     $owner = $addressbook->get('owner') == $registry->getAuth() || is_null($addressbook->get('owner')) && $registry->isAdmin();
     parent::__construct($vars, $owner ? sprintf(_("Edit %s"), $addressbook->get('name')) : $addressbook->get('name'));
     $this->addHidden('', 'a', 'text', true);
     $this->addVariable(_("Name"), 'name', 'text', true);
     if (!$owner) {
         $v = $this->addVariable(_("Owner"), 'owner', 'text', false);
         $owner_name = $injector->getInstance('Horde_Core_Factory_Identity')->create($addressbook->get('owner'))->getValue('fullname');
         if (trim($owner_name) == '') {
             $owner_name = $addressbook->get('owner');
         }
         $v->setDefault($owner_name ? $owner_name : _("System"));
     }
     $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
     /* Subscription URLs. */
     $url = $registry->get('webroot', 'horde');
     if (isset($conf['urls']['pretty']) && $conf['urls']['pretty'] == 'rewrite') {
         $webdavUrl = $url . '/rpc/turba/';
         $carddavUrl = $url . '/rpc/addressbooks/';
         $accountUrl = $url . '/rpc/';
     } else {
         $webdavUrl = $url . '/rpc.php/turba/';
         $carddavUrl = $url . '/rpc.php/addressbooks/';
         $accountUrl = $url . '/rpc.php/';
     }
     try {
         $accountUrl = Horde::url($accountUrl, true, -1) . 'principals/' . $registry->convertUsername($registry->getAuth(), false) . '/';
         if ($addressbook->get('owner')) {
             $carddavUrl = Horde::url($carddavUrl, true, -1) . $registry->convertUsername($registry->getAuth(), false) . '/' . $injector->getInstance('Horde_Dav_Storage')->getExternalCollectionId($addressbook->getName(), 'contacts') . '/';
             $this->addVariable(_("CardDAV Subscription URL"), '', 'link', false, false, null, array(array('url' => $carddavUrl, 'text' => $carddavUrl, 'title' => _("Copy this URL to a CardDAV client to subscribe to this address book"), 'target' => '_blank')));
         }
         $this->addVariable(_("CardDAV Account URL"), '', 'link', false, false, null, array(array('url' => $accountUrl, 'text' => $accountUrl, 'title' => _("Copy this URL to a CarddAV client to subscribe to all your address books"), 'target' => '_blank')));
     } catch (Horde_Exception $e) {
     }
     $webdavUrl = Horde::url($webdavUrl, true, -1) . ($addressbook->get('owner') ? $registry->convertUsername($addressbook->get('owner'), false) : '-system-') . '/' . $addressbook->getName() . '/';
     $this->addVariable(_("WebDAV URL"), '', 'link', false, false, null, array(array('url' => $webdavUrl, 'text' => $webdavUrl, 'title' => _("Copy this URL to a WebDAV client to browse this address book"), 'target' => '_blank')));
     /* Permissions link. */
     if (empty($conf['share']['no_sharing']) && $owner) {
         $url = Horde::url($registry->get('webroot', 'horde') . '/services/shares/edit.php')->add(array('app' => 'turba', 'share' => $addressbook->getName()));
         $this->addVariable('', '', 'link', false, false, null, array(array('url' => $url, 'text' => _("Change Permissions"), 'onclick' => Horde::popupJs($url, array('params' => array('urlencode' => true))) . 'return false;', 'class' => 'horde-button', 'target' => '_blank')));
     }
     $this->setButtons(array(_("Save"), array('class' => 'horde-delete', 'value' => _("Delete")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:46,代码来源:EditAddressBook.php

示例6: display

 /**
  */
 public function display(Horde_Core_Prefs_Ui $ui)
 {
     global $browser, $conf, $injector, $page_output, $prefs;
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $p_css = new Horde_Themes_Element('prefs.css');
     $page_output->addStylesheet($p_css->fs, $p_css->uri);
     $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
     $view->addHelper('Horde_Core_View_Helper_Help');
     if (!Horde::isConnectionSecure()) {
         $view->notsecure = true;
     } else {
         $pgp_url = IMP_Basic_Pgp::url();
         $view->has_key = $prefs->getValue('pgp_public_key') && $prefs->getValue('pgp_private_key');
         if ($view->has_key) {
             $view->viewpublic = Horde::link($pgp_url->copy()->add('actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key');
             $view->infopublic = Horde::link($pgp_url->copy()->add('actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key');
             $view->sendkey = Horde::link($ui->selfUrl(array('special' => true, 'token' => true))->add('send_pgp_key', 1), _("Send Key to Public Keyserver"));
             if ($injector->getInstance('IMP_Pgp')->getPassphrase('personal')) {
                 $view->passphrase = Horde::link($ui->selfUrl(array('special' => true, 'token' => true))->add('unset_pgp_passphrase', 1), _("Unload Passphrase")) . _("Unload Passphrase");
             } else {
                 $imple = $injector->getInstance('Horde_Core_Factory_Imple')->create('IMP_Ajax_Imple_PassphraseDialog', array('params' => array('reload' => $ui->selfUrl()->setRaw(true)), 'type' => 'pgpPersonal'));
                 $view->passphrase = Horde::link('#', _("Enter Passphrase"), null, null, null, null, null, array('id' => $imple->getDomId())) . _("Enter Passphrase");
             }
             $view->viewprivate = Horde::link($pgp_url->copy()->add('actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key');
             $view->infoprivate = Horde::link($pgp_url->copy()->add('actionID', 'info_personal_private_key'), _("Information on Personal Private Key"), null, 'info_key');
             $page_output->addInlineScript(array('$("delete_pgp_privkey").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")) . ')) { e.stop(); } })'), true);
         } else {
             $page_output->addScriptFile('prefs/pgp.js');
             Horde_Core_Ui_JsCalendar::init();
             $page_output->addInlineJsVars(array('ImpPgp.months' => Horde_Core_Ui_JsCalendar::months()));
             $imp_identity = $injector->getInstance('IMP_Identity');
             $view->fullname = $imp_identity->getFullname();
             $view->fromaddr = $imp_identity->getFromAddress()->bare_address;
             if (!empty($conf['pgp']['keylength'])) {
                 $view->create_pgp_keypair = true;
                 $page_output->addInlineScript(array('$("create_pgp_key").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Key generation may take a long time to complete.  Continue with key generation?")) . ')) { e.stop(); } })'), true);
             }
             if ($browser->allowFileUploads()) {
                 $view->import_pgp_private = true;
                 $page_output->addInlineScript(array('$("import_pgp_personal").observe("click", function(e) { ' . Horde::popupJs($pgp_url, array('params' => array('actionID' => 'import_personal_key', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 300, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
             }
         }
     }
     return $view->render('pgpprivatekey');
 }
开发者ID:horde,项目名称:horde,代码行数:47,代码来源:PgpPrivateKey.php

示例7: __construct

 /**
  *
  * @param array $vars
  * @param Horde_Share_Object $tasklist
  */
 public function __construct($vars, Horde_Share_Object $tasklist)
 {
     $this->_tasklist = $tasklist;
     $owner = $tasklist->get('owner') == $GLOBALS['registry']->getAuth() || is_null($tasklist->get('owner')) && $GLOBALS['registry']->isAdmin();
     parent::__construct($vars, $owner ? sprintf(_("Edit %s"), $tasklist->get('name')) : $tasklist->get('name'));
     $this->addHidden('', 't', 'text', true);
     $this->addVariable(_("Name"), 'name', 'text', true);
     if (!$owner) {
         $v = $this->addVariable(_("Owner"), 'owner', 'text', false);
         $owner_name = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($tasklist->get('owner'))->getValue('fullname');
         if (trim($owner_name) == '') {
             $owner_name = $tasklist->get('owner');
         }
         $v->setDefault($owner_name ? $owner_name : _("System"));
     }
     $this->addVariable(_("Color"), 'color', 'colorpicker', false);
     if ($GLOBALS['registry']->isAdmin()) {
         $this->addVariable(_("System Task List"), 'system', 'boolean', false, false, _("System task lists don't have an owner. Only administrators can change the task list settings and permissions."));
     }
     $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
     /* Display URL. */
     $url = Horde::url('list.php', true, -1)->add('display_tasklist', $tasklist->getName());
     $this->addVariable(_("Display URL"), '', 'link', false, false, null, array(array('url' => $url, 'text' => $url, 'title' => _("Click or copy this URL to display this task list"), 'target' => '_blank')));
     /* Subscription URLs. */
     try {
         $accountUrl = Nag::getUrl(Nag::DAV_ACCOUNT, $tasklist);
         $caldavUrl = Nag::getUrl(Nag::DAV_CALDAV, $tasklist);
         $this->addVariable(_("CalDAV Subscription URL"), '', 'link', false, false, null, array(array('url' => $caldavUrl, 'text' => $caldavUrl, 'title' => _("Copy this URL to a CalDAV client to subscribe to this task list"), 'target' => '_blank')));
         $this->addVariable(_("CalDAV Account URL"), '', 'link', false, false, null, array(array('url' => $accountUrl, 'text' => $accountUrl, 'title' => _("Copy this URL to a CalDAV client to subscribe to all your task lists"), 'target' => '_blank')));
     } catch (Horde_Exception $e) {
     }
     $webdavUrl = Nag::getUrl(Nag::DAV_WEBDAV, $tasklist);
     $this->addVariable(_("WebDAV/ICS Subscription URL"), '', 'link', false, false, null, array(array('url' => $webdavUrl, 'text' => $webdavUrl, 'title' => _("Copy this URL to a WebDAV or ICS client to subscribe to this task list"), 'target' => '_blank')));
     /* Permissions link. */
     if (empty($GLOBALS['conf']['share']['no_sharing']) && $owner) {
         $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php')->add(array('app' => 'nag', 'share' => $tasklist->getName()));
         $this->addVariable('', '', 'link', false, false, null, array(array('url' => $url, 'text' => _("Change Permissions"), 'onclick' => Horde::popupJs($url, array('params' => array('urlencode' => true))) . 'return false;', 'class' => 'horde-button', 'target' => '_blank')));
     }
     $this->setButtons(array(_("Save"), array('class' => 'horde-delete', 'value' => _("Delete")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:45,代码来源:EditTaskList.php

示例8: __construct

 public function __construct($vars, $notepad)
 {
     $this->_notepad = $notepad;
     $owner = $notepad->get('owner') == $GLOBALS['registry']->getAuth() || is_null($notepad->get('owner')) && $GLOBALS['registry']->isAdmin();
     parent::__construct($vars, $owner ? sprintf(_("Edit %s"), $notepad->get('name')) : $notepad->get('name'));
     $this->addHidden('', 'n', 'text', true);
     $this->addVariable(_("Name"), 'name', 'text', true);
     if (!$owner) {
         $v = $this->addVariable(_("Owner"), 'owner', 'text', false);
         $owner_name = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($notepad->get('owner'))->getValue('fullname');
         if (trim($owner_name) == '') {
             $owner_name = $notepad->get('owner');
         }
         $v->setDefault($owner_name ? $owner_name : _("System"));
     }
     $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60));
     /* Permissions link. */
     if (empty($GLOBALS['conf']['share']['no_sharing']) && $owner) {
         $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php')->add(array('app' => 'mnemo', 'share' => $notepad->getName()));
         $this->addVariable('', '', 'link', false, false, null, array(array('url' => $url, 'text' => _("Change Permissions"), 'onclick' => Horde::popupJs($url, array('params' => array('urlencode' => true))) . 'return false;', 'class' => 'horde-button', 'target' => '_blank')));
     }
     $this->setButtons(array(_("Save"), array('class' => 'horde-delete', 'value' => _("Delete")), array('class' => 'horde-cancel', 'value' => _("Cancel"))));
 }
开发者ID:DSNS-LAB,项目名称:Dmail,代码行数:23,代码来源:EditNotepad.php

示例9: sprintf

    echo $this->contentTag('a', sprintf(ngettext("%d comment", "%d comments", $this->image->commentCount), $this->image->commentCount), array('href' => strval($this->img_view_url->copy()->setAnchor('messagediv')), 'title' => _("View or leave comments")));
    ?>
</div>
   <?php 
}
?>
   <?php 
if ($this->option_select) {
    ?>
     <div>
        <span class="light">
        <?php 
    if ($this->option_edit) {
        ?>
          <?php 
        echo $this->contentTag('a', _("Properties"), array('href' => $this->image_url->copy()->add(array('actionID' => 'modify')), 'target' => '_blank', 'onclick' => Horde::popupJs(Horde::url($this->image_url), array('height' => 360, 'width' => 500, 'params' => array('actionID' => 'modify', 'urlencode' => true))) . ' return false;'));
        ?>
    |     <?php 
        echo $this->contentTag('a', _("Edit"), array('href' => $this->image_url->copy()->add('actionID', 'editimage')));
        ?>
        <?php 
    }
    ?>
        </span>
     </div>
   <?php 
}
?>
  </div>
</div>
<!-- End image tile -->
开发者ID:jubinpatel,项目名称:horde,代码行数:31,代码来源:image.html.php

示例10: topbarCreate

 /**
  */
 public function topbarCreate(Horde_Tree_Renderer_Base $tree, $parent = null, array $params = array())
 {
     switch ($params['id']) {
         case 'menu':
             $tree->addNode(array('id' => $parent . '__add', 'parent' => $parent, 'label' => _("Enter Time"), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('hermes.png'), 'url' => Horde::url('entry.php'))));
             $tree->addNode(array('id' => $parent . '__search', 'parent' => $parent, 'label' => _("Search Time"), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('search.png'), 'url' => Horde::url('search.php'))));
             break;
         case 'stopwatch':
             $tree->addNode(array('id' => $parent . '__start', 'parent' => $parent, 'label' => _("Start Watch"), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('timer-start.png'), 'url' => '#', 'onclick' => Horde::popupJs(Horde::url('start.php'), array('height' => 200, 'width' => 410)))));
             $timers = Hermes::listTimers();
             $entry = Horde::url('entry.php');
             foreach ($timers as $i => $timer) {
                 $tree->addNode(array('id' => $parent . '__timer_' . $i, 'parent' => $parent, 'label' => $timer['name'] . sprintf(" (%s)", $timer['elapsed']), 'expanded' => false, 'params' => array('icon' => Horde_Themes::img('timer-stop.png'), 'url' => $entry->add('timer', $timer['id']))));
             }
     }
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:18,代码来源:Application.php

示例11: Horde_Config

    $config = new Horde_Config($app);
    if ($config->writePHPConfig($vars, $php)) {
        Horde::url('admin/config/index.php', true)->redirect();
    } else {
        $notification->push(sprintf(_("Could not save the configuration file %s. You can either use one of the options to save the code back on %s or copy manually the code below to %s."), Horde_Util::realPath($configFile), Horde::link(Horde::url('admin/config/index.php') . '#update', _("Configuration")) . _("Configuration") . '</a>', Horde_Util::realPath($configFile)), 'horde.warning', array('content.raw', 'sticky'));
    }
} elseif ($form->isSubmitted()) {
    $notification->push(_("There was an error in the configuration form. Perhaps you left out a required field."), 'horde.error');
}
$view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/admin/config'));
$view->addHelper('Text');
$view->php = $php;
/* Create the link for the diff popup only if stored in session. */
if ($session->exists('horde', 'config/' . $app)) {
    $url = Horde::url('admin/config/diff.php', true)->add('app', $app);
    $view->diff_popup = Horde::link('#', '', '', '', Horde::popupJs($url, array('height' => 480, 'width' => 640, 'urlencode' => true)) . 'return false;') . _("show differences") . '</a>';
}
Horde::startBuffer();
require HORDE_TEMPLATES . '/admin/menu.inc';
$menu_output = Horde::endBuffer();
/* Render the configuration form. */
$renderer = $form->getRenderer();
$renderer->setAttrColumnWidth('50%');
/* Buffer the form template */
Horde::startBuffer();
$form->renderActive($renderer, $vars, Horde::url('admin/config/config.php'), 'post');
$view->form = Horde::endBuffer();
/* Send headers */
$page_output->header(array('title' => $title));
/* Output page */
echo $menu_output . $view->render('config');
开发者ID:horde,项目名称:horde,代码行数:31,代码来源:config.php

示例12: _prepare

 /**
  * Build variables needed to output the html. Extracted to this method so
  * child classes can use this as well.
  */
 protected function _prepare()
 {
     global $conf;
     $this->_page = isset($this->_params['page']) ? $this->_params['page'] : 0;
     $this->_slug = $this->gallery->get('slug');
     $this->_date = $this->gallery->getDate();
     $this->_style = empty($this->_params['style']) ? $this->gallery->getStyle() : Ansel::getStyleDefinition($this->_params['style']);
     // Make sure the screen view is loaded and get the geometry
     try {
         $this->_geometry = $this->resource->getDimensions('screen');
     } catch (Ansel_Exception $e) {
         Horde::log($e, 'ERR');
         $this->_geometry = $GLOBALS['conf']['screen'];
     }
     // Get the image lists
     $this->_imageList = $this->gallery->listImages();
     $this->_revList = array_flip($this->_imageList);
     // Not needed when being called via api
     if (empty($this->_params['api'])) {
         // Build the various urls
         $imageActionUrl = Horde::url('image.php')->add(array_merge(array('gallery' => $this->gallery->id, 'image' => $this->resource->id, 'page' => $this->_page), $this->_date));
         if ($this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
             $this->_urls['prop_popup'] = Horde::popupJs($imageActionUrl, array('urlencode' => true, 'height' => 360, 'width' => 500, 'params' => array('actionID' => 'modify', 'ret' => 'image', 'gallery' => $this->gallery->id, 'image' => $this->resource->id, 'page' => $this->_page)));
             $this->_urls['edit'] = $imageActionUrl->copy()->add('actionID', 'editimage');
         }
         if ($this->gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
             $this->_urls['delete'] = $imageActionUrl->copy()->add('actionID', 'delete');
         }
         if (!empty($conf['ecard']['enable'])) {
             $this->_urls['ecard'] = Horde::url('img/ecard.php')->add(array_merge(array('gallery' => $this->gallery->id, 'image' => $this->resource->id), $this->_date));
         }
         if ($this->gallery->canDownload()) {
             $this->_urls['download'] = Horde::url('img/download.php', true)->add('image', $this->resource->id);
         }
         if ((!$GLOBALS['registry']->getAuth() || $this->gallery->get('owner') != $GLOBALS['registry']->getAuth()) && !empty($GLOBALS['conf']['report_content']['driver']) && ($conf['report_content']['allow'] == 'authenticated' && $GLOBALS['registry']->isAuthenticated() || $conf['report_content']['allow'] == 'all')) {
             $this->_urls['report'] = Horde::url('report.php')->add(array('gallery' => $this->gallery->id, 'image' => $this->resource->id));
         }
     }
     // Check for an explicit gallery view url to use
     if (!empty($this->_params['gallery_view_url'])) {
         $this->_urls['gallery'] = new Horde_Url(str_replace(array('%g', '%s'), array($this->gallery->id, $this->_slug), urldecode($this->_params['gallery_view_url'])));
         $this->_urls['gallery']->add($this->_date);
     } else {
         $this->_urls['gallery'] = Ansel::getUrlFor('view', array_merge(array('gallery' => $this->gallery->id, 'slug' => $this->_slug, 'page' => $this->_page, 'view' => 'Gallery'), $this->_date), true);
     }
     // Get the image src url
     $this->_urls['imgsrc'] = Ansel::getImageUrl($this->resource->id, 'screen', true, $this->_style);
     // A self url. Can't use Horde::selfUrl() since that would ignore
     // pretty urls.
     $this->_urls['self'] = Ansel::getUrlFor('view', array_merge(array('gallery' => $this->gallery->id, 'slug' => $this->_slug, 'image' => $this->resource->id, 'view' => 'Image', 'page' => $this->_page), $this->_date));
 }
开发者ID:horde,项目名称:horde,代码行数:55,代码来源:Image.php

示例13: _renderVarInput_obrowser

 function _renderVarInput_obrowser($form, $var, $vars)
 {
     $varname = $var->getVarName();
     $varvalue = $vars->get($varname);
     $fieldId = 'obrowser_' . uniqid(mt_rand());
     $html = '
         <script type="text/javascript">
         var obrowserWindowName;
         function obrowserCallback(name, oid)
         {
             if (name == obrowserWindowName) {
                 document.getElementById(\'' . $fieldId . '\').value = oid;
                 return false;
             } else {
                 return "Invalid window name supplied";
             }
         }
         </script>
         ';
     $html .= sprintf('<input type="hidden" name="%s" id="%s"%s value="%s" />', $varname, $fieldId, $this->_getActionScripts($form, $var), $varvalue);
     if (!empty($varvalue)) {
         $html .= $varvalue;
     }
     if ($GLOBALS['browser']->hasFeature('javascript')) {
         $imgId = $varname . 'goto';
         $html .= '<div id="goto" class="headerbox" style="position:absolute;visibility:hidden;padding:0"></div>';
         $html .= Horde::link('#', Horde_Model_Translation::t("Select an object"), '', '', 'obrowserWindow = ' . Horde::popupJs($GLOBALS['registry']->get('webroot', 'horde') . '/services/obrowser/') . 'obrowserWindowName = obrowserWindow.name; return false;') . Horde::img('tree/leaf.png', Horde_Model_Translation::t("Object"), 'id="' . $imgId . '" align="middle"') . "</a>\n";
     }
     return $html;
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:30,代码来源:Xhtml.php

示例14: _init

 /**
  * @throws IMP_Exception
  */
 protected function _init()
 {
     global $injector, $notification, $page_output;
     if (!$this->indices) {
         throw new IMP_Exception(_("No message index given."));
     }
     $page_output->addScriptFile('message.js');
     $page_output->addScriptFile('external/CustomElements.js');
     $page_output->addScriptFile('external/time-elements.js');
     $page_output->addScriptFile('textarearesize.js', 'horde');
     $page_output->addScriptFile('toggle_quotes.js', 'horde');
     $page_output->addScriptPackage('IMP_Script_Package_Imp');
     $page_output->addThemeStylesheet('message.css');
     $page_output->addThemeStylesheet('message_view.css');
     $js_vars = array();
     switch ($this->vars->actionID) {
         case 'strip_attachment':
             try {
                 $this->indices = new IMP_Indices_Mailbox($this->indices->mailbox, $this->indices->stripPart($this->vars->id));
                 $js_vars['-ImpMessage.strip'] = 1;
                 $notification->push(_("Attachment successfully stripped."), 'horde.success');
             } catch (IMP_Exception $e) {
                 $notification->push($e);
             }
             break;
     }
     try {
         $show_msg = new IMP_Contents_Message($this->indices);
         $msg_res = $show_msg->showMessage();
     } catch (IMP_Exception $e) {
         $notification->notify(array('listeners' => array('status', 'audio')));
         echo Horde::wrapInlineScript(array('parent.close()'));
         exit;
     }
     /* Add 'maillog' and 'poll' data to the AJAX queue. */
     $ajax_queue = $injector->getInstance('IMP_Ajax_Queue');
     $ajax_queue->maillog($this->indices);
     $ajax_queue->poll($this->indices->mailbox);
     list(, $buid) = $this->indices->buids->getSingle();
     /* Need to be dynamically added, since formatting needs to be applied
      * via javascript. */
     foreach (array('from', 'to', 'cc', 'bcc') as $val) {
         if ($tmp = $show_msg->getAddressHeader($val)) {
             $js_vars['ImpMessage.' . $val] = $tmp;
         }
     }
     if ($resent = $show_msg->getResentData()) {
         $resent_js = array();
         foreach ($resent as $val) {
             $resent_js[] = array('date' => $val['date']->format($val['date']::DATE_LOCAL), 'from' => $show_msg->getAddressHeader($val['from']));
         }
         $js_vars['ImpMessage.resent'] = $resent_js;
     }
     if (isset($msg_res['log'])) {
         $js_vars['ImpMessage.log'] = $msg_res['log'];
     }
     $list_info = $show_msg->contents->getListInformation();
     if (!empty($list_info['exists'])) {
         $js_vars['ImpMessage.reply_list'] = true;
         $this->view->listinfo = Horde::popupJs(IMP_Basic_Listinfo::url(array('buid' => $buid, 'mailbox' => $this->indices->mailbox)), array('urlencode' => true));
     }
     $js_vars['ImpMessage.buid'] = $buid;
     $js_vars['ImpMessage.mbox'] = $this->indices->mailbox->form_to;
     if (isset($msg_res['atc'])) {
         $js_vars['ImpMessage.msg_atc'] = $msg_res['atc'];
         $this->js_text['atc_downloadall'] = _("Download All (%s)");
     }
     if (isset($msg_res['md'])) {
         $js_vars['ImpMessage.msg_md'] = $msg_res['md'];
     }
     $js_vars['ImpMessage.tasks'] = $injector->getInstance('Horde_Core_Factory_Ajax')->create('imp', $this->vars)->getTasks();
     $page_output->addInlineJsVars($js_vars);
     if (isset($msg_res['js'])) {
         $page_output->addInlineScript(array_filter($msg_res['js']), true);
     }
     $this->_pages[] = 'message';
     $subject = $show_msg->getSubject();
     $this->view->subject = isset($subject['subjectlink']) ? $subject['subjectlink'] : $subject['subject'];
     $this->title = $subject['title'];
     /* Determine if compose mode is disabled. */
     if (IMP_Compose::canCompose()) {
         $this->view->qreply = $injector->getInstance('IMP_Dynamic_Compose_Common')->compose($this, array('title' => _("Message") . ': ' . $subject['subject']));
         $this->_pages[] = 'qreply';
         $this->js_conf['qreply'] = 1;
     }
     $page_output->noDnsPrefetch();
     $this->view->show_delete = $this->indices->mailbox->access_deletemsgs;
     list($real_mbox, ) = $this->indices->getSingle();
     $this->view->show_innocent = $real_mbox->innocent_show;
     $this->view->show_spam = $real_mbox->spam_show;
     $this->view->show_view_all = empty($msg_res['onepart']);
     $this->view->show_view_source = $injector->getInstance('Horde_Core_Perms')->hasAppPermission('view_msg_source');
     $this->view->save_as = $show_msg->getSaveAs();
     if ($date = $show_msg->getDateOb()) {
         $this->view->datestamp = $date->format($date::DATE_ISO_8601);
         $this->view->fulldate = $date->format($date::DATE_FORCE);
         $this->view->localdate = $date->format($date::DATE_LOCAL);
//.........这里部分代码省略.........
开发者ID:horde,项目名称:horde,代码行数:101,代码来源:Message.php

示例15: _init


//.........这里部分代码省略.........
         $a_view->show_thread = Horde::widget(array('url' => $mailbox->url(IMP_Basic_Thread::url(), $buid)->add(array('start' => $msgindex)), 'title' => _("_View Thread"), 'nocheck' => true));
     }
     if (!$readonly && $registry->hasMethod('mail/blacklistFrom')) {
         $a_view->blacklist = Horde::widget(array('url' => $self_link->copy()->add('actionID', 'blacklist'), 'title' => _("_Blacklist"), 'nocheck' => true));
     }
     if (!$readonly && $registry->hasMethod('mail/whitelistFrom')) {
         $a_view->whitelist = Horde::widget(array('url' => $self_link->copy()->add('actionID', 'whitelist'), 'title' => _("_Whitelist"), 'nocheck' => true));
     }
     if (!empty($conf['user']['allow_view_source'])) {
         $a_view->view_source = $imp_contents->linkViewJS($imp_contents->getMIMEMessage(), 'view_source', _("_Message Source"), array('css' => '', 'jstext' => _("Message Source"), 'widget' => true));
     }
     if (!$disable_compose && (in_array(Horde_Imap_Client::FLAG_DRAFT, $flags) || $msg_index['m']->drafts)) {
         $a_view->resume = Horde::widget(array('url' => $clink->add(array('actionID' => 'draft')), 'title' => _("Resume"), 'nocheck' => true));
     }
     $imp_params = $mailbox->urlParams($buid);
     $a_view->save_as = Horde::widget(array('url' => IMP_Contents_View::downloadUrl($subject, array_merge(array('actionID' => 'save_message'), $imp_params)), 'title' => _("Sa_ve as"), 'nocheck' => true));
     if ($msg_index['m']->spam_show) {
         $a_view->spam = Horde::widget(array('url' => '#', 'class' => 'spamAction', 'title' => _("Report as Spam"), 'nocheck' => true));
     }
     if ($msg_index['m']->innocent_show) {
         $a_view->innocent = Horde::widget(array('url' => '#', 'class' => 'innocentAction', 'title' => _("Report as Innocent"), 'nocheck' => true));
     }
     if (!$disable_compose) {
         $a_view->redirect = Horde::widget(array('url' => $clink->add(array('actionID' => 'redirect_compose')), 'title' => _("Redirec_t"), 'nocheck' => true));
     }
     $a_view->headers = Horde::widget(array('url' => '#', 'class' => 'horde-hasmenu', 'title' => _("Headers"), 'nocheck' => true));
     if ($all_headers) {
         $a_view->common_headers = Horde::widget(array('url' => $headersURL, 'title' => _("Show Common Headers"), 'nocheck' => true));
     }
     if (!$all_headers) {
         $a_view->all_headers = Horde::widget(array('url' => $headersURL->copy()->add('show_all_headers', 1), 'title' => _("Show All Headers"), 'nocheck' => true));
     }
     if ($list_info['exists']) {
         $a_view->list_headers = Horde::widget(array('onclick' => Horde::popupJs(IMP_Basic_Listinfo::url(array('buid' => $buid, 'mailbox' => $mailbox)), array('urlencode' => true)), 'title' => _("Show Mailing List Information"), 'nocheck' => true));
     }
     $hdrs = array();
     /* Prepare the main message template. */
     if (!$all_headers) {
         foreach ($display_headers as $head => $val) {
             $hdrs[] = array('name' => $basic_headers[$head], 'val' => $val);
         }
     }
     foreach ($full_headers as $head => $val) {
         if (is_array($val)) {
             $hdrs[] = array('name' => $head, 'val' => '<ul style="margin:0;padding-left:15px"><li>' . implode("</li>\n<li>", array_map('htmlspecialchars', $val)) . '</li></ul>');
         } else {
             $hdrs[] = array('name' => $head, 'val' => htmlspecialchars($val));
         }
     }
     /* Determine the fields that will appear in the MIME info entries. */
     $part_info = $part_info_display = array('icon', 'description', 'size');
     $part_info_action = array('download', 'download_zip', 'img_save', 'strip');
     $part_info_bodyonly = array('print');
     $show_parts = isset($this->vars->show_parts) ? $this->vars->show_parts : $prefs->getValue('parts_display');
     $part_info_display = array_merge($part_info_display, $part_info_action, $part_info_bodyonly);
     $contents_mask = IMP_Contents::SUMMARY_BYTES | IMP_Contents::SUMMARY_SIZE | IMP_Contents::SUMMARY_ICON | IMP_Contents::SUMMARY_DESCRIP_LINK | IMP_Contents::SUMMARY_DOWNLOAD | IMP_Contents::SUMMARY_DOWNLOAD_ZIP | IMP_Contents::SUMMARY_IMAGE_SAVE | IMP_Contents::SUMMARY_PRINT;
     /* Do MDN processing now. */
     $mdntext = $imp_ui->MDNCheck(new IMP_Indices($msg_index['m'], $buid), $mime_headers, $this->vars->mdn_confirm) ? strval(new IMP_Mime_Status(array(_("The sender of this message is requesting a notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link($selfURL->copy()->add('mdn_confirm', 1)) . _("HERE") . '</a>')))) : '';
     /* Build body text. This needs to be done before we build the
      * attachment list that lives in the header. */
     $inlineout = $imp_contents->getInlineOutput(array('mask' => $contents_mask, 'part_info_display' => $part_info_display, 'show_parts' => $show_parts));
     /* Build the Attachments menu. */
     $show_atc = false;
     switch ($show_parts) {
         case 'atc':
             $a_view->show_parts_all = Horde::widget(array('url' => $headersURL->copy()->add(array('show_parts' => 'all')), 'title' => _("Show All Parts"), 'nocheck' => true));
开发者ID:jubinpatel,项目名称:horde,代码行数:67,代码来源:Message.php


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