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


PHP Graph::getName方法代码示例

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


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

示例1: catch

            fRequest::validateCSRFToken(fRequest::get('token'));
            $graph->store();
            fMessaging::create('affected', $manage_url, $graph->getName());
            fMessaging::create('success', $manage_url, 'The Graph ' . $graph->getName() . ' was successfully created');
            fURL::redirect(Graph::makeUrl('edit', $graph));
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/add_edit_graph.php';
} elseif ('delete' == $action) {
    $class_name = 'Graph';
    try {
        $obj = new Graph($graph_id);
        $dashboard = new Dashboard($obj->getDashboardId());
        $delete_text = 'Are you sure you want to delete the graph : <strong>' . $obj->getName() . '</strong>?';
        if (fRequest::isPost()) {
            fRequest::validateCSRFToken(fRequest::get('token'));
            $obj->delete();
            $lines = Line::findAll($graph_id);
            foreach ($lines as $line) {
                $line->delete();
            }
            fMessaging::create('success', Dashboard::makeUrl('edit', $dashboard), 'The graph for ' . $dashboard->getName() . ' was successfully deleted');
            fURL::redirect(Dashboard::makeUrl('edit', $dashboard));
        }
    } catch (fNotFoundException $e) {
        fMessaging::create('error', Dashboard::makeUrl('edit', $dashboard), 'The line requested could not be found');
        fURL::redirect(Dashboard::makeUrl('edit', $dashboard));
    } catch (fExpectedException $e) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
开发者ID:nleskiw,项目名称:Graphite-Tattle,代码行数:31,代码来源:graphs.php

示例2: catch

            fMessaging::create('success', fURL::get(), 'The Graph ' . $graph_to_clone->getName() . ' was successfully cloned');
            fURL::redirect(Dashboard::makeURL('edit', $dashboard));
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/add_edit_dashboard.php';
} elseif ('clone_into' == $action) {
    if (fRequest::isPost()) {
        $graph_to_clone = new Graph($graph_id);
        $dashboard = new Dashboard($dashboard_dest_id);
        try {
            fRequest::validateCSRFToken(fRequest::get('token'));
            Graph::cloneGraph($graph_id, $dashboard_dest_id);
            $url_redirect = Dashboard::makeURL('list');
            fMessaging::create('affected', $url_redirect, $graph_to_clone->getName());
            fMessaging::create('success', "/" . $url_redirect, 'The Graph "' . $graph_to_clone->getName() . '" was successfully cloned into the Dashboard "' . $dashboard->getName() . '"');
            fURL::redirect($url_redirect);
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/list_dashboards.php';
} elseif ('reorder' == $action) {
    $drag_order = fRequest::get('drag_order');
    $error = false;
    if (empty($drag_order)) {
        // In this case, the user clicks on the arrow
        $move = fRequest::getValid('move', array('previous', 'next'));
        $graph_to_move = new Graph($graph_id);
        $dashboard_id = $graph_to_move->getDashboardId();
开发者ID:nagyist,项目名称:Tattle,代码行数:31,代码来源:graphs.php

示例3: __construct

 /**
  * Constructor for GraphTraversal.
  * @param Graph $graph Graph to be traversed.
  */
 public function __construct(&$graph)
 {
     parent::__construct($graph->getName(), $graph->isDirected());
 }
开发者ID:ankitpokhrel,项目名称:g-raph,代码行数:8,代码来源:GraphTraversal.php

示例4: catch

        fMessaging::create('error', Graph::makeUrl('edit', $graph), 'The line requested could not be found');
        fURL::redirect(Graph::makeUrl('edit', $graph));
    } catch (fExpectedException $e) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/delete.php';
    // --------------------------------- //
} elseif ('edit' == $action) {
    try {
        $line = new Line($line_id);
        $graph = new Graph($line->getGraphId());
        if (fRequest::isPost()) {
            $line->populate();
            fRequest::validateCSRFToken(fRequest::get('token'));
            $line->store();
            fMessaging::create('affected', fURL::get(), $graph->getName());
            fMessaging::create('success', fURL::getWithQueryString(), 'The Line ' . $line->getAlias() . ' was successfully updated');
        }
    } catch (fNotFoundException $e) {
        fMessaging::create('error', Graph::makeUrl('edit', $graph), 'The Line requested, ' . fHTML::encode($line_id) . ', could not be found');
        fURL::redirect(Graph::makeUrl('edit', $graph));
    } catch (fExpectedException $e) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/add_edit_line.php';
    // --------------------------------- //
} elseif ('add' == $action) {
    $line = new Line();
    $graph = new Graph($graph_id);
    if (fRequest::isPost()) {
        try {
开发者ID:nleskiw,项目名称:Graphite-Tattle,代码行数:31,代码来源:lines.php

示例5: getGraph

 /**
  * Load a graph using its ID
  * @param $id integer
  * @return Graph if found, otherwise NULL
  */
 public function getGraph($id)
 {
     global $master_db_handle;
     foreach ($this->graphCache as $graphName => $graph) {
         if ($graph->getID() == $id) {
             return $graph;
         }
     }
     $statement = $master_db_handle->prepare('SELECT ID, Plugin, Type, Active, Readonly, Name, DisplayName, Scale, Halfwidth, Position FROM Graph WHERE ID = ?');
     $statement->execute(array($id));
     if ($row = $statement->fetch()) {
         $graph = new Graph($row['ID'], $this, $row['Type'], $row['Name'], $row['DisplayName'], $row['Active'], $row['Readonly'], $row['Position'], $row['Scale'], $row['Halfwidth'] == 1);
         $this->graphCache[$graph->getName()] = $graph;
         return $graph;
     }
     return null;
 }
开发者ID:willies952002,项目名称:mcstats.org,代码行数:22,代码来源:Plugin.class.php

示例6: catch

            fRequest::validateCSRFToken(fRequest::get('token'));
            $graph->store();
            fMessaging::create('affected', fURL::get(), $graph->getName());
            fMessaging::create('success', fURL::getWithQueryString(), 'The Graph ' . $graph->getName() . ' was successfully updated');
            //fURL::redirect($manage_url);
        }
    } catch (fNotFoundException $e) {
        fMessaging::create('error', $manage_url, 'The Graph requested, ' . fHTML::encode($graph_id) . ', could not be found');
        fURL::redirect($manage_url);
    } catch (fExpectedException $e) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/add_edit_graph.php';
    // --------------------------------- //
} elseif ('add' == $action) {
    $graph = new Graph();
    $dashboard = new Dashboard($dashboard_id);
    if (fRequest::isPost()) {
        try {
            $graph->populate();
            fRequest::validateCSRFToken(fRequest::get('token'));
            $graph->store();
            fMessaging::create('affected', $manage_url, $graph->getName());
            fMessaging::create('success', $manage_url, 'The Graph ' . $graph->getName() . ' was successfully created');
            fURL::redirect(Dashboard::makeUrl('edit', $dashboard));
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/add_edit_graph.php';
}
开发者ID:rberger,项目名称:Graphite-Tattle,代码行数:31,代码来源:graphs.php

示例7: cloneGraph

 public static function cloneGraph($graph_id, $dashboard_id = NULL)
 {
     $graph_to_clone = new Graph($graph_id);
     if (empty($dashboard_id)) {
         $dashboard_id = $graph_to_clone->getDashboardId();
     }
     $graph = new Graph();
     $clone_name = 'Clone of ' . $graph_to_clone->getName();
     // If it's too long, we truncate
     if (strlen($clone_name) > 255) {
         $clone_name = substr($clone_name, 0, 255);
     }
     $graph->setName($clone_name);
     $graph->setArea($graph_to_clone->getArea());
     $graph->setVtitle($graph_to_clone->getVtitle());
     $graph->setDescription($graph_to_clone->getDescription());
     $graph->setDashboardId($dashboard_id);
     $graph->setWeight($graph_to_clone->getWeight());
     $graph->setTimeValue($graph_to_clone->getTimeValue());
     $graph->setUnit($graph_to_clone->getUnit());
     $graph->setCustomOpts($graph_to_clone->getCustomOpts());
     $graph->setStartsAtMidnight($graph_to_clone->getStartsAtMidnight());
     $graph->store();
     // Clone of the lines
     $lines = Line::findAll($graph_id);
     foreach ($lines as $line_to_clone) {
         Line::cloneLine($line_to_clone->getLineId(), TRUE, $graph->getGraphId());
     }
 }
开发者ID:nagyist,项目名称:Tattle,代码行数:29,代码来源:Graph.php


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