本文整理汇总了PHP中Fox类的典型用法代码示例。如果您正苦于以下问题:PHP Fox类的具体用法?PHP Fox怎么用?PHP Fox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Fox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('menu')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Menu Item Information');
$subForm1->setDescription('Menu Item Information');
$idField = new Zend_Form_Element_Hidden('id');
$title = new Zend_Form_Element_Text('title', array('class' => 'required', 'maxlength' => 200));
$title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$link = new Zend_Form_Element_Text('link', array('maxlength' => 200));
$link->setLabel('Link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDescription('Use module/controller/action for internal links or http://www.example.com for external links');
$open_window = new Zend_Form_Element_Select('open_window', array('class' => 'required', 'maxlength' => 200));
$open_window->setRequired(true)->setLabel('Open Window')->setMultiOptions(Fox::getModel('navigation/menu')->getAllTargetWindows());
$status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200));
$status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menu')->getAllStatuses());
$sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200));
$sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$style_class = new Zend_Form_Element_Text('style_class');
$style_class->setLabel('Style Class')->addFilter('StripTags')->addFilter('StringTrim');
$menugroup = new Zend_Form_Element_Multiselect('menu_group', array('class' => 'required'));
$menugroup->setRequired(true)->setLabel('Menu Group')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setMultiOptions(Fox::getModel('navigation/menugroup')->getMenuGroupOptions());
$subForm1->addElements(array($idField, $title, $link, $open_window, $sort_order, $style_class, $status, $menugroup));
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:30,代码来源:Form.php
示例2: getConfig
/**
* Get config
*
* @return Fox_Extensionmanager_Model_Config
*/
protected function getConfig()
{
if (!$this->config) {
$this->config = Fox::getModel("extensionmanager/config");
}
return $this->config;
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Packages.php
示例3: getAllGeneratedPackages
/**
* Get all generated packages
*
* @return array
*/
public function getAllGeneratedPackages()
{
$package = Fox::getModel("extensionmanager/generate/package");
$pkgPath = $package->getGeneratedPkgDir();
$pkgList = array();
$noMod = array('.', '..');
$doc = new DOMDocument();
if (is_dir($pkgPath)) {
$dp = opendir($pkgPath);
while ($file = readdir($dp)) {
if (!in_array($file, $noMod)) {
$doc->load($pkgPath . DS . $file);
if ($doc->documentElement->nodeName == Fox_Extensionmanager_Model_Generate_Package::PACKAGE_ROOT_ELEMENT && $doc->documentElement->childNodes) {
$data = array();
$nList = $doc->documentElement->childNodes;
foreach ($nList as $n) {
if (in_array($n->nodeName, array(Fox_Extensionmanager_Model_Generate_Package::PACKAGE_NAME_ELEMENT, Fox_Extensionmanager_Model_Generate_Package::PACKAGE_VERSION_ELEMENT, Fox_Extensionmanager_Model_Generate_Package::PACKAGE_STABILITY_ELEMENT))) {
$data[$n->nodeName] = $n->nodeValue;
}
}
if ($data) {
$pkgList[] = $data;
}
}
}
}
}
sort($pkgList);
return $pkgList;
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:35,代码来源:Table.php
示例4: reply
/**
* Send reply to contact request
*
* @param string $replyMessage
*/
public function reply($replyMessage)
{
$this->setStatus(Fox_Contact_Model_Contact::STATUS_REPLIED);
$this->save();
$modelTemplate = Fox::getModel('core/email/template');
$modelTemplate->sendTemplateMail(Fox::getPreference('contact/reply/email_template'), $this->getEmail(), array('sender_email' => Fox::getPreference('contact/reply/email'), 'sender_name' => Fox::getPreference('contact/reply/name')), array('name' => $this->getName(), 'subject' => $this->getSubject(), 'message' => $this->getMessage(), 'reply' => $replyMessage));
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Contact.php
示例5: getTemplateContent
/**
* Get newsletter template content
*
* @return string
*/
public function getTemplateContent()
{
$id = $this->getRequest()->getParam('tId');
$model = Fox::getModel('newsletter/template');
$model->load($id);
return $model->getContent();
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Preview.php
示例6: render
/**
* Render contents
*
* @return string
*/
public function render()
{
$args = func_get_args();
$changePwdImg = Fox::getThemeUrl('images/change_pwd.png');
$loginImg = Fox::getThemeUrl('images/login.png');
return '<a target="_self" href="' . $args[0]['change_password'] . '" title="' . $args[0]['change_password'] . '"><img src="' . $changePwdImg . '" alt="Change Password" title="Change Password" style="border:none;" /></a> <a target="_blank" href="' . $args[0]['login'] . '" title="' . $args[0]['login'] . '"><img src="' . $loginImg . '" alt="Login" title="Login" style="border:none;" /></a>';
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Action.php
示例7: traverseDirFiles
/**
* Traverses Files and Directories inside given path Recursively
* @param $path to traverse
*/
public function traverseDirFiles($path)
{
$dir = opendir($path);
$files = array();
$f = array();
$skip = array(Fox::getDirectoryPath() . DS . "var", Fox::getDirectoryPath() . DS . "library" . DS . "Zend", Fox::getExtensionDirectoryPath(), Fox::getDirectoryPath() . DS . "theme" . DS . "installer", APPLICATION_PATH . DS . "views" . DS . "installer");
while ($ft = readdir($dir)) {
if (in_array($ft, array(".", "..")) || in_array($path . DS . $ft, $skip)) {
continue;
}
$f[] = $ft;
}
sort($f);
foreach ($f as $file) {
if (filetype($path . DS . $file) != "dir") {
$files[] = $file;
} else {
$this->traverseDirFiles($path . DS . $file);
}
}
foreach ($files as $f) {
$this->processFiles($path, $f);
}
closedir($dir);
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:29,代码来源:DirectoryToXml.php
示例8: routKey
/**
* Loades cms page of specified key
*
* @param Fox_Core_Controller_Action $controller
* @param string $key
* @return boolean
*/
public function routKey($controller, $key)
{
$page = Fox::getModel('cms/page');
$page->load($key, 'url_key');
if ($page->getId() && $page->getStatus()) {
if (($container = $page->getLayout()) != '') {
$layoutUpdate = '<container key="' . $container . '"/>';
}
if (($lUpdate = $page->getLayoutUpdate()) != '') {
$layoutUpdate .= $lUpdate;
}
$layout = $controller->loadLayout($layoutUpdate, $key);
$layout->setTitle($page->getTitle());
$layout->setMetaKeywords($page->getMetaKeywords());
$layout->setMetaDescription($page->getMetaDescription());
if ($contentView = $controller->getViewByKey('content')) {
$pageView = Fox::getView('cms/page');
$pageView->setPageContent($page->getContent());
$pageView->setPageTitle($page->getTitle());
$pageView->setPageUrlKey($page->getUrlKey());
$contentView->addChild('__page_content__', $pageView);
}
$controller->renderLayout();
$controller->getResponse()->setHeader('HTTP/1.1', '200 ok');
$controller->getResponse()->setHeader('Status', '200 ok');
$this->routingCompleted = TRUE;
}
return $this->routingCompleted;
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:36,代码来源:Router.php
示例9: pageNotFoundAction
/**
* Page not found action
*/
public function pageNotFoundAction()
{
$this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');
$this->getResponse()->setHeader('Status', '404 File not found');
if (!Fox::getHelper('core/router')->routKey($this, 'no-page-404')) {
$this->_forward('nothing');
}
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:11,代码来源:IndexController.php
示例10: _prepareContainer
/**
* Prepare container
*/
protected function _prepareContainer()
{
parent::_prepareContainer();
$this->setIsEditButtonEnabled(FALSE);
$this->setIsSaveButtonEnabled(FALSE);
$this->setIsResetButtonEnabled(FALSE);
$this->addButton(array('name' => 'reply', 'id' => 'reply', 'button_text' => 'Reply', 'style_class' => 'form-button', 'icon_class' => 'save', 'url' => Fox::getUrl('*/*/reply', array('id' => $this->getRequest()->getParam('id')))));
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:11,代码来源:View.php
示例11: deleteModules
/**
* Delete Modules
*
* @param array $modules Name of modules that needs to be deleted are passed as array values
*/
public function deleteModules($modules)
{
foreach ($modules as $moduleName) {
$module = Fox::getModel('core/module');
$module->load($moduleName);
$module->delete();
}
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:13,代码来源:Module.php
示例12: render
/**
* Render contents
*
* @return string
*/
public function render()
{
$args = func_get_args();
$url = $args[0]['preview_url'];
$queueImg = Fox::getThemeUrl('images/queue.png');
$previewImg = Fox::getThemeUrl('images/preview.png');
$previewUrl = "window.open('" . $url . "','previewWindow','width=800,height=600')";
return '<a href="' . $args[0]['send_newsletter'] . '" title="' . $args[0]['send_newsletter'] . '"><img src="' . $queueImg . '" alt="Send Newsletter" title="Send Newsletter" style="border:none;" width="22" height="22"/></a> <a target="_blank" title="' . $args[0]['preview_url'] . '" title="' . $args[0]['preview_url'] . '" onclick="' . $previewUrl . '"><img src="' . $previewImg . '" alt="Preview" title="Preview" /></a>';
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:14,代码来源:Action.php
示例13: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form_Eav $form
*/
protected function _prepareForm(Uni_Core_Form_Eav $form)
{
$form->setName('setting')->setMethod('post');
$model = Fox::getModel($this->getModelKey());
$eavMetaData = $model->getEavFormMetaData();
$form->createEavForm($eavMetaData);
$form->setElementsBelongTo($model->getItem());
parent::_prepareForm($form);
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:14,代码来源:Form.php
示例14: _prepareCollection
/**
* Prepare model collection
*/
protected function _prepareCollection()
{
$model = Fox::getModel('admin/role');
$sortCondition = $this->getSortCondition();
$filters = $this->getSearchCriteria();
$collection = $model->getModelCollection($filters, '*', $sortCondition, $this->getColumns());
$this->setCollection($collection);
parent::_prepareCollection();
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:12,代码来源:Table.php
示例15: _prepareColumns
/**
* Prepare table columns
*/
protected function _prepareColumns()
{
$this->addColumn('id', array('label' => 'Id', 'align' => 'left', 'width' => 50, 'type' => self::TYPE_NUMBER, 'field' => 'id'));
$this->addColumn('title', array('label' => 'Title', 'align' => 'left', 'field' => 'title'));
$this->addColumn('identifier_key', array('label' => 'Identifier Key', 'align' => 'left', 'field' => 'identifier_key'));
$this->addColumn('status', array('label' => 'Status', 'align' => 'center', 'width' => 100, 'type' => self::TYPE_OPTIONS, 'options' => Fox::getModel('cms/block')->getAllStatuses(), 'field' => 'status'));
$this->addColumn('created_on', array('label' => 'Created On', 'align' => 'center', 'width' => 182, 'type' => self::TYPE_DATE, 'field' => 'created_on'));
$this->addColumn('modified_on', array('label' => 'Modified On', 'align' => 'center', 'width' => 182, 'type' => self::TYPE_DATE, 'field' => 'modified_on'));
parent::_prepareColumns();
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:13,代码来源:Table.php
示例16: getBlockContent
/**
* Get parsed cms block content
*
* @param string $identifierKey
* @return string
*/
public function getBlockContent($identifierKey)
{
$parsedContent = NULL;
$model = Fox::getModel('cms/block');
$model->load($identifierKey, 'identifier_key');
if ($model->getId() && $model->getStatus() == Fox_Cms_Model_Block::STATUS_ENABLED) {
$parsedContent = $this->view->getParsedContent($model->getContent());
}
return $parsedContent;
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:16,代码来源:GetBlockContent.php
示例17: getMenuMarkup
/**
* Get menu html
*
* @return string
*/
function getMenuMarkup()
{
$markup = '';
$settingModel = Fox::getModel('admin/system/setting/config');
if ($settingModel) {
$settingModel->loadSettingData($this->getRequest()->getParam('item', 'general'));
$markup = $settingModel->getMenuMarkup();
}
return $markup;
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:15,代码来源:Menu.php
示例18: _prepareContainer
/**
* Prepare container
*/
protected function _prepareContainer()
{
if (Fox::getModel('extensionmanager/session')->getFormData()) {
$this->editing = true;
$this->addButton(array("type" => "button", "button_text" => "Generate Package", "url" => $this->getUrl("*/*/generate-package"), "style_class" => "form-button", "confirm" => true, "confirm_text" => "Unsaved changes to package may lost."));
}
$this->deleteButtonUrl = Fox::getUrl("*/*/delete");
$this->setIsDeleteButtonEnabled(TRUE);
parent::_prepareContainer();
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:13,代码来源:Add.php
示例19: preDispatch
/**
* Controller predispatch method
*
* Called before action method
*/
function preDispatch()
{
parent::preDispatch();
if (!Fox::getModel('member/session')->getLoginData()) {
if (!('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'login' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'create' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'forgot-password' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'verification' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'change-forget-password' === strtolower($this->getRequest()->getActionName()))) {
$this->sendRedirect('member/account/login');
}
} else {
Fox::getModel('member/session')->setSessionTimeout(Fox::getMemberSessionInterval());
}
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:16,代码来源:Action.php
示例20: getBlockContent
/**
* Get parsed block content
*
* @return string
*/
public function getBlockContent()
{
if (NULL == $this->parsedContent) {
$model = Fox::getModel('cms/block');
$model->load($this->getViewKey(), 'identifier_key');
if ($model->getId() && $model->getStatus() == Fox_Cms_Model_Block::STATUS_ENABLED) {
$this->blockContent = $model->getContent();
$this->parsedContent = stripslashes($this->getParsedContent($this->blockContent));
}
}
return $this->parsedContent ? $this->parsedContent : '';
}
开发者ID:UnicodeSystems-PrivateLimited,项目名称:Zendfox,代码行数:17,代码来源:Block.php
注:本文中的Fox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论