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


PHP Shineisp_Registry::getInstance方法代码示例

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


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

示例1: grid

 /**
  * grid
  * create the configuration of the grid
  */
 public static function grid($rowNum = 10)
 {
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $config['datagrid']['columns'][] = array('label' => null, 'field' => 's.subscriber_id', 'alias' => 'subscriber_id', 'type' => 'selectall');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 's.subscriber_id', 'alias' => 'subscriber_id', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Email'), 'field' => 's.email', 'alias' => 'email', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Subscription Date'), 'field' => 's.subscriptiondate', 'alias' => 'subscriptiondate', 'sortable' => true, 'searchable' => true, 'type' => 'date');
     $config['datagrid']['fields'] = "s.subscriber_id, s.email as email, DATE_FORMAT(s.subscriptiondate, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i:%s') as subscriptiondate";
     $config['datagrid']['rownum'] = $rowNum;
     $config['datagrid']['dqrecordset'] = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('NewslettersSubscribers s');
     $config['datagrid']['basepath'] = "/admin/subscribers/";
     $config['datagrid']['index'] = "subscriber_id";
     $config['datagrid']['rowlist'] = array('10', '50', '100', '1000');
     $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit');
     $config['datagrid']['buttons']['edit']['cssicon'] = "edit";
     $config['datagrid']['buttons']['edit']['action'] = "/admin/subscribers/edit/id/%d";
     $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete');
     $config['datagrid']['buttons']['delete']['cssicon'] = "delete";
     $config['datagrid']['buttons']['delete']['action'] = "/admin/subscribers/delete/id/%d";
     $config['datagrid']['massactions'] = array('massdelete' => 'Mass Delete', 'bulkexport' => 'Export');
     $bulkmailinglist = array();
     $mailchimplists = Newsletters::get_mailchimp_list();
     if (!empty($mailchimplists)) {
         foreach ($mailchimplists as $id => $name) {
             $bulkmailinglist['bulk_mailchimp_optin&list=' . $id] = "Add to ({$name})";
             $bulkmailinglist['bulk_mailchimp_optout&list=' . $id] = "Remove from ({$name})";
         }
     }
     $config['datagrid']['massactions']['commons'] = array_merge($config['datagrid']['massactions'], $bulkmailinglist);
     return $config;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:NewslettersSubscribers.php

示例2: Last

 /**
  * List of the last messages attached within the orders, domains, customers detail page
  * 
  * 
  * @param string $attachedto [orders, domains]
  * @param integer $limit
  * @return ArrayObject
  */
 public static function Last($attachedto = "orders", $limit = 5, $delIspReplies = true)
 {
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $dq = Doctrine_Query::create()->from('Messages m');
     // Adding first the main ID index field
     if ($attachedto == "orders") {
         $dq->select("order_id as id");
         $dq->where("order_id IS NOT NULL");
     } elseif ($attachedto == "domains") {
         $dq->select("domain_id as id");
         $dq->where("domain_id IS NOT NULL");
     }
     // now we can add more fields
     $dq->addSelect("DATE_FORMAT(m.dateposted, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i:%s') as date, m.message as message");
     if ($delIspReplies) {
         $dq->andWhere("customer_id IS NOT NULL");
     }
     // Sort the items
     $dq->orderBy('m.dateposted desc')->limit($limit);
     $records['data'] = $dq->execute(null, Doctrine::HYDRATE_ARRAY);
     // Strip the html and trucate the message
     for ($i = 0; $i < count($records['data']); $i++) {
         $records['data'][$i]['message'] = Shineisp_Commons_Utilities::truncate(strip_tags($records['data'][$i]['message']), 50, "...", false, true);
     }
     // adding the index reference
     $records['index'] = "id";
     // Create the header table columns
     $records['fields'] = array('date' => array('label' => $translator->translate('Date')), 'message' => array('label' => $translator->translate('Message')));
     return $records;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:38,代码来源:Messages.php

示例3: grid

 /**
  * grid
  * create the configuration of the grid
  */
 public static function grid($rowNum = 10)
 {
     $Session = new Zend_Session_Namespace('Default');
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $config['datagrid']['columns'][] = array('label' => null, 'field' => 'cms.page_id', 'alias' => 'page_id', 'type' => 'selectall');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'cms.page_id', 'alias' => 'page_id', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Title'), 'field' => 'title', 'alias' => 'title', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Variable'), 'field' => 'var', 'alias' => 'var', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Date'), 'field' => 'cms.publishedat', 'alias' => 'date', 'sortable' => true, 'searchable' => true, 'type' => 'date');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Language'), 'type' => 'arraydata', 'index' => 'page_id', 'alias' => 'dummy', 'run' => array('CmsPagesData' => 'getTranslations'));
     $config['datagrid']['fields'] = "cms.page_id, DATE_FORMAT(cms.publishedat, '" . Settings::getMySQLDateFormat('dateformat') . "') as date, cms.title, cms.var";
     $config['datagrid']['rownum'] = $rowNum;
     $config['datagrid']['dqrecordset'] = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('CmsPages cms');
     $config['datagrid']['basepath'] = "/admin/cmspages/";
     $config['datagrid']['index'] = "page_id";
     $config['datagrid']['rowlist'] = array('10', '50', '100', '1000');
     $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit');
     $config['datagrid']['buttons']['edit']['cssicon'] = "edit";
     $config['datagrid']['buttons']['edit']['action'] = "/admin/cmspages/edit/id/%d";
     $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete');
     $config['datagrid']['buttons']['delete']['cssicon'] = "delete";
     $config['datagrid']['buttons']['delete']['action'] = "/admin/cmspages/delete/id/%d";
     $config['datagrid']['massactions']['common'] = array('massdelete' => 'Mass Delete');
     return $config;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:29,代码来源:CmsPages.php

示例4: grid

 /**
  * grid
  * create the configuration of the grid
  */
 public static function grid($rowNum = 10)
 {
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $config['datagrid']['columns'][] = array('label' => null, 'field' => 'dt.tld_id', 'alias' => 'tld_id', 'type' => 'selectall');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'dt.tld_id', 'alias' => 'tld_id', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('TLD'), 'field' => 'ws.tld', 'alias' => 'tld', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Registration price'), 'field' => 'dt.new', 'alias' => 'new', 'sortable' => true, 'searchable' => true, 'type' => 'integer', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs'));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Transfer price'), 'field' => 'dt.transfer', 'alias' => 'transfer', 'sortable' => true, 'searchable' => true, 'type' => 'integer', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs'));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Renewal price'), 'field' => 'dt.renew', 'alias' => 'renew', 'sortable' => true, 'searchable' => true, 'type' => 'integer', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs'));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Whois'), 'field' => 'ws.server', 'alias' => 'whois', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs'));
     $config['datagrid']['fields'] = "dt.tld_id, ws.server as whois, ws.tld as tld, dt.registration_price as new, dt.transfer_price as transfer, dt.renewal_price as renew";
     $config['datagrid']['dqrecordset'] = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('DomainsTlds dt')->leftJoin('dt.WhoisServers ws')->leftJoin('dt.DomainsTldsData dtd')->orderBy('ws.tld');
     $config['datagrid']['rownum'] = $rowNum;
     $config['datagrid']['basepath'] = "/admin/domainstlds/";
     $config['datagrid']['index'] = "tld_id";
     $config['datagrid']['rowlist'] = array('10', '50', '100', '1000');
     $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit');
     $config['datagrid']['buttons']['edit']['cssicon'] = "edit";
     $config['datagrid']['buttons']['edit']['action'] = "/admin/domainstlds/edit/id/%d";
     $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete');
     $config['datagrid']['buttons']['delete']['cssicon'] = "delete";
     $config['datagrid']['buttons']['delete']['action'] = "/admin/domainstlds/delete/id/%d";
     $config['datagrid']['massactions'] = array('massdelete' => 'Delete');
     return $config;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:29,代码来源:DomainsTlds.php

示例5: customers

 public function customers()
 {
     $registry = Shineisp_Registry::getInstance();
     $translator = $registry->Zend_Translate;
     $this->view->customers = Customers::getList($translator->translate('Select the customer ...'), array(array('where' => 'u.status_id = ?', 'params' => Statuses::id('active', 'customers'))));
     return $this->view->render('partials/customers.phtml');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:7,代码来源:Customers.php

示例6: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->setScriptPath(realpath(APPLICATION_PATH . '/../public') . '/skins/commons/invoices/');
     $this->assign('translator', Shineisp_Registry::getInstance()->Zend_Translate);
     require_once PROJECT_PATH . '/library/html2pdf/html2pdf.class.php';
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:7,代码来源:Invoice.php

示例7: time_since

 public static function time_since($original)
 {
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $original = strtotime($original);
     // array of time period chunks
     $chunks = array(array(60 * 60 * 24 * 365, $translator->translate('years')), array(60 * 60 * 24 * 30, $translator->translate('months')), array(60 * 60 * 24 * 7, $translator->translate('weeks')), array(60 * 60 * 24, $translator->translate('days')), array(60 * 60, $translator->translate('hours')), array(60, $translator->translate('minutes')));
     $today = time();
     /* Current unix time  */
     $since = $today - $original;
     // $j saves performing the count function each time around the loop
     for ($i = 0, $j = count($chunks); $i < $j; $i++) {
         $seconds = $chunks[$i][0];
         $name = $chunks[$i][1];
         // finding the biggest chunk (if the chunk fits, break)
         if (($count = floor($since / $seconds)) != 0) {
             // DEBUG print "<!-- It's $name -->\n";
             break;
         }
     }
     $print = $count == 1 ? '1 ' . $name : "{$count} {$name}";
     if ($i + 1 < $j) {
         // now getting the second item
         $seconds2 = $chunks[$i + 1][0];
         $name2 = $chunks[$i + 1][1];
         // add second item if it's greater than 0
         if (($count2 = floor(($since - $seconds * $count) / $seconds2)) != 0) {
             $print .= $count2 == 1 ? ', 1 ' . $name2 : ", {$count2} {$name2}";
         }
     }
     return $print;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:31,代码来源:TimeSince.php

示例8: init

 public function init()
 {
     $registry = Shineisp_Registry::getInstance();
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $logged_user = $auth->getIdentity();
     }
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Firstname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     // Check if the user is an administrator, if not the select role object will become an hidden field
     if (AdminRoles::isAdministrator($logged_user['user_id'])) {
         $this->addElement('select', 'role_id', array('required' => true, 'label' => $translate->_('Role'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
         $this->getElement('role_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(AdminRoles::getList());
         $this->addElement('select', 'isp_id', array('required' => true, 'label' => $translate->_('Isp Company'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
         $this->getElement('isp_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Isp::getList());
     } else {
         $this->addElement('hidden', 'role_id');
         $this->addElement('hidden', 'isp_id');
     }
     $this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array(array('validator' => 'EmailAddress')), 'required' => true, 'label' => $translate->_('Email'), 'class' => 'form-control'));
     $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'validators' => array(array('regex', false, '/^[a-zA-Z0-9\\-\\_\\.\\%\\!\\$]{6,20}$/')), 'label' => $translate->_('Password'), 'class' => 'form-control'));
     $this->addElement('hidden', 'user_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:26,代码来源:ProfileForm.php

示例9: preDispatch

 /**
  * preDispatch
  * Starting of the module
  * (non-PHPdoc)
  * @see library/Zend/Controller/Shineisp_Controller_Default#preDispatch()
  */
 public function preDispatch()
 {
     $registry = Shineisp_Registry::getInstance();
     $this->wiki = new Wiki();
     $this->translator = $registry->Zend_Translate;
     $this->getHelper('layout')->setLayout('1column');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:13,代码来源:WikiController.php

示例10: grid

 /**
  * grid
  * create the configuration of the grid
  */
 public static function grid($rowNum = 10)
 {
     $Session = new Zend_Session_Namespace('Default');
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $config['datagrid']['columns'][] = array('label' => null, 'field' => 'u.user_id', 'alias' => 'user_id', 'type' => 'selectall');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'u.user_id', 'alias' => 'user_id', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Firstname'), 'field' => 'u.firstname', 'alias' => 'firstname', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => "visible-lg visible-md hidden-xs"));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Lastname'), 'field' => 'u.lastname', 'alias' => 'lastname', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => "visible-lg visible-md hidden-xs"));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('E-Mail'), 'field' => 'u.email', 'alias' => 'email', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => "visible-lg visible-md hidden-xs"));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Role'), 'field' => 'r.name', 'alias' => 'role', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['fields'] = "u.user_id, u.firstname, u.lastname, u.email, r.name as role";
     $config['datagrid']['rownum'] = $rowNum;
     $config['datagrid']['dqrecordset'] = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('AdminUser u')->leftJoin('u.AdminRoles r');
     $config['datagrid']['basepath'] = "/admin/profile/";
     $config['datagrid']['index'] = "user_id";
     $config['datagrid']['rowlist'] = array('10', '50', '100', '1000');
     $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit');
     $config['datagrid']['buttons']['edit']['cssicon'] = "edit";
     $config['datagrid']['buttons']['edit']['action'] = "/admin/profile/edit/id/%d";
     $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete');
     $config['datagrid']['buttons']['delete']['cssicon'] = "delete";
     $config['datagrid']['buttons']['delete']['action'] = "/admin/profile/delete/id/%d";
     $config['datagrid']['massactions'] = array('massdelete' => 'Mass Delete');
     return $config;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:29,代码来源:AdminUser.php

示例11: grid

 /**
  * grid
  * create the configuration of the grid
  */
 public static function grid($rowNum = 10)
 {
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Return usage/max_services or usage/infinity if max_services is 0 or null
     $sqlIF = "\r\n\t\t\t(IF ( s.max_services \r\n     \t\t\t ,CONCAT(s.services,'/',s.max_services,' (',ROUND(s.services*100/s.max_services),'%)')\r\n     \t\t\t ,CONCAT(s.services,'/&infin;') \r\n\t\t\t))\r\n\t\t";
     $config['datagrid']['columns'][] = array('label' => null, 'field' => 's.server_id', 'alias' => 'server_id', 'type' => 'selectall');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 's.server_id', 'alias' => 'server_id', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Name'), 'field' => 'r.subject', 'alias' => 'servername', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('IP'), 'field' => 's.ip', 'alias' => 'ip', 'sortable' => true, 'searchable' => true, 'attributes' => array('class' => "visible-lg visible-md hidden-xs"));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Status'), 'field' => 'stat.status', 'alias' => 'status', 'sortable' => true, 'searchable' => true, 'attributes' => array('class' => "visible-lg visible-md hidden-xs"));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Usage'), 'field' => 's.usage', 'alias' => 'usage', 'sortable' => false, 'searchable' => false, 'attributes' => array('class' => "visible-lg visible-md hidden-xs"));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Panel'), 'field' => 'panel.name', 'alias' => 'panel_name', 'sortable' => true, 'searchable' => true, 'attributes' => array('class' => "visible-lg visible-md hidden-xs"));
     $config['datagrid']['fields'] = "s.server_id, s.name as servername, " . $sqlIF . " AS usage, s.max_services AS max_services, s.ip as ip, stat.status as status, panel.name as panel_name";
     $config['datagrid']['dqrecordset'] = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('Servers s')->leftJoin('s.Isp i')->leftJoin('s.Servers_Types st')->leftJoin('s.Statuses stat')->leftJoin('s.Panels panel');
     $config['datagrid']['rownum'] = $rowNum;
     $config['datagrid']['basepath'] = "/admin/servers/";
     $config['datagrid']['index'] = "server_id";
     $config['datagrid']['rowlist'] = array('10', '50', '100', '1000');
     $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit');
     $config['datagrid']['buttons']['edit']['cssicon'] = "edit";
     $config['datagrid']['buttons']['edit']['action'] = "/admin/servers/edit/id/%d";
     $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete');
     $config['datagrid']['buttons']['delete']['cssicon'] = "delete";
     $config['datagrid']['buttons']['delete']['action'] = "/admin/servers/delete/id/%d";
     $config['datagrid']['massactions'] = array('massdelete' => 'Mass Delete');
     return $config;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:31,代码来源:Servers.php

示例12: grid

 /**
  * grid
  * create the configuration of the grid
  */
 public static function grid($rowNum = 10, $locale = null)
 {
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     if ($locale === null) {
         $Session = new Zend_Session_Namespace('Admin');
         $locale = $Session->langid;
     }
     $config['datagrid']['columns'][] = array('label' => null, 'field' => 'pa.attribute_id', 'alias' => 'attribute_id', 'type' => 'selectall');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'pa.attribute_id', 'alias' => 'attribute_id', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Code'), 'field' => 'code', 'alias' => 'code', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Label'), 'field' => 'pad.label', 'alias' => 'label', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => Isp::getPanel() . " " . $translator->translate('System Attributes'), 'field' => 'pa.system_var', 'alias' => 'system_var', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Default'), 'field' => 'pa.defaultvalue', 'alias' => 'default', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Position'), 'field' => 'pa.position', 'alias' => 'position', 'sortable' => true, 'searchable' => true, 'type' => 'index');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Visible on Frontend'), 'field' => 'pa.is_visible_on_front', 'alias' => 'visible', 'sortable' => true, 'searchable' => true, 'type' => 'boolean');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Groups'), 'type' => 'arraydata', 'index' => 'attribute_id', 'alias' => 'dummy', 'run' => array('ProductsAttributes' => 'getGroups'));
     $config['datagrid']['fields'] = "attribute_id, code, pad.label as label, pa.system_var as system_var, pa.is_visible_on_front as visible, pa.position as position, pa.defaultvalue as default";
     $config['datagrid']['dqrecordset'] = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('ProductsAttributes pa')->leftJoin('pa.ProductsAttributesData pad WITH pad.language_id = ' . $locale);
     $config['datagrid']['rownum'] = $rowNum;
     $config['datagrid']['basepath'] = "/admin/productsattributes/";
     $config['datagrid']['index'] = "attribute_id";
     $config['datagrid']['rowlist'] = array('10', '50', '100', '1000');
     $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit');
     $config['datagrid']['buttons']['edit']['cssicon'] = "edit";
     $config['datagrid']['buttons']['edit']['action'] = "/admin/productsattributes/edit/id/%d";
     $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete');
     $config['datagrid']['buttons']['delete']['cssicon'] = "delete";
     $config['datagrid']['buttons']['delete']['action'] = "/admin/productsattributes/delete/id/%d";
     $config['datagrid']['massactions']['common'] = array('massdelete' => 'Mass Delete');
     return $config;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:ProductsAttributes.php

示例13: tldSummaryPerMonth

 public function tldSummaryPerMonth()
 {
     $NS = new Zend_Session_Namespace('Default');
     $registry = Shineisp_Registry::getInstance();
     $translation = $registry->Zend_Translate;
     $domains = array();
     if (!empty($NS->customer)) {
         $this->view->uri = "";
         $data = $NS->customer;
         // Get the data information
         $all_domains = Domains::getSummaryPerMonth($data['customer_id']);
         $autorenew_domains = Domains::getAutorenewSummaryPerMonth($data['customer_id']);
         for ($i = 1; $i <= 12; $i++) {
             $domains['months'][$i] = date('M', strtotime(date('Y/m/01/', strtotime("2012/12/1")) . " {$i} month"));
             $domains['autorenew'][$i] = 0;
             $domains['norenew'][$i] = 0;
             foreach ($autorenew_domains as $domain) {
                 if ($domain['monthid'] == $i) {
                     $domains['autorenew'][$i] = $domain['total'];
                 }
             }
             foreach ($all_domains as $domain) {
                 if ($domain['month_number'] == $i) {
                     $domains['norenew'][$i] = $domain['total'] - $domains['autorenew'][$i];
                 }
             }
         }
         $norenew = implode(",", $domains['norenew']);
         $autorenew = implode(",", $domains['autorenew']);
         $months = implode("|", $domains['months']);
         $max = max($domains['autorenew']);
         $this->view->uri = "http://chart.apis.google.com/chart?cht=bvg\n\t\t\t&chdlp=t\n\t\t\t&chtt=" . $translation->translate('Domain Summary per Month') . "\n\t\t\t&chdl=" . $translation->translate('Automatic Renewal') . "|" . $translation->translate('No Auto Renew') . "\n\t\t\t&chts=4d89f9,18\n\t\t\t&chs=550x300\n\t\t\t&chd=t:" . $autorenew . "|" . $norenew . "\n\t\t\t&chxt=x\n\t\t\t&chxl=0:|" . $months . "\n\t\t\t&chco=4d89f9,FF1F1F\n\t\t\t&chds=0," . $max . "\n\t\t\t&chm=N,000000,-1,,11|N,000000,0,,11\n\t\t\t&chbh=a";
     }
     return $this->view->render('partials/graph.phtml');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:Graphs.php

示例14: Show

 public function Show($parameters)
 {
     $output = "";
     $ns = new Zend_Session_Namespace();
     $languageID = Languages::get_language_id($ns->lang);
     $mainviewhelper = new Zend_View();
     $mainviewhelper->addBasePath(APPLICATION_PATH . '/modules/default/views/');
     $view = new Zend_View();
     $view->addScriptPath('../library/Shineisp/Custom/views');
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     if (!empty($parameters['code'])) {
         $code = $parameters['code'];
     } else {
         return "";
     }
     // Get the products
     $data = Products::GetProductsByGroupCode($code, $languageID);
     // Check the existence of the mandatories attributes
     if (!empty($data['attributes'][0])) {
         $view->attributes = $data['attributes'];
     }
     // Check if there are values set for the group of the product selected
     if (!empty($data['attributes_values'][0])) {
         $view->values = $data['attributes_values'];
     }
     // Get the products
     if (!empty($data['products'][0])) {
         $view->products = $data['products'];
     }
     $view->mainviewhelper = $mainviewhelper;
     // Path of the template
     return $view->render('productsattributes.phtml');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:33,代码来源:Productlistattributes.php

示例15: grid

 /**
  * create the configuration of the grid
  */
 public static function grid($rowNum = 10)
 {
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $config['datagrid']['columns'][] = array('label' => null, 'field' => 'dp.profile_id', 'alias' => 'profile_id', 'type' => 'selectall');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('ID'), 'field' => 'dp.profile_id', 'alias' => 'profile_id', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Owner'), 'field' => "CONCAT(c.lastname, ' ', c.firstname)", 'alias' => 'owner', 'sortable' => true, 'searchable' => true, 'type' => 'link', 'link' => array('idx' => 'customer_id', 'href' => '/admin/customers/edit/id/%s'));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Company'), 'field' => 'dp.company', 'alias' => 'company', 'sortable' => true, 'searchable' => true, 'type' => 'string');
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Full name'), 'field' => 'CONCAT(dp.firstname, " ", dp.lastname)', 'alias' => 'fullname', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs'));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Email'), 'field' => 'dp.email', 'alias' => 'email', 'sortable' => true, 'searchable' => true, 'type' => 'string', 'attributes' => array('class' => 'visible-lg visible-md hidden-xs'));
     $config['datagrid']['columns'][] = array('label' => $translator->translate('Statuses'), 'field' => 's.status', 'alias' => 'status', 'sortable' => true, 'type' => 'index', 'searchable' => true, 'filterdata' => Statuses::getList('customers'), 'attributes' => array('class' => 'visible-lg visible-md hidden-xs'));
     $config['datagrid']['fields'] = "dp.profile_id,\n\t\t\t\t\t\t\t\t\t\t   dp.company as company,\n\t\t\t\t\t\t\t\t\t\t   CONCAT(c.lastname, ' ', c.firstname) as owner,\n\t\t\t\t\t\t\t\t\t\t   c.customer_id as customer_id,\n\t\t\t\t\t\t\t\t\t\t   CONCAT(dp.firstname, ' ', dp.lastname) as fullname,\n\t\t\t\t\t\t\t\t\t\t   dp.email as email,\n\t\t\t\t\t\t\t\t\t\t   s.status as status";
     $config['datagrid']['rownum'] = $rowNum;
     $dq = Doctrine_Query::create()->select($config['datagrid']['fields'])->from('DomainsProfiles dp')->leftJoin('dp.Statuses s')->leftJoin('dp.Customers c');
     $config['datagrid']['dqrecordset'] = $dq;
     $config['datagrid']['basepath'] = "/admin/domainsprofiles/";
     $config['datagrid']['index'] = "profile_id";
     $config['datagrid']['rowlist'] = array('10', '50', '100', '1000');
     $config['datagrid']['buttons']['edit']['label'] = $translator->translate('Edit');
     $config['datagrid']['buttons']['edit']['cssicon'] = "edit";
     $config['datagrid']['buttons']['edit']['action'] = "/admin/domainsprofiles/edit/id/%d";
     $config['datagrid']['buttons']['delete']['label'] = $translator->translate('Delete');
     $config['datagrid']['buttons']['delete']['cssicon'] = "delete";
     $config['datagrid']['buttons']['delete']['action'] = "/admin/domainsprofiles/confirm/id/%d";
     $config['datagrid']['massactions']['common'] = array();
     return $config;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:29,代码来源:DomainsProfiles.php


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